Make WordPress Core

Ticket #37897: 37897.patch

File 37897.patch, 1.8 KB (added by johnbillion, 8 years ago)
  • src/wp-includes/customize/class-wp-customize-selective-refresh.php

     
    314314                 * WP_Customize_Manager::setup_theme() is where the previewing flag is set.
    315315                 */
    316316                if ( ! is_customize_preview() ) {
    317                         status_header( 403 );
    318                         wp_send_json_error( 'expected_customize_preview' );
     317                        wp_send_json_error( 'expected_customize_preview', 403 );
    319318                } else if ( ! isset( $_POST['partials'] ) ) {
    320                         status_header( 400 );
    321                         wp_send_json_error( 'missing_partials' );
     319                        wp_send_json_error( 'missing_partials', 400 );
    322320                }
    323321
    324322                $partials = json_decode( wp_unslash( $_POST['partials'] ), true );
  • src/wp-includes/class-wp-customize-nav-menus.php

     
    749749         */
    750750        public function ajax_insert_auto_draft_post() {
    751751                if ( ! check_ajax_referer( 'customize-menus', 'customize-menus-nonce', false ) ) {
    752                         status_header( 400 );
    753                         wp_send_json_error( 'bad_nonce' );
     752                        wp_send_json_error( 'bad_nonce', 400 );
    754753                }
    755754
    756755                if ( ! current_user_can( 'customize' ) ) {
    757                         status_header( 403 );
    758                         wp_send_json_error( 'customize_not_allowed' );
     756                        wp_send_json_error( 'customize_not_allowed', 403 );
    759757                }
    760758
    761759                if ( empty( $_POST['params'] ) || ! is_array( $_POST['params'] ) ) {
    762                         status_header( 400 );
    763                         wp_send_json_error( 'missing_params' );
     760                        wp_send_json_error( 'missing_params', 400 );
    764761                }
    765762
    766763                $params = wp_array_slice_assoc(