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 |
|---|---|
| 6862 | * Filters extra file headers by context. |
| 6863 | * |
| 6864 | * The dynamic portion of the hook name, `$context`, refers to |
| 6865 | * the context where extra headers might be loaded. |
| 6866 | * |
| 6867 | * @since 2.9.0 |
| 6868 | * |
| 6869 | * @param array $extra_context_headers Empty array by default. |
| 6870 | */ |
| 6871 | $extra_headers = $context ? apply_filters( "extra_{$context}_headers", array() ) : array(); |
| 6872 | if ( $extra_headers ) { |
| 6873 | $extra_headers = array_combine( $extra_headers, $extra_headers ); // Keys equal values. |
| 6874 | $all_headers = array_merge( $extra_headers, (array) $default_headers ); |
| 6875 | } else { |
| 6876 | $all_headers = $default_headers; |
| 6877 | } |
| 6878 | |
| 6879 | foreach ( $all_headers as $field => $regex ) { |
| 6880 | if ( preg_match( '/^(?:[ \t]*<\?php)?[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, $match ) && $match[1] ) { |