update_option() action fix. fixes #2553
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@3744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b0e9d668cc
commit
1c4d1096df
|
@ -364,6 +364,7 @@ function update_option($option_name, $newvalue) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$_newvalue = $newvalue;
|
||||||
if ( is_array($newvalue) || is_object($newvalue) )
|
if ( is_array($newvalue) || is_object($newvalue) )
|
||||||
$newvalue = serialize($newvalue);
|
$newvalue = serialize($newvalue);
|
||||||
|
|
||||||
|
@ -373,7 +374,7 @@ function update_option($option_name, $newvalue) {
|
||||||
$option_name = $wpdb->escape($option_name);
|
$option_name = $wpdb->escape($option_name);
|
||||||
$wpdb->query("UPDATE $wpdb->options SET option_value = '$newvalue' WHERE option_name = '$option_name'");
|
$wpdb->query("UPDATE $wpdb->options SET option_value = '$newvalue' WHERE option_name = '$option_name'");
|
||||||
if ( $wpdb->rows_affected == 1 ) {
|
if ( $wpdb->rows_affected == 1 ) {
|
||||||
do_action("update_option_{$option_name}", $oldvalue, $newvalue);
|
do_action("update_option_{$option_name}", array('old'=>$oldvalue, 'new'=>$_newvalue));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue