pre_wp_load_alloptions filter-hookWP 6.2.0

Filters the array of alloptions before it is populated.

Returning an array from the filter will effectively short circuit wp_load_alloptions(), returning that value instead.

Usage

add_filter( 'pre_wp_load_alloptions', 'wp_kama_pre_wp_load_alloptions_filter', 10, 2 );

/**
 * Function for `pre_wp_load_alloptions` filter-hook.
 * 
 * @param array|null $alloptions  An array of alloptions.
 * @param bool       $force_cache Whether to force an update of the local cache from the persistent cache.
 *
 * @return array|null
 */
function wp_kama_pre_wp_load_alloptions_filter( $alloptions, $force_cache ){

	// filter...
	return $alloptions;
}
$alloptions(array|null)
An array of alloptions.
Default: null
$force_cache(true|false)
Whether to force an update of the local cache from the persistent cache.
Default: false

Changelog

Since 6.2.0 Introduced.

Where the hook is called

wp_load_alloptions()
pre_wp_load_alloptions
wp-includes/option.php 596
$alloptions = apply_filters( 'pre_wp_load_alloptions', null, $force_cache );

Where the hook is used in WordPress

Usage not found.