wp_before_include_template
Fires immediately before including the template.
Использование
add_action( 'wp_before_include_template', 'wp_kama_before_include_template_action' );
/**
* Function for `wp_before_include_template` action-hook.
*
* @param string $template The path of the template about to be included.
*
* @return void
*/
function wp_kama_before_include_template_action( $template ){
// action...
}
- $template(строка)
- The path of the template about to be included.
Список изменений
| С версии 6.9.0 | Введена. |
Где вызывается хук
В файле: /wp-includes/template-loader.php
wp-includes/template-loader.php 130
do_action( 'wp_before_include_template', $template );
Где используется хук в WordPress
wp-includes/default-filters.php 426
add_action( 'wp_before_include_template', 'wp_start_template_enhancement_output_buffer', 1000 ); // Late priority to let `wp_template_enhancement_output_buffer` filters and `wp_finalized_template_enhancement_output_buffer` actions be registered.