wp_maybe_clean_new_site_cache_on_update() WordPress Function

The wp_maybe_clean_new_site_cache_on_update() function is used to clean the cache for new sites when an update is made. This is helpful for keeping the cache fresh and up-to-date.

wp_maybe_clean_new_site_cache_on_update( WP_Site $new_site, WP_Site $old_site ) #

Cleans the necessary caches after specific site data has been updated.


Parameters

$new_site

(WP_Site)(Required)The site object after the update.

$old_site

(WP_Site)(Required)The site obejct prior to the update.


Top ↑

Source

File: wp-includes/ms-site.php

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 );
	}
}


Top ↑

Changelog

Changelog
VersionDescription
5.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.