Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion features/user.feature
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,6 @@ Feature: Manage WordPress users
And STDERR should be:
"""
Warning: Invalid user ID, email or login: '9999'
Warning: User 9999 doesn't exist.
Error: Only spammed 1 of 2 users.
"""
And the return code should be 1
Expand Down
11 changes: 2 additions & 9 deletions src/User_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -1339,15 +1339,8 @@ private function update_msuser_status( $user_ids, $pref, $value ) {
$errors = count( $user_ids ) - count( $users );
}

foreach ( $user_ids as $user_id ) {

$user = get_userdata( $user_id );

// If no user found, then show warning.
if ( empty( $user ) ) {
WP_CLI::warning( "User {$user_id} doesn't exist." );
continue;
}
foreach ( $users as $user ) {
$user_id = $user->ID;

// Super admin should not be marked as spam.
if ( is_super_admin( $user->ID ) ) {
Expand Down