wp_before_include_template action-hookWP 6.9.0

Fires immediately before including the template.

Usage

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(string)
The path of the template about to be included.

Changelog

Since 6.9.0 Introduced.

Where the hook is called

In file: /wp-includes/template-loader.php
wp_before_include_template
wp-includes/template-loader.php 123
do_action( 'wp_before_include_template', $template );

Where the hook is used in 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.