WordPress.org

Make WordPress Core

Ticket #51483: 51483.2.patch

File 51483.2.patch, 1.7 KB (added by Mista-Flo, 11 months ago)

Patch refreshed

  • src/wp-admin/includes/post.php

    diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php
    index cb2cd060dd..e103de0655 100644
    a b function the_block_editor_meta_boxes() { 
    23002300        // Render meta boxes.
    23012301        ?>
    23022302        <form class="metabox-base-form">
    2303         <?php the_block_editor_meta_box_post_form_hidden_fields( $post ); ?>
     2303                <?php the_block_editor_meta_box_post_form_hidden_fields( $post ); ?>
    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' ); ?>
    2307                 <input type="hidden" name="action" value="toggle-custom-fields" />
     2306                <?php wp_nonce_field( 'toggle-custom-fields', 'toggle-custom-fields-nonce' ); ?>
     2307                <input type="hidden" name="action" value="toggle-custom-fields"/>
    23082308        </form>
    23092309        <?php foreach ( $locations as $location ) : ?>
    23102310                <form class="metabox-location-<?php echo esc_attr( $location ); ?>" onsubmit="return false;">
    function the_block_editor_meta_box_post_form_hidden_fields( $post ) { 
    24212421        $referer      = wp_get_referer();
    24222422        $current_user = wp_get_current_user();
    24232423        $user_id      = $current_user->ID;
    2424         wp_nonce_field( $nonce_action );
     2424        wp_nonce_field( $nonce_action, $nonce_action . '-nonce' );
    24252425
    24262426        /*
    24272427         * Some meta boxes hook into these actions to add hidden input fields in the classic post form. For backwards
    function the_block_editor_meta_box_post_form_hidden_fields( $post ) { 
    24352435        $classic_output = ob_get_clean();
    24362436
    24372437        $classic_elements = wp_html_split( $classic_output );
    2438         $hidden_inputs    = '';
    24392438        foreach ( $classic_elements as $element ) {
    24402439                if ( 0 !== strpos( $element, '<input ' ) ) {
    24412440                        continue;