Make WordPress Core

Ticket #2332: update_option-action.diff

File update_option-action.diff, 652 bytes (added by skeltoac, 16 years ago)
  • wp-includes/functions.php

     
    372372        $newvalue = $wpdb->escape($newvalue);
    373373        $option_name = $wpdb->escape($option_name);
    374374        $wpdb->query("UPDATE $wpdb->options SET option_value = '$newvalue' WHERE option_name = '$option_name'");
    375         return true;
     375        if ( $wpdb->rows_affected == 1 ) {
     376                do_action('update_option_{$option_name}', $oldvalue, $newvalue);
     377                return true;
     378        }
     379        return false;
    376380}
    377381
    378382function update_user_option( $user_id, $option_name, $newvalue, $global = false ) {