wp_cache_set_multiple

函式
wp_cache_set_multiple ( $data, $group = '', $expire = 0 )
引數
  • (array) $data Array of keys and values to be set.
    Required:
  • (string) $group Optional. Where the cache contents are grouped. Default empty.
    Required:
    Default: (empty)
  • (int) $expire Optional. When to expire the cache contents, in seconds. Default 0 (no expiration).
    Required:
返回值
  • (bool[]) Array of return values, grouped by key. Each value is either true on success, or false on failure.
相關
  • WP_Object_Cache::set_multiple()
定義位置
相關方法
wp_cache_get_multiplewp_cache_delete_multiplewp_cache_add_multiplewp_cache_setwp_cache_replace
引入
6.0.0
棄用
-

wp_cache_set_multiple函式用於一次在快取中設定多個值。它接收一個鍵/值對的關聯陣列,並將每個鍵/值對新增到快取中。

在一次呼叫中為快取設定多個值。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_cache_set_multiple( array $data, $group = '', $expire = 0 ) {
global $wp_object_cache;
return $wp_object_cache->set_multiple( $data, $group, $expire );
}
function wp_cache_set_multiple( array $data, $group = '', $expire = 0 ) { global $wp_object_cache; return $wp_object_cache->set_multiple( $data, $group, $expire ); }
function wp_cache_set_multiple( array $data, $group = '', $expire = 0 ) {
	global $wp_object_cache;

	return $wp_object_cache->set_multiple( $data, $group, $expire );
}

常見問題

FAQs
檢視更多 >