diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-07-11 11:41:54 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-07-11 11:41:54 +0000 |
commit | c64595d6c415ca98ec929a2d88a9e0a5e7b676d6 (patch) | |
tree | ca1e5bad1c952471d3c026584d73d1ef7ed37380 | |
parent | 084a14bf0ecf658888a5bb73d859efce34e06c82 (diff) | |
download | wordpress-mu-c64595d6c415ca98ec929a2d88a9e0a5e7b676d6.tar.gz wordpress-mu-c64595d6c415ca98ec929a2d88a9e0a5e7b676d6.tar.xz wordpress-mu-c64595d6c415ca98ec929a2d88a9e0a5e7b676d6.zip |
Added "pre_site_option_*" and "site_option_*" filter
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1368 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r-- | wp-includes/wpmu-functions.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php index 29cd47a..11776b4 100644 --- a/wp-includes/wpmu-functions.php +++ b/wp-includes/wpmu-functions.php @@ -178,6 +178,11 @@ function is_site_admin( $user_login = false ) { function get_site_option( $key, $default = false, $use_cache = true ) { global $wpdb; + // Allow plugins to short-circuit site options. + $pre = apply_filters( 'pre_site_option_' . $key, false ); + if ( false !== $pre ) + return $pre; + $safe_key = $wpdb->escape( $key ); if( $use_cache == true ) { @@ -199,12 +204,10 @@ function get_site_option( $key, $default = false, $use_cache = true ) { } } - $value = stripslashes( $value ); - @ $kellogs = unserialize($value); - if ( $kellogs !== FALSE ) - return $kellogs; - else - return $value; + if (! unserialize($value) ) + $value = stripslashes( $value ); + + return apply_filters( 'site_option_' . $key, maybe_unserialize( $value ) ); } // expects $key, $value not to be SQL escaped |