Networks and Sites: Check the result of get_site() in wp_insert_site().
Props davidbinda, vanyukov, lukecarbis. Fixes #46300. Built from https://develop.svn.wordpress.org/trunk@44799 git-svn-id: http://core.svn.wordpress.org/trunk@44631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -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 );
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user