Skip to content

Commit

Permalink
Add wp check for wp specific args
Browse files Browse the repository at this point in the history
Signed-off-by: Riddhesh Sanghvi <[email protected]>
  • Loading branch information
mrrobot47 committed Sep 6, 2018
1 parent bf3fe91 commit 18a2f42
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/Site_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ] );
}
}
}

Expand Down

0 comments on commit 18a2f42

Please sign in to comment.