WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 114 | $template = apply_filters( 'template_include', $template ); |
| 115 | if ( $template ) { |
| 116 | /** |
| 117 | * Fires immediately before including the template. |
| 118 | * |
| 119 | * @since 6.9.0 |
| 120 | * |
| 121 | * @param string $template The path of the template about to be included. |
| 122 | */ |
| 123 | do_action( 'wp_before_include_template', $template ); |
| 124 | |
| 125 | include $template; |
| 126 | } elseif ( current_user_can( 'switch_themes' ) ) { |
| 127 | $theme = wp_get_theme(); |
| 128 | if ( $theme->errors() ) { |
| 129 | wp_die( $theme->errors() ); |
| 130 | } |
| 131 | } |
| 132 | return; |