File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -449,7 +449,7 @@ public function create( $args, $assoc_args ) {
449449 $ base = null ;
450450
451451 if ( $ has_site_url ) {
452- $ parsed_url = parse_url ( $ assoc_args ['site-url ' ] );
452+ $ parsed_url = wp_parse_url ( $ assoc_args ['site-url ' ] );
453453 if ( ! isset ( $ parsed_url ['host ' ] ) ) {
454454 WP_CLI ::error ( 'Invalid URL format. Please provide a valid URL (e.g., http://site.example.com). ' );
455455 }
@@ -545,16 +545,14 @@ public function create( $args, $assoc_args ) {
545545 $ newdomain = $ base . '. ' . preg_replace ( '|^www\.| ' , '' , $ current_site ->domain );
546546 $ path = $ current_site ->path ;
547547 }
548+ } elseif ( null !== $ custom_domain ) {
549+ // Use custom domain and path if provided via --site-url
550+ $ newdomain = $ custom_domain ;
551+ $ path = $ custom_path ;
548552 } else {
549- if ( null !== $ custom_domain ) {
550- // Use custom domain and path if provided via --site-url
551- $ newdomain = $ custom_domain ;
552- $ path = $ custom_path ;
553- } else {
554- // Use default behavior
555- $ newdomain = $ current_site ->domain ;
556- $ path = $ current_site ->path . $ base . '/ ' ;
557- }
553+ // Use default behavior
554+ $ newdomain = $ current_site ->domain ;
555+ $ path = $ current_site ->path . $ base . '/ ' ;
558556 }
559557
560558 $ user_id = email_exists ( $ email );
You can’t perform that action at this time.
0 commit comments