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:
parent
b4671adb74
commit
771e8bdb8d
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in New Issue