Networks and Sites: Check the result of `get_site()` in `wp_insert_site()`.

Props davidbinda, vanyukov, lukecarbis.
Fixes #46300.

git-svn-id: https://develop.svn.wordpress.org/trunk@44799 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2019-03-05 20:34:58 +00:00
parent 98c71e17e2
commit ff957050ce
1 changed files with 4 additions and 0 deletions

View File

@ -69,6 +69,10 @@ function wp_insert_site( array $data ) {
$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 );
/**