Skip to content

Commit

Permalink
Merge pull request #140 from humanmade/check-installing-for-global-check
Browse files Browse the repository at this point in the history
Make is_global_site() safe to use during install
  • Loading branch information
roborourke authored Jun 16, 2021
2 parents fe1ad85 + 87d9e79 commit f1bb63c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inc/global_content/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ function get_site_url() : ?string {
* @return boolean
*/
function is_global_site( ?int $site_id = null ) : bool {
if ( defined( 'WP_INITIAL_INSTALL' ) && WP_INITIAL_INSTALL ) {
return false;
}

return ! empty( get_site_meta( $site_id ?? get_current_blog_id(), 'is_global_site' ) );
}

Expand Down

0 comments on commit f1bb63c

Please sign in to comment.