Skip to content

Commit 073eb70

Browse files
up1512001Copilot
andcommitted
address copilot feedbacks
Co-authored-by: Utsav Patel <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent ab37226 commit 073eb70

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

inc/classes/rest/class-multisite.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,16 @@ public function add_multisite_sites( \WP_REST_Request $request ): WP_REST_Respon
226226
);
227227
}
228228

229-
$governing_site_url = get_blog_details( $governing_site_id )->siteurl;
229+
// get governing site details.
230+
$governing_site_details = get_blog_details( $governing_site_id );
231+
if ( ! $governing_site_details || empty( $governing_site_details->siteurl ) ) {
232+
return new WP_Error(
233+
'invalid_governing_site',
234+
__( 'The governing site could not be found.', 'onedesign' ),
235+
array( 'status' => 400 )
236+
);
237+
}
238+
$governing_site_url = $governing_site_details->siteurl;
230239

231240
$shared_sites = get_option( Constants::ONEDESIGN_SHARED_SITES, array() );
232241

languages/onedesign.pot

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ msgstr ""
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=UTF-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"POT-Creation-Date: 2025-10-27T08:54:36+00:00\n"
12+
"POT-Creation-Date: 2025-10-28T05:27:21+00:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1414
"X-Generator: WP-CLI 2.12.0\n"
1515

@@ -280,7 +280,11 @@ msgstr ""
280280
msgid "No governing site set. Please set a governing site first."
281281
msgstr ""
282282

283-
#: inc/classes/rest/class-multisite.php:261
283+
#: inc/classes/rest/class-multisite.php:234
284+
msgid "The governing site could not be found."
285+
msgstr ""
286+
287+
#: inc/classes/rest/class-multisite.php:270
284288
msgid "Failed to switch to governing site blog."
285289
msgstr ""
286290

0 commit comments

Comments
 (0)