Filter hook 'extra_{$context}_headers'

in WP Core File wp-includes/functions.php at line 6919

View Source

extra_{$context}_headers

Filter Hook
Description
Filters extra file headers by context. The dynamic portion of the hook name, `$context`, refers to the context where extra headers might be loaded.

Hook Information

File Location wp-includes/functions.php View on GitHub
Hook Type Filter
Line Number 6919

Hook Parameters

Type Name Description
array $extra_context_headers Empty array by default.

Usage Examples

Basic Usage
<?php
// Hook into extra_{$context}_headers
add_filter('extra_{$context}_headers', 'my_custom_filter', 10, 1);

function my_custom_filter($extra_context_headers) {
    // Your custom filtering logic here
    return $extra_context_headers;
}

Source Code Context

wp-includes/functions.php:6919 - How this hook is used in WordPress core
<?php
6914  	 *
6915  	 * @since 2.9.0
6916  	 *
6917  	 * @param array $extra_context_headers Empty array by default.
6918  	 */
6919  	$extra_headers = $context ? apply_filters( "extra_{$context}_headers", array() ) : array();
6920  	if ( $extra_headers ) {
6921  		$extra_headers = array_combine( $extra_headers, $extra_headers ); // Keys equal values.
6922  		$all_headers   = array_merge( $extra_headers, (array) $default_headers );
6923  	} else {
6924  		$all_headers = $default_headers;

PHP Documentation

<?php
/**
	 * Filters extra file headers by context.
	 *
	 * The dynamic portion of the hook name, `$context`, refers to
	 * the context where extra headers might be loaded.
	 *
	 * @since 2.9.0
	 *
	 * @param array $extra_context_headers Empty array by default.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/functions.php
Related Hooks

Related hooks will be displayed here in future updates.