update_option_* actions. fixes #2332

git-svn-id: https://develop.svn.wordpress.org/trunk@3485 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-01-25 06:46:21 +00:00
parent c89ddb677f
commit 97c6c5ee4f
1 changed files with 5 additions and 1 deletions

View File

@ -372,8 +372,12 @@ function update_option($option_name, $newvalue) {
$newvalue = $wpdb->escape($newvalue);
$option_name = $wpdb->escape($option_name);
$wpdb->query("UPDATE $wpdb->options SET option_value = '$newvalue' WHERE option_name = '$option_name'");
if ( $wpdb->rows_affected == 1 ) {
do_action('update_option_{$option_name}', $oldvalue, $newvalue);
return true;
}
return false;
}
function update_user_option( $user_id, $option_name, $newvalue, $global = false ) {
global $wpdb;