wp_maybe_clean_new_site_cache_on_update

函数
wp_maybe_clean_new_site_cache_on_update ( $new_site, $old_site )
参数
  • (WP_Site) $new_site The site object after the update.
    Required:
  • (WP_Site) $old_site The site object prior to the update.
    Required:
定义位置
相关方法
wp_maybe_update_network_site_counts_on_updatewp_maybe_transition_site_statuses_on_updatewp_maybe_update_network_site_countswp_maybe_auto_updatewp_maybe_grant_site_health_caps
引入
5.1.0
弃用
-

wp_maybe_clean_new_site_cache_on_update:这是一个函数,用于在网站更新时清除网站的缓存: 这个函数用于确保网站显示的是最新版本的内容。

在特定的网站数据被更新后,清理必要的缓存。

function wp_maybe_clean_new_site_cache_on_update( $new_site, $old_site ) {
	if ( $old_site->domain !== $new_site->domain || $old_site->path !== $new_site->path ) {
		clean_blog_cache( $new_site );
	}
}

常见问题

FAQs
查看更多 >
闪电侠

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

2025-12-14 09:36:28

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

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

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