pre_update_option_* filter from DD32. fixes #7233

git-svn-id: http://svn.automattic.com/wordpress/trunk@8247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-07-03 15:51:53 +00:00
parent 4cd88d665a
commit 03932fa14f
1 changed files with 4 additions and 1 deletions

View File

@ -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;