From 399c8828e95c127a07d22218a6f69ee021b2220d Mon Sep 17 00:00:00 2001 From: marksabbath Date: Mon, 13 Nov 2023 13:14:02 -0300 Subject: [PATCH] Change filter to user__in --- features/site.feature | 4 ++-- src/Site_Command.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/features/site.feature b/features/site.feature index 02097bd1..1cfdfeef 100644 --- a/features/site.feature +++ b/features/site.feature @@ -112,13 +112,13 @@ Feature: Manage sites in a multisite installation And I run `wp user get {USER_ID} --field=user_login` And save STDOUT as {USER_LOGIN} - When I run `wp site list --field=url --site__user_in={USER_LOGIN}` + When I run `wp site list --field=url --user__in={USER_LOGIN}` Then STDOUT should be: """ {SITE_URL} """ - When I try `wp site list --site__user_in=invalid_user` + When I try `wp site list --user__in=invalid_user` Then the return code should be 1 And STDERR should be: """ diff --git a/src/Site_Command.php b/src/Site_Command.php index c0405483..3cb60b1c 100644 --- a/src/Site_Command.php +++ b/src/Site_Command.php @@ -522,7 +522,7 @@ private function get_network( $network_id ) { * [--site__in=] * : Only list the sites with these blog_id values (comma-separated). * - * [--site__user_in=] + * [--user__in=] * : Only list the sites with this user. * * [--field=] @@ -610,8 +610,8 @@ public function list_( $args, $assoc_args ) { $where['site_id'] = $assoc_args['network']; } - if ( isset( $assoc_args['site__user_in'] ) ) { - $user = get_user_by( 'login', $assoc_args['site__user_in'] ); + if ( isset( $assoc_args['user__in'] ) ) { + $user = get_user_by( 'login', $assoc_args['user__in'] ); if ( $user ) { $blogs = get_blogs_of_user( $user->id );