WordPress.org

Make WordPress Core

Opened 5 weeks ago

#44412 new defect (bug)

'pre_cache_alloptions' filter in wp_load_alloptions() in option.php cannot be hooked

Reported by: redsnowcompany Owned by:
Milestone: Awaiting Review Priority: normal
Severity: major Version:
Component: General Keywords:
Focuses: Cc:

Description

Whenever wordpress loads, it fetches all options with the wp_load_alloptions() function in the option.php file. There is a filter in the function before sending it to the cache: {{{#!php <?php $alloptions = apply_filters( 'pre_cache_alloptions', $alloptions ); }}}.

However, there is no way to hook into this filter in the theme or plugin because the theme or plugin are loaded afterwards.

So the full array is always send to the cache.

We were having trouble with a site that loaded all of the options with autoload 'yes' and it crashed with a memory limit exhausted error because there were too many options.

An action needs to be added to hook into this filter or move the calling of this function some steps further after a theme or plugin is loaded.

Change History (0)

Note: See TracTickets for help on using tickets.