Make WordPress Core

Changeset 50255


Ignore:
Timestamp:
02/08/2021 09:37:34 PM (4 years ago)
Author:
ocean90
Message:

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.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/post.php

    r49936 r50255  
    23042304    </form>
    23052305    <form id="toggle-custom-fields-form" method="post" action="<?php echo esc_attr( admin_url( 'post.php' ) ); ?>">
    2306         <?php wp_nonce_field( 'toggle-custom-fields' ); ?>
     2306        <?php wp_nonce_field( 'toggle-custom-fields', 'toggle-custom-fields-nonce' ); ?>
    23072307        <input type="hidden" name="action" value="toggle-custom-fields" />
    23082308    </form>
  • trunk/src/wp-admin/post.php

    r49125 r50255  
    340340
    341341    case 'toggle-custom-fields':
    342         check_admin_referer( 'toggle-custom-fields' );
     342        check_admin_referer( 'toggle-custom-fields', 'toggle-custom-fields-nonce' );
    343343
    344344        $current_user_id = get_current_user_id();
Note: See TracChangeset for help on using the changeset viewer.