Make WordPress Core

Ticket #2553: option-action.diff

File option-action.diff, 756 bytes (added by skeltoac, 18 years ago)
  • wp-includes/functions.php

     
    365365                return true;
    366366        }
    367367
     368        $_newvalue = $newvalue;
    368369        if ( is_array($newvalue) || is_object($newvalue) )
    369370                $newvalue = serialize($newvalue);
    370371
     
    374375        $option_name = $wpdb->escape($option_name);
    375376        $wpdb->query("UPDATE $wpdb->options SET option_value = '$newvalue' WHERE option_name = '$option_name'");
    376377        if ( $wpdb->rows_affected == 1 ) {
    377                 do_action("update_option_{$option_name}", $oldvalue, $newvalue);
     378                do_action("update_option_{$option_name}", array('old'=>$oldvalue, 'new'=>$_newvalue));
    378379                return true;
    379380        }
    380381        return false;