Networks and Sites: Check the result of get_site()
in wp_insert_site()
.
Props davidbinda, vanyukov, lukecarbis. Merges [44799] to the 5.1 branch. Fixes #46300. git-svn-id: https://develop.svn.wordpress.org/branches/5.1@44800 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0b63929b95
commit
b57deec916
@ -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 );
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user