summaryrefslogtreecommitdiffstats
path: root/wp-includes/wpmu-functions.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-11 11:41:54 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-11 11:41:54 +0000
commitc64595d6c415ca98ec929a2d88a9e0a5e7b676d6 (patch)
treeca1e5bad1c952471d3c026584d73d1ef7ed37380 /wp-includes/wpmu-functions.php
parent084a14bf0ecf658888a5bb73d859efce34e06c82 (diff)
downloadwordpress-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
Diffstat (limited to 'wp-includes/wpmu-functions.php')
-rw-r--r--wp-includes/wpmu-functions.php15
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