From 3301510db8f4e643ced1ad0abacbb210f647be93 Mon Sep 17 00:00:00 2001 From: Ryan Boren 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: https://develop.svn.wordpress.org/trunk@4842 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 ) {