pre_update_option_* filter from DD32. fixes #7233

git-svn-id: https://develop.svn.wordpress.org/trunk@8247 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-07-03 15:51:53 +00:00
parent e1d642299e
commit 64f744edc9
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;