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 |
---|---|
3668 | // Pull only the first 8kiB of the file in. |
3669 | $file_data = fread( $fp, 8192 ); |
3670 |
|
3671 | // PHP will close file handle, but we are good citizens. |
3672 | fclose( $fp ); |
3673 |
|
3674 | // Make sure we catch CR-only line endings. |
3675 | $file_data = str_replace( "\r", "\n", $file_data ); |
3676 |
|
3677 | if ( $context && $extra_headers = apply_filters( "extra_{$context}_headers", array() ) ) { |
3678 | $extra_headers = array_combine( $extra_headers, $extra_headers ); // keys equal values |
3679 | $all_headers = array_merge( $extra_headers, (array) $default_headers ); |
3680 | } else { |
3681 | $all_headers = $default_headers; |
3682 | } |
3683 |
|
3684 | foreach ( $all_headers as $field => $regex ) { |
3685 | if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, $match ) && $match[1] ) |
3686 | $all_headers[ $field ] = _cleanup_header_comment( $match[1] ); |