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:
parent
61ce0809a7
commit
3301510db8
|
@ -203,6 +203,11 @@ function is_serialized_string($data) {
|
||||||
function get_option($setting) {
|
function get_option($setting) {
|
||||||
global $wpdb;
|
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');
|
$value = wp_cache_get($setting, 'options');
|
||||||
|
|
||||||
if ( false === $value ) {
|
if ( false === $value ) {
|
||||||
|
|
Loading…
Reference in New Issue