wp_before_load_template
Fires before a template file is loaded.
Usage
add_action( 'wp_before_load_template', 'wp_kama_before_load_template_action', 10, 3 ); /** * Function for `wp_before_load_template` action-hook. * * @param string $_template_file The full path to the template file. * @param bool $load_once Whether to require_once or require. * @param array $args Additional arguments passed to the template. * * @return void */ function wp_kama_before_load_template_action( $_template_file, $load_once, $args ){ // action... }
- $_template_file(string)
- The full path to the template file.
- $load_once(true|false)
- Whether to require_once or require.
- $args(array)
- Additional arguments passed to the template.
Changelog
Since 6.1.0 | Introduced. |
Where the hook is called
wp_before_load_template
wp-includes/template.php 807
do_action( 'wp_before_load_template', $_template_file, $load_once, $args );