Make WordPress Core

Ticket #40018: 40018.diff

File 40018.diff, 907 bytes (added by westonruter, 8 years ago)
  • src/wp-includes/customize/class-wp-customize-selective-refresh.php

    diff --git src/wp-includes/customize/class-wp-customize-selective-refresh.php src/wp-includes/customize/class-wp-customize-selective-refresh.php
    index 23d5a94885..6c04a73698 100644
    final class WP_Customize_Selective_Refresh { 
    324324                 */
    325325                if ( ! is_customize_preview() ) {
    326326                        wp_send_json_error( 'expected_customize_preview', 403 );
    327                 } else if ( ! isset( $_POST['partials'] ) ) {
     327                } elseif ( ! isset( $_POST['partials'] ) ) {
    328328                        wp_send_json_error( 'missing_partials', 400 );
    329329                }
    330330
     331                // Ensure that doing selective refresh on 404 template doesn't result in fallback rendering behavior (full refreshes).
     332                status_header( 200 );
     333
    331334                $partials = json_decode( wp_unslash( $_POST['partials'] ), true );
    332335
    333336                if ( ! is_array( $partials ) ) {