mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
cleanup [4382] a bit
git-svn-id: https://develop.svn.wordpress.org/trunk@4383 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -257,7 +257,7 @@ function update_option($option_name, $newvalue) {
|
||||
}
|
||||
|
||||
$_newvalue = $newvalue;
|
||||
$newvalue = prepare_data($newvalue);
|
||||
$newvalue = maybe_serialize($newvalue);
|
||||
|
||||
wp_cache_set($option_name, $newvalue, 'options');
|
||||
|
||||
@@ -279,7 +279,7 @@ function add_option($name, $value = '', $description = '', $autoload = 'yes') {
|
||||
if ( false !== get_option($name) )
|
||||
return;
|
||||
|
||||
$value = prepare_data($value);
|
||||
$value = maybe_serialize($value);
|
||||
|
||||
wp_cache_set($name, $value, 'options');
|
||||
|
||||
@@ -301,7 +301,7 @@ function delete_option($name) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function prepare_data($data) {
|
||||
function maybe_serialize($data) {
|
||||
if ( is_string($data) )
|
||||
$data = trim($data);
|
||||
elseif ( is_array($data) || is_object($data) )
|
||||
|
||||
Reference in New Issue
Block a user