Title: wp-includes/theme-previews.php | Developer.WordPress.org

---

# File: wp-includes/theme-previews.php

 * function[wp_initialize_theme_preview_hooks()](https://developer.wordpress.org/reference/functions/wp_initialize_theme_preview_hooks/)
 * Add filters and actions to enable Block Theme Previews in the Site Editor.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/wp_initialize_theme_preview_hooks/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/functions/wp_initialize_theme_preview_hooks/#uses)
   | Source: [wp-includes/theme-previews.php:86](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/theme-previews.php#L86-L93)
 * function[wp_get_theme_preview_path()](https://developer.wordpress.org/reference/functions/wp_get_theme_preview_path/)
 * Filters the blog option to return the path for the previewed theme.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/wp_get_theme_preview_path/#used-by)
   | Uses [9 functions](https://developer.wordpress.org/reference/functions/wp_get_theme_preview_path/#uses)
   | Source: [wp-includes/theme-previews.php:16](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/theme-previews.php#L16-L34)
 * function[wp_attach_theme_preview_middleware()](https://developer.wordpress.org/reference/functions/wp_attach_theme_preview_middleware/)
 * Adds a middleware to `apiFetch` to set the theme for the preview.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/wp_attach_theme_preview_middleware/#used-by)
   | Uses [5 functions](https://developer.wordpress.org/reference/functions/wp_attach_theme_preview_middleware/#uses)
   | Source: [wp-includes/theme-previews.php:42](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/theme-previews.php#L42-L56)
 * function[wp_block_theme_activate_nonce()](https://developer.wordpress.org/reference/functions/wp_block_theme_activate_nonce/)
 * Set a JavaScript constant for theme activation.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/wp_block_theme_activate_nonce/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/wp_block_theme_activate_nonce/#uses)
   | Source: [wp-includes/theme-previews.php:69](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/theme-previews.php#L69-L76)