WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#37517 closed defect (bug) (worksforme)

additional argument for GET_OPTION and UPDATE_OPTION

Reported by: 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
5 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
4 years ago

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

#3 @netweb
4 years ago

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