From f87324b2593d16df18d8fb4300690d91af3d168c Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 25 Jan 2006 06:46:21 +0000 Subject: [PATCH] update_option_* actions. fixes #2332 git-svn-id: http://svn.automattic.com/wordpress/trunk@3485 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 2fdf75bc02..567f6c8e2c 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -372,7 +372,11 @@ 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'"); - return true; + 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 ) {