diff --git a/wp-includes/block-editor.php b/wp-includes/block-editor.php index 007c713190..2bd9f2dfbf 100644 --- a/wp-includes/block-editor.php +++ b/wp-includes/block-editor.php @@ -856,3 +856,21 @@ function get_classic_theme_supports_block_editor_settings() { return $theme_settings; } + +/** + * Initialize site preview. + * + * This function sets IFRAME_REQUEST to true if the site preview parameter is set. + * + * @since 6.8.0 + */ +function wp_initialize_site_preview_hooks() { + if ( + ! defined( 'IFRAME_REQUEST' ) && + isset( $_GET['wp_site_preview'] ) && + 1 === (int) $_GET['wp_site_preview'] && + current_user_can( 'edit_theme_options' ) + ) { + define( 'IFRAME_REQUEST', true ); + } +} diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php index d143652dd8..f6d80b091c 100644 --- a/wp-includes/default-filters.php +++ b/wp-includes/default-filters.php @@ -551,6 +551,9 @@ add_action( 'transition_post_status', '_wp_keep_alive_customize_changeset_depend // Block Theme Previews. add_action( 'plugins_loaded', 'wp_initialize_theme_preview_hooks', 1 ); +// Site preview for Classic Theme. +add_action( 'init', 'wp_initialize_site_preview_hooks', 1 ); + // Calendar widget cache. add_action( 'save_post', 'delete_get_calendar_cache' ); add_action( 'delete_post', 'delete_get_calendar_cache' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 37b8b4854b..32dd229614 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-beta2-59993'; +$wp_version = '6.8-beta2-60003'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.