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
6127       * Filters extra file headers by context.
6128       *
6129       * The dynamic portion of the hook name, `$context`, refers to
6130       * the context where extra headers might be loaded.
6131       *
6132       * @since 2.9.0
6133       *
6134       * @param array $extra_context_headers Empty array by default.
6135       */
6136      $extra_headers = $context ? apply_filters( "extra_{$context}_headers", array() ) : array();
6137      if ( $extra_headers ) {
6138           $extra_headers = array_combine( $extra_headers, $extra_headers ); // Keys equal values.
6139           $all_headers   = array_merge( $extra_headers, (array) $default_headers );
6140      } else {
6141           $all_headers = $default_headers;
6142      }
6143
6144      foreach ( $all_headers as $field => $regex ) {
6145           if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, $match ) && $match[1] ) {