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
This commit is contained in:
Ryan Boren 2007-01-30 18:34:18 +00:00
parent 61ce0809a7
commit 3301510db8
1 changed files with 5 additions and 0 deletions

View File

@ -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 ) {