Ticket #54160: 54160.2.diff
File 54160.2.diff, 2.3 KB (added by , 3 years ago) |
---|
-
wp-includes/theme.php
function _wp_customize_include() { 3357 3357 ); 3358 3358 3359 3359 $theme = null; 3360 3360 $autosaved = null; 3361 3361 $messenger_channel = null; 3362 3362 3363 3363 // Value false indicates UUID should be determined after_setup_theme 3364 3364 // to either re-use existing saved changeset or else generate a new UUID if none exists. 3365 3365 $changeset_uuid = false; 3366 3366 3367 3367 // Set initially fo false since defaults to true for back-compat; 3368 3368 // can be overridden via the customize_changeset_branching filter. 3369 3369 $branching = false; 3370 3370 3371 3371 if ( $is_customize_admin_page && isset( $input_vars['changeset_uuid'] ) ) { 3372 $changeset_uuid = sanitize_key( $input_vars['changeset_uuid'] );3372 $changeset_uuid = $input_vars['changeset_uuid']; 3373 3373 } elseif ( ! empty( $input_vars['customize_changeset_uuid'] ) ) { 3374 $changeset_uuid = sanitize_key( $input_vars['customize_changeset_uuid'] ); 3374 $changeset_uuid = $input_vars['customize_changeset_uuid']; 3375 } 3376 3377 // Sanitize UUID 3378 if ( $changeset_uuid && ! wp_is_uuid( $changeset_uuid ) ) { 3379 $changeset_uuid = false; 3375 3380 } 3376 3381 3377 3382 // Note that theme will be sanitized via WP_Theme. 3378 3383 if ( $is_customize_admin_page && isset( $input_vars['theme'] ) ) { 3379 3384 $theme = $input_vars['theme']; 3380 3385 } elseif ( isset( $input_vars['customize_theme'] ) ) { 3381 3386 $theme = $input_vars['customize_theme']; 3382 3387 } 3383 3388 3384 3389 if ( ! empty( $input_vars['customize_autosaved'] ) ) { 3385 3390 $autosaved = true; 3386 3391 } 3387 3392 3388 if ( isset( $input_vars['customize_messenger_channel'] ) ) {3393 if ( isset( $input_vars['customize_messenger_channel'] ) && is_string( $input_vars['customize_messenger_channel'] ) ) { 3389 3394 $messenger_channel = sanitize_key( $input_vars['customize_messenger_channel'] ); 3390 3395 } 3391 3396 3392 3397 /* 3393 3398 * Note that settings must be previewed even outside the customizer preview 3394 3399 * and also in the customizer pane itself. This is to enable loading an existing 3395 3400 * changeset into the customizer. Previewing the settings only has to be prevented 3396 3401 * here in the case of a customize_save action because this will cause WP to think 3397 3402 * there is nothing changed that needs to be saved. 3398 3403 */ 3399 3404 $is_customize_save_action = ( 3400 3405 wp_doing_ajax() 3401 3406 && 3402 3407 isset( $_REQUEST['action'] ) 3403 3408 &&