- Timestamp:
- 09/06/2023 09:46:09 PM (15 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/default-filters.php
r56500 r56529 533 533 add_action( 'transition_post_status', '_wp_keep_alive_customize_changeset_dependent_auto_drafts', 20, 3 ); 534 534 535 // Block Theme Previews. 536 add_action( 'plugins_loaded', 'initialize_theme_preview_hooks', 1 ); 537 535 538 // Calendar widget cache. 536 539 add_action( 'save_post', 'delete_get_calendar_cache' ); -
trunk/src/wp-includes/theme-previews.php
r56218 r56529 76 76 } 77 77 78 // Attaches filters to enable theme previews in the Site Editor. 79 if ( ! empty( $_GET['wp_theme_preview'] ) ) { 80 add_filter( 'stylesheet', 'wp_get_theme_preview_path' ); 81 add_filter( 'template', 'wp_get_theme_preview_path' ); 82 add_action( 'init', 'wp_attach_theme_preview_middleware' ); 83 add_action( 'admin_head', 'wp_block_theme_activate_nonce' ); 78 /** 79 * Add filters and actions to enable Block Theme Previews in the Site Editor. 80 * 81 * The filters and actions should be added after `pluggable.php` is included as they may 82 * trigger code that uses `current_user_can()` which requires functionality from `pluggable.php`. 83 * 84 * @since 6.3.2 85 */ 86 function initialize_theme_preview_hooks() { 87 if ( ! empty( $_GET['wp_theme_preview'] ) ) { 88 add_filter( 'stylesheet', 'wp_get_theme_preview_path' ); 89 add_filter( 'template', 'wp_get_theme_preview_path' ); 90 add_action( 'init', 'wp_attach_theme_preview_middleware' ); 91 add_action( 'admin_head', 'wp_block_theme_activate_nonce' ); 92 } 84 93 }
Note: See TracChangeset
for help on using the changeset viewer.