Action hook 'wp_after_load_template'

in WP Core File wp-includes/template.php at line 824

View Source

wp_after_load_template

Action Hook
Description
Fires after a template file is loaded.

Hook Information

File Location wp-includes/template.php View on GitHub
Hook Type Action
Line Number 824

Hook Parameters

Type Name Description
string $_template_file The full path to the template file.
bool $load_once Whether to require_once or require.
array $args Additional arguments passed to the template.

Usage Examples

Basic Usage
<?php
// Hook into wp_after_load_template
add_action('wp_after_load_template', 'my_custom_function', 10, 3);

function my_custom_function($_template_file, $load_once, $args) {
    // Your custom code here
}

Source Code Context

wp-includes/template.php:824 - How this hook is used in WordPress core
<?php
 819  	 *
 820  	 * @param string $_template_file The full path to the template file.
 821  	 * @param bool   $load_once      Whether to require_once or require.
 822  	 * @param array  $args           Additional arguments passed to the template.
 823  	 */
 824  	do_action( 'wp_after_load_template', $_template_file, $load_once, $args );
 825  }

PHP Documentation

<?php
/**
	 * Fires after a template file is loaded.
	 *
	 * @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.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 3
  • File: wp-includes/template.php
Related Hooks

Related hooks will be displayed here in future updates.