Make WordPress Core

Ticket #35662: 35662.diff

File 35662.diff, 753 bytes (added by adamsilverstein, 9 years ago)
  • src/wp-includes/rest-api/class-wp-rest-server.php

     
    251251                }
    252252
    253253                /**
     254                 * Send a refreshed nonce header on authenticated requests.
     255                 *
     256                 * @since 4.5.0
     257                 *
     258                 * @param bool $rest_send_refreshed_nonce Whether to send a refreshed nonce in the response headers.
     259                 */
     260                $rest_send_refreshed_nonce = apply_filters( 'rest_send_refreshed_nonce', is_user_logged_in() );
     261                $this->send_header( 'X-WP-Nonce', wp_create_nonce( 'wp_rest' ) );
     262
     263                /**
    254264                 * Filter whether the REST API is enabled.
    255265                 *
    256266                 * @since 4.4.0