Source View: {$type}_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.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: 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.

Source View

Line Code
32       *
33       * The dynamic portion of the hook name, `$type`, refers to the filename
34       * -- minus the extension -- of the file to load. This hook also applies
35       * to various types of files loaded as part of the Template Hierarchy.
36       *
37       * @since 1.5.0
38       *
39       * @param string $template Path to the template. See {@see locate_template()}.
40       */
41      return apply_filters( "{$type}_template", $template );
42 }
43
44 /**
45  * Retrieve path of index template in current or parent template.
46  *
47  * The template path is filterable via the 'index_template' hook.
48  *
49  * @since 3.0.0
50  *