diff --git a/src/wp-includes/default-filters.php b/src/wp-includes/default-filters.php index c08073326cafc..a3ea1537cb1d0 100644 --- a/src/wp-includes/default-filters.php +++ b/src/wp-includes/default-filters.php @@ -532,6 +532,9 @@ add_action( 'delete_attachment', '_delete_attachment_theme_mod' ); add_action( 'transition_post_status', '_wp_keep_alive_customize_changeset_dependent_auto_drafts', 20, 3 ); +// Block Theme Previews. +add_action( 'plugins_loaded', 'initialize_theme_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/src/wp-includes/theme-previews.php b/src/wp-includes/theme-previews.php index e8e4a6a8c8d5d..d3f5c631c9b24 100644 --- a/src/wp-includes/theme-previews.php +++ b/src/wp-includes/theme-previews.php @@ -75,10 +75,19 @@ function wp_block_theme_activate_nonce() { assertEquals( has_filter( 'stylesheet', 'wp_get_theme_preview_path' ), 10 ); + $this->assertEquals( has_filter( 'template', 'wp_get_theme_preview_path' ), 10 ); + $this->assertEquals( has_action( 'init', 'wp_attach_theme_preview_middleware' ), 10 ); + $this->assertEquals( has_action( 'admin_head', 'wp_block_theme_activate_nonce' ), 10 ); + } +}