From 64f744edc99372ef440d8d5416eb48d439c10354 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 3 Jul 2008 15:51:53 +0000 Subject: [PATCH] pre_update_option_* filter from DD32. fixes #7233 git-svn-id: https://develop.svn.wordpress.org/trunk@8247 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 f7884b3351..3fe0f7c196 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;