From d134ede053b7c854edcbc5e49467528b23e62805 Mon Sep 17 00:00:00 2001 From: Ben Ritner Date: Wed, 11 Dec 2024 13:02:07 -0700 Subject: [PATCH] Account for an empty siteurl in the database --- src/Uplink/Site/Data.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Uplink/Site/Data.php b/src/Uplink/Site/Data.php index 0a02f68e..ca658c04 100644 --- a/src/Uplink/Site/Data.php +++ b/src/Uplink/Site/Data.php @@ -155,7 +155,10 @@ public function get_domain( bool $original = false ): string { protected function get_domain_multisite_option(): string { /** @var string */ $site_url = get_site_option( 'siteurl', '' ); - + // Fallback to get_site_url function if the network site url is empty which is possible. + if ( empty( $site_url ) ) { + $site_url = get_site_url(); + } /** @var array */ $site_url = wp_parse_url( $site_url ); if ( ! $site_url || ! isset( $site_url['host'] ) ) {