mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Multisite: Improve performance by caching not found lookups for sites and networks.
With this change, the result of a site or network lookup by ID will be cached even if the ID does not exist. When a new site or network is created, the cache for the respective new ID is cleared. Props mnelson4, nielsdeblaauw. Fixes #42251. git-svn-id: https://develop.svn.wordpress.org/trunk@45910 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -69,14 +69,14 @@ function wp_insert_site( array $data ) {
|
||||
return new WP_Error( 'db_insert_error', __( 'Could not insert site into the database.' ), $wpdb->last_error );
|
||||
}
|
||||
|
||||
clean_blog_cache( $wpdb->insert_id );
|
||||
|
||||
$new_site = get_site( $wpdb->insert_id );
|
||||
|
||||
if ( ! $new_site ) {
|
||||
return new WP_Error( 'get_site_error', __( 'Could not retrieve site data.' ) );
|
||||
}
|
||||
|
||||
clean_blog_cache( $new_site );
|
||||
|
||||
/**
|
||||
* Fires once a site has been inserted into the database.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user