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
This commit is contained in:
ryan 2007-01-30 18:34:18 +00:00
parent b4671adb74
commit 771e8bdb8d
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 ) {