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:
parent
98c71e17e2
commit
ff957050ce
|
@ -69,6 +69,10 @@ function wp_insert_site( array $data ) {
|
||||||
|
|
||||||
$new_site = get_site( $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 );
|
clean_blog_cache( $new_site );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue