Block Editor: Use a unique name for the nonce of the custom fields toggle form.
Avoids a browser warning for having two elements with a non-unique id `#_wpnonce` on the post edit screen. See #23165. Fixes #51483. Props vandestouwe, Mista-Flo. Built from https://develop.svn.wordpress.org/trunk@50255 git-svn-id: http://core.svn.wordpress.org/trunk@49900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
591845b4c9
commit
219d92f75b
|
@ -2303,7 +2303,7 @@ function the_block_editor_meta_boxes() {
|
||||||
<?php the_block_editor_meta_box_post_form_hidden_fields( $post ); ?>
|
<?php the_block_editor_meta_box_post_form_hidden_fields( $post ); ?>
|
||||||
</form>
|
</form>
|
||||||
<form id="toggle-custom-fields-form" method="post" action="<?php echo esc_attr( admin_url( 'post.php' ) ); ?>">
|
<form id="toggle-custom-fields-form" method="post" action="<?php echo esc_attr( admin_url( 'post.php' ) ); ?>">
|
||||||
<?php wp_nonce_field( 'toggle-custom-fields' ); ?>
|
<?php wp_nonce_field( 'toggle-custom-fields', 'toggle-custom-fields-nonce' ); ?>
|
||||||
<input type="hidden" name="action" value="toggle-custom-fields" />
|
<input type="hidden" name="action" value="toggle-custom-fields" />
|
||||||
</form>
|
</form>
|
||||||
<?php foreach ( $locations as $location ) : ?>
|
<?php foreach ( $locations as $location ) : ?>
|
||||||
|
|
|
@ -339,7 +339,7 @@ switch ( $action ) {
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
case 'toggle-custom-fields':
|
case 'toggle-custom-fields':
|
||||||
check_admin_referer( 'toggle-custom-fields' );
|
check_admin_referer( 'toggle-custom-fields', 'toggle-custom-fields-nonce' );
|
||||||
|
|
||||||
$current_user_id = get_current_user_id();
|
$current_user_id = get_current_user_id();
|
||||||
if ( $current_user_id ) {
|
if ( $current_user_id ) {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.7-beta1-50238';
|
$wp_version = '5.7-beta1-50255';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue