wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes
wp_initialize_theme_preview_hooks › WordPress Function
Depuis6.3.2
Dépréciéen/a
› wp_initialize_theme_preview_hooks ( Pas de paramètres )
Défini(e) dans: |
|
Codex: |
Add filters and actions to enable Block Theme Previews in the Site Editor.
The filters and actions should be added afterpluggable.php
is included as they may
trigger code that uses current_user_can()
which requires functionality from pluggable.php
.Fonctions en relation: wp_get_theme_preview_path, wp_initialize_site, create_initial_theme_features, wp_initial_nav_menu_meta_boxes, wp_uninitialize_site
Source
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' ); } }