From 771e8bdb8db6d23bacbfb03844a4eee86a4dbf91 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 30 Jan 2007 18:34:18 +0000 Subject: [PATCH] Add pre_option_* filter that allows plugins to short-circuit fetches. git-svn-id: http://svn.automattic.com/wordpress/trunk@4842 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 077873b7b2..f030bb17e9 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -203,6 +203,11 @@ function is_serialized_string($data) { function get_option($setting) { global $wpdb; + // Allow plugins to short-circuit options. + $pre = apply_filters( 'pre_option_' . $setting, false ); + if ( $pre ) + return $pre; + $value = wp_cache_get($setting, 'options'); if ( false === $value ) {