clean_network_cache

函数
clean_network_cache ( $ids )
参数
  • (int|array) $ids Network ID or an array of network IDs to remove from cache.
    Required:
定义位置
相关方法
clean_user_cacheclean_term_cacheclean_category_cacheupdate_network_cacheclean_bookmark_cache
引入
4.6.0
弃用
-

clean_network_cache: 这个函数清除了网络的缓存。在WordPress的多站点安装中,这个函数清除所有与网络有关的数据的缓存,包括站点数据、用户数据和网络设置。

从对象高速缓存中删除一个网络。

function clean_network_cache( $ids ) {
	global $_wp_suspend_cache_invalidation;

	if ( ! empty( $_wp_suspend_cache_invalidation ) ) {
		return;
	}

	$network_ids = (array) $ids;
	wp_cache_delete_multiple( $network_ids, 'networks' );

	foreach ( $network_ids as $id ) {
		/**
		 * Fires immediately after a network has been removed from the object cache.
		 *
		 * @since 4.6.0
		 *
		 * @param int $id Network ID.
		 */
		do_action( 'clean_network_cache', $id );
	}

	wp_cache_set( 'last_changed', microtime(), 'networks' );
}

常见问题

FAQs
查看更多 >
闪电侠

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

2026-01-29 09:09:35

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

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

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