Skip to content

user delete always returns Success message if multisite user exists #403

@MannyAdumbire

Description

@MannyAdumbire

Bug Report

I'm not certain this is a bug, but it is confusing behavior.

Trying to delete a user from a site on multisite network( without the --network flag ) seems to always result in success.
If a matching user is found on the multisite, the command always outputs - Success: Removed user ... from ....

To replicate:

wp user create rando rando@rando.com 
wp user delete rando --reassign=1 --yes
wp user delete rando --reassign=1 --yes

image

I suggest If the user exists on the network, but is not found on the blog where the deletion is being run, then that would be more useful to output. Something like:

Notice: The network user with [ email | user ID | login ]:[ user ] was not found on blog:[ blog/subsite ], no users deleted.

Running on:

OS:     Linux 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64
Shell:  /bin/bash
PHP binary:     /usr/local/bin/php
PHP version:    8.0.28
php.ini used:
MySQL binary:
MySQL version:
SQL modes:
WP-CLI root dir:        phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:      phar://wp-cli.phar/vendor
WP_CLI phar path:       /var/www/html
WP-CLI packages dir:
WP-CLI cache dir:       /home/wp_php/.wp-cli/cache
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.7.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions