From 03932fa14ffb761d0ce10a40c39ae4c58db49190 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 3 Jul 2008 15:51:53 +0000 Subject: [PATCH] pre_update_option_* filter from DD32. fixes #7233 git-svn-id: http://svn.automattic.com/wordpress/trunk@8247 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index f7884b335..3fe0f7c19 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -490,8 +490,11 @@ function update_option( $option_name, $newvalue ) { $safe_option_name = $wpdb->escape( $option_name ); $newvalue = sanitize_option( $option_name, $newvalue ); - // If the new and old values are the same, no need to update. $oldvalue = get_option( $safe_option_name ); + + $newvalue = apply_filters( 'pre_update_option_' . $option_name, $newvalue, $oldvalue ); + + // If the new and old values are the same, no need to update. if ( $newvalue === $oldvalue ) return false;