mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
Have add_option() for options whose non-existence has been cached clear that cached non-existence before adding the option. Nice catch by Westi. fixes #3692
git-svn-id: http://svn.automattic.com/wordpress/trunk@4820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bc7b2b7606
commit
7873820f8c
@ -301,9 +301,12 @@ function update_option($option_name, $newvalue) {
|
|||||||
function add_option($name, $value = '', $description = '', $autoload = 'yes') {
|
function add_option($name, $value = '', $description = '', $autoload = 'yes') {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
// Make sure the option doesn't already exist
|
// Make sure the option doesn't already exist we can check the cache before we ask for a db query
|
||||||
if ( false !== get_option($name) )
|
if ( true === wp_cache_get($name, 'notoptions') )
|
||||||
return;
|
wp_cache_delete($name, 'notoptions');
|
||||||
|
else
|
||||||
|
if ( false !== get_option($name) )
|
||||||
|
return;
|
||||||
|
|
||||||
$value = maybe_serialize($value);
|
$value = maybe_serialize($value);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user