Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: get_header

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
26       * The hook allows a specific header template file to be used in place of the
27       * default header template file. If your file is called header-new.php,
28       * you would specify the filename in the hook as get_header( 'new' ).
29       *
30       * @since 2.1.0
31       * @since 2.8.0 $name parameter added.
32       *
33       * @param string $name Name of the specific header file to use.
34       */
35      do_action( 'get_header', $name );
36
37      $templates = array();
38      $name = (string) $name;
39      if ( '' !== $name )
40           $templates[] = "header-{$name}.php";
41
42      $templates[] = 'header.php';
43
44      // Backward compat code will be removed in a future release