wp_using_ext_object_cache

函式
wp_using_ext_object_cache ( $using = null )
引數
  • (bool) $using Whether external object cache is being used.
    Required:
    Default: null
返回值
  • (bool) The current 'using' setting.
定義位置
相關方法
wp_start_object_cacheget_object_term_cachewp_set_object_termswp_get_object_termsupdate_object_term_cache
引入
3.7.0
棄用
-

wp_using_ext_object_cache: 這個函式用來檢查WordPress中是否正在使用外部物件快取。如果外部物件快取正在使用,它就返回真,否則就返回假。

切換`$_wp_using_ext_object_cache`的開與關,而不直接接觸全域性。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_using_ext_object_cache( $using = null ) {
global $_wp_using_ext_object_cache;
$current_using = $_wp_using_ext_object_cache;
if ( null !== $using ) {
$_wp_using_ext_object_cache = $using;
}
return $current_using;
}
function wp_using_ext_object_cache( $using = null ) { global $_wp_using_ext_object_cache; $current_using = $_wp_using_ext_object_cache; if ( null !== $using ) { $_wp_using_ext_object_cache = $using; } return $current_using; }
function wp_using_ext_object_cache( $using = null ) {
	global $_wp_using_ext_object_cache;
	$current_using = $_wp_using_ext_object_cache;
	if ( null !== $using ) {
		$_wp_using_ext_object_cache = $using;
	}
	return $current_using;
}

常見問題

FAQs
檢視更多 >