Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_before_include_template

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

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;