Skip to content

Commit 924e124

Browse files
committed
feat(admin): pre-select the only source blog when exactly one exists
If the current blog has just one MSLS-active sibling, the 'pick a source' step adds no value — the list is already unambiguous. Treats that single source as selected when the URL has no msls_source set, so the user lands directly on the list of untranslated posts. The source flag for that blog still renders in the active state, so the UI truthfully reflects which blog is driving the list.
1 parent f1fd0e6 commit 924e124

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

includes/MslsTranslationPickerPage.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@ public static function render(): void {
224224
}
225225
}
226226

227+
// With only one source available, treat it as pre-selected so the
228+
// user lands straight on the list instead of a picker-of-one.
229+
if ( 0 === $source && 1 === count( $blogs ) ) {
230+
$source = (int) $blogs[0]->userblog_id;
231+
}
232+
227233
self::enqueue( (int) get_current_blog_id() );
228234

229235
echo '<div class="wrap msls-tp-page">';

0 commit comments

Comments
 (0)