Make WordPress Core

Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#37517 closed defect (bug) (worksforme)

additional argument for GET_OPTION and UPDATE_OPTION

Reported by: tazotodua's profile tazotodua Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Options, Meta APIs Keywords:
Focuses: Cc:

Description

on my plugin/settings page, at first i get an option, then on the same request i might update that option.

but the option is cached, and updating is not reflected correctly.
for that, i think, there should be additional argument:

get_option(name, default, $get_fresh=false)
update_option(name,value, autoload, $get_fresh=false);

in case i set $get_fresh to true, it should overcome cache and make new request, not getting the cached values.

Change History (3)

#1 @dd32
8 years ago

This shouldn't be needed, as update_option() will update the cache that get_option() uses.

However, there is a race condition that can cause that not to be so, for example #25623 which is getting fixed via #31245. That should only happen for people using cache dropins (such as Memcache or Redis) so shouldn't be affected.

#2 @tazotodua
7 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

#3 @netweb
7 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.