wp_loading_optimization_force_header_contexts filter-hookWP 6.4.0

Filters the header-specific contexts.

Usage

add_filter( 'wp_loading_optimization_force_header_contexts', 'wp_kama_loading_optimization_force_header_contexts_filter' );

/**
 * Function for `wp_loading_optimization_force_header_contexts` filter-hook.
 * 
 * @param array $default_header_enforced_contexts Map of contexts for which elements should be considered in the header of the page, as $context => $enabled pairs. The $enabled should always be true.
 *
 * @return array
 */
function wp_kama_loading_optimization_force_header_contexts_filter( $default_header_enforced_contexts ){

	// filter...
	return $default_header_enforced_contexts;
}
$default_header_enforced_contexts(array)
Map of contexts for which elements should be considered in the header of the page, as $context => $enabled pairs. The $enabled should always be true.

Changelog

Since 6.4.0 Introduced.

Where the hook is called

wp_get_loading_optimization_attributes()
wp_loading_optimization_force_header_contexts
wp-includes/media.php 5862
$header_enforced_contexts = apply_filters( 'wp_loading_optimization_force_header_contexts', $header_enforced_contexts );

Where the hook is used in WordPress

Usage not found.