template_include
Filters the path of the current template before including it.
Usage
add_filter( 'template_include', 'wp_kama_template_include_filter' ); /** * Function for `template_include` filter-hook. * * @param string $template The path of the template to include. * * @return string */ function wp_kama_template_include_filter( $template ){ // filter... return $template; }
- $template(string)
- The path of the template to include.
Changelog
Since 3.0.0 | Introduced. |
Where the hook is called
In file: /wp-includes/template-loader.php
wp-includes/template-loader.php 104
$template = apply_filters( 'template_include', $template );