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 |
---|---|
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|null $name Name of the specific header file to use. null for the default header. |
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 |
|
43 | $templates[] = 'header.php'; |
44 |
|