update_sitemeta_cache

函数
update_sitemeta_cache ( $site_ids )
参数
  • (array) $site_ids List of site IDs.
    Required:
返回值
  • (array|false) An array of metadata on success, false if there is nothing to update.
定义位置
相关方法
update_termmeta_cacheupdate_postmeta_cacheupdate_site_cacheupdate_meta_cacheupdate_term_cache
引入
5.1.0
弃用
-

update_sitemeta_cache: 这个函数更新一个站点的元数据的缓存。它通常在网站的元数据被更新后被调用,例如当一个插件设置被改变时。

更新站点ID列表的元数据缓存。

执行SQL查询,检索与`$site_ids`匹配的站点的所有元数据,并将它们存储在缓存中。随后调用`get_site_meta()`将不需要查询数据库。

function update_sitemeta_cache( $site_ids ) {
	// Ensure this filter is hooked in even if the function is called early.
	if ( ! has_filter( 'update_blog_metadata_cache', 'wp_check_site_meta_support_prefilter' ) ) {
		add_filter( 'update_blog_metadata_cache', 'wp_check_site_meta_support_prefilter' );
	}
	return update_meta_cache( 'blog', $site_ids );
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-14 11:36:30

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: