wp-includes/theme-previews.php:86Add filters and actions to enable Block Theme Previews in the Site Editor.
function wp_initialize_theme_preview_hooks() { if ( ! empty( $_GET['wp_theme_preview'] ) ) { add_filter( 'stylesheet', 'wp_get_theme_preview_path' ); add_filter( 'template', 'wp_get_theme_preview_path' ); add_action( 'init', 'wp_attach_theme_preview_middleware' ); add_action( 'admin_head', 'wp_block_theme_activate_nonce' ); }}Introduced in 6.3.2. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/theme-previews.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.