Fix general nonce not always being used
Going just by the name attribute can result in the wrong one being queried if there are more than one on the page.
This commit is contained in:
parent
fd57ea0e3d
commit
b552d7a6ae
@ -70,7 +70,7 @@ do_action( 'fictioneer_after_main', $args );
|
||||
?>
|
||||
|
||||
<?php /* Adding the AJAX nonce this way allows caching plugins to update it dynamically. */ ?>
|
||||
<input name="fictioneer_nonce" type="hidden" value="<?php echo wp_create_nonce( 'fictioneer_nonce' ); ?>">
|
||||
<input id="general-fictioneer-nonce" name="fictioneer_nonce" type="hidden" value="<?php echo wp_create_nonce( 'fictioneer_nonce' ); ?>">
|
||||
|
||||
<?php
|
||||
// Lightbox container
|
||||
|
2
js/complete.min.js
vendored
2
js/complete.min.js
vendored
File diff suppressed because one or more lines are too long
2
js/utility.min.js
vendored
2
js/utility.min.js
vendored
File diff suppressed because one or more lines are too long
@ -667,7 +667,9 @@ function fcn_isValidUrl(url) {
|
||||
*/
|
||||
|
||||
function fcn_getNonce() {
|
||||
return _$$$('fictioneer-ajax-nonce')?.value ?? _$('[name="fictioneer_nonce"]')?.value ?? 0;
|
||||
return _$$$('fictioneer-ajax-nonce')?.value ??
|
||||
_$$$('general-fictioneer-nonce')?.value ??
|
||||
_$('[name="fictioneer_nonce"]')?.value ?? 0;
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
Loading…
x
Reference in New Issue
Block a user