From 18a2f421a2beedcfbb2efe28cd0a15e125fecc44 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Thu, 6 Sep 2018 13:12:17 +0530 Subject: [PATCH] Add wp check for wp specific args Signed-off-by: Riddhesh Sanghvi --- src/Site_Command.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/Site_Command.php b/src/Site_Command.php index 84d1af8f..14ed148a 100644 --- a/src/Site_Command.php +++ b/src/Site_Command.php @@ -165,17 +165,20 @@ private function convert_old_args_to_new_args( $args, $assoc_args ) { } } - // ee3 backward compatibility flags - $wp_compat_array_map = [ - 'user' => 'admin-user', - 'pass' => 'admin-pass', - 'email' => 'admin-email', - ]; - - foreach ( $wp_compat_array_map as $from => $to ) { - if ( isset( $assoc_args[ $from ] ) ) { - $assoc_args[ $to ] = $assoc_args[ $from ]; - unset( $assoc_args[ $from ] ); + if ( ! empty( $assoc_args['type'] ) && 'wp' === $assoc_args['type'] ) { + + // ee3 backward compatibility flags + $wp_compat_array_map = [ + 'user' => 'admin-user', + 'pass' => 'admin-pass', + 'email' => 'admin-email', + ]; + + foreach ( $wp_compat_array_map as $from => $to ) { + if ( isset( $assoc_args[ $from ] ) ) { + $assoc_args[ $to ] = $assoc_args[ $from ]; + unset( $assoc_args[ $from ] ); + } } }