do_action( 'wp_before_load_template', string $_template_file, bool $load_once, array $args )
- Since
- 6.1.0
Fires before a template file is loaded.
Compatibility
- WordPress
- since 6.1.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$_template_filestring- The full path to the template file.
$load_oncebool- Whether to require_once or require.
$argsarray- Additional arguments passed to the template.
Where this hook fires · 1
wp-includes/template.php:811load_template()
Source code
* @since 6.1.0 * * @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. */ do_action( 'wp_before_load_template', $_template_file, $load_once, $args ); if ( $load_once ) { require_once $_template_file; } else { require $_template_file; }Changelog
Introduced in 6.1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.