Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: extra_{$context}_headers

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
3891       * Filter extra file headers by context.
3892       *
3893       * The dynamic portion of the hook name, $context, refers to the context
3894       * where extra headers might be loaded.
3895       *
3896       * @since 2.9.0
3897       *
3898       * @param array $extra_context_headers Empty array by default.
3899       */
3900      if ( $context && $extra_headers = apply_filters( "extra_{$context}_headers", array() ) ) {
3901           $extra_headers = array_combine( $extra_headers, $extra_headers ); // keys equal values
3902           $all_headers = array_merge( $extra_headers, (array) $default_headers );
3903      } else {
3904           $all_headers = $default_headers;
3905      }
3906
3907      foreach ( $all_headers as $field => $regex ) {
3908           if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, $match ) && $match[1] )
3909                $all_headers[ $field ] = _cleanup_header_comment( $match[1] );