File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -398,15 +398,16 @@ public function activation_redirect() {
398398 }
399399
400400 delete_option ( 'tpc_maybe_run_onboarding ' );
401- wp_safe_redirect (
402- add_query_arg (
403- array (
404- 'page ' => 'neve-onboarding ' ,
405- 'show ' => 'welcome ' ,
406- ),
407- admin_url ( 'admin.php ' )
408- )
409- );
401+
402+ $ query_args = array ( 'page ' => 'neve-onboarding ' );
403+
404+ if ( defined ( 'TI_ONBOARDING_DEFAULT_SITE ' ) && TI_ONBOARDING_DEFAULT_SITE ) {
405+ $ query_args ['site ' ] = sanitize_key ( TI_ONBOARDING_DEFAULT_SITE );
406+ } else {
407+ $ query_args ['show ' ] = 'welcome ' ;
408+ }
409+
410+ wp_safe_redirect ( add_query_arg ( $ query_args , admin_url ( 'admin.php ' ) ) );
410411 exit ();
411412 }
412413
Original file line number Diff line number Diff line change @@ -16,15 +16,32 @@ const initialLicense = licenseTIOB || {
1616 tier : 0 ,
1717} ;
1818
19+ const params = new URLSearchParams ( window . location . search ) ;
20+ const defaultSiteSlug = params . get ( 'site' ) ;
21+
22+ const findSiteBySlug = ( slug ) => {
23+ const builders = onboarding ?. sites ?. sites || { } ;
24+ for ( const builder of Object . keys ( builders ) ) {
25+ if ( builders [ builder ] ?. [ slug ] ) {
26+ return builders [ builder ] [ slug ] ;
27+ }
28+ }
29+ return null ;
30+ } ;
31+
32+ const defaultSite = defaultSiteSlug ? findSiteBySlug ( defaultSiteSlug ) : null ;
33+
1934const initialState = {
2035 sites : onboarding . sites || { } ,
2136 editor : selectedEditor ,
2237 category : '' ,
23- currentSite : null ,
38+ currentSite : defaultSite ,
2439 fetching : false ,
2540 searchQuery : '' ,
2641 license : initialLicense ,
27- onboardingStep : window . location . search . includes ( 'show=welcome' ) ? 1 : 2 ,
42+ onboardingStep : defaultSite
43+ ? 3
44+ : ( window . location . search . includes ( 'show=welcome' ) ? 1 : 2 ) ,
2845 userCustomSettings : {
2946 siteName : null ,
3047 siteLogo : null ,
You can’t perform that action at this time.
0 commit comments