wppaste
WordPress

apply_filters( 'pre_wp_load_alloptions', array|null $alloptions, bool $force_cache )

Since
6.2.0
Filters the array of alloptions before it is populated.

Description

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

Compatibility

WordPress
since 6.2.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$alloptionsarray|null
An array of alloptions. Default null.
$force_cachebool
Whether to force an update of the local cache from the persistent cache. Default false.

Where this hook fires · 1

  • wp-includes/option.php:614wp_load_alloptions()

Source code

	 *	 * @since 6.2.0	 *	 * @param array|null $alloptions  An array of alloptions. Default null.	 * @param bool       $force_cache Whether to force an update of the local cache from the persistent cache. Default false.	 */	$alloptions = apply_filters( 'pre_wp_load_alloptions', null, $force_cache );	if ( is_array( $alloptions ) ) {		return $alloptions;	} 	if ( ! wp_installing() || ! is_multisite() ) {		$alloptions = wp_cache_get( 'alloptions', 'options', $force_cache );

Changelog

Introduced in 6.2.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.