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
3495      // Pull only the first 8kiB of the file in.
3496      $file_data = fread( $fp, 8192 );
3497
3498      // PHP will close file handle, but we are good citizens.
3499      fclose( $fp );
3500
3501      // Make sure we catch CR-only line endings.
3502      $file_data = str_replace( "\r", "\n", $file_data );
3503
3504      if ( $context && $extra_headers = apply_filters( "extra_{$context}_headers", array() ) ) {
3505           $extra_headers = array_combine( $extra_headers, $extra_headers ); // keys equal values
3506           $all_headers = array_merge( $extra_headers, (array) $default_headers );
3507      } else {
3508           $all_headers = $default_headers;
3509      }
3510
3511      foreach ( $all_headers as $field => $regex ) {
3512           if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, $match ) && $match[1] )
3513                $all_headers[ $field ] = _cleanup_header_comment( $match[1] );