mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Check the option cache before querying. Props westi. fixes #1499
git-svn-id: https://develop.svn.wordpress.org/trunk@2856 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -368,7 +368,12 @@ function update_user_option( $user_id, $option_name, $newvalue, $global = false
|
||||
|
||||
// thx Alex Stapleton, http://alex.vort-x.net/blog/
|
||||
function add_option($name, $value = '', $description = '', $autoload = 'yes') {
|
||||
global $wpdb;
|
||||
global $wpdb, $cache_settings;
|
||||
|
||||
// Make sure the option doesn't already exist
|
||||
if ( isset($cache_settings->$name) )
|
||||
return;
|
||||
|
||||
$original = $value;
|
||||
if ( is_array($value) || is_object($value) )
|
||||
$value = serialize($value);
|
||||
|
||||
Reference in New Issue
Block a user