From 97c6c5ee4f94bc1f81de55fd7ca819f300f31a5c Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 25 Jan 2006 06:46:21 +0000 Subject: [PATCH] update_option_* actions. fixes #2332 git-svn-id: https://develop.svn.wordpress.org/trunk@3485 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 ) {