Skip to content

Commit 18a2f42

Browse files
committed
Add wp check for wp specific args
Signed-off-by: Riddhesh Sanghvi <[email protected]>
1 parent bf3fe91 commit 18a2f42

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/Site_Command.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -165,17 +165,20 @@ private function convert_old_args_to_new_args( $args, $assoc_args ) {
165165
}
166166
}
167167

168-
// ee3 backward compatibility flags
169-
$wp_compat_array_map = [
170-
'user' => 'admin-user',
171-
'pass' => 'admin-pass',
172-
'email' => 'admin-email',
173-
];
174-
175-
foreach ( $wp_compat_array_map as $from => $to ) {
176-
if ( isset( $assoc_args[ $from ] ) ) {
177-
$assoc_args[ $to ] = $assoc_args[ $from ];
178-
unset( $assoc_args[ $from ] );
168+
if ( ! empty( $assoc_args['type'] ) && 'wp' === $assoc_args['type'] ) {
169+
170+
// ee3 backward compatibility flags
171+
$wp_compat_array_map = [
172+
'user' => 'admin-user',
173+
'pass' => 'admin-pass',
174+
'email' => 'admin-email',
175+
];
176+
177+
foreach ( $wp_compat_array_map as $from => $to ) {
178+
if ( isset( $assoc_args[ $from ] ) ) {
179+
$assoc_args[ $to ] = $assoc_args[ $from ];
180+
unset( $assoc_args[ $from ] );
181+
}
179182
}
180183
}
181184

0 commit comments

Comments
 (0)