@@ -961,14 +961,19 @@ private function get_network( $network_id ) {
961961 *
962962 * [--<field>=<value>]
963963 * : Filter by one or more fields (see "Available Fields" section). However,
964- * 'url' isn't an available filter, as it comes from 'home' in wp_options.
964+ * 'url' isn't an available filter, as it comes from 'home' in wp_options,
965+ * and 'path' isn't an available filter, as it conflicts with the global
966+ * `--path` parameter. Use `--site-path` to filter by path instead.
965967 *
966968 * [--site__in=<value>]
967969 * : Only list the sites with these blog_id values (comma-separated).
968970 *
969971 * [--site_user=<value>]
970972 * : Only list the sites with this user.
971973 *
974+ * [--site-path=<path>]
975+ * : Filter by path. Avoids conflict with the global `--path` parameter.
976+ *
972977 * [--field=<field>]
973978 * : Prints the value of a single field for each site.
974979 *
@@ -1038,13 +1043,17 @@ public function list_( $args, $assoc_args ) {
10381043 $ where = [];
10391044 $ append = '' ;
10401045
1041- $ site_cols = [ 'blog_id ' , 'last_updated ' , 'registered ' , 'site_id ' , 'domain ' , 'path ' , ' public ' , 'archived ' , 'mature ' , 'spam ' , 'deleted ' , 'lang_id ' ];
1046+ $ site_cols = [ 'blog_id ' , 'last_updated ' , 'registered ' , 'site_id ' , 'domain ' , 'public ' , 'archived ' , 'mature ' , 'spam ' , 'deleted ' , 'lang_id ' ];
10421047 foreach ( $ site_cols as $ col ) {
10431048 if ( isset ( $ assoc_args [ $ col ] ) ) {
10441049 $ where [ $ col ] = $ assoc_args [ $ col ];
10451050 }
10461051 }
10471052
1053+ if ( isset ( $ assoc_args ['site-path ' ] ) ) {
1054+ $ where ['path ' ] = $ assoc_args ['site-path ' ];
1055+ }
1056+
10481057 if ( isset ( $ assoc_args ['site__in ' ] ) ) {
10491058 $ where ['blog_id ' ] = explode ( ', ' , $ assoc_args ['site__in ' ] );
10501059 $ append = 'ORDER BY FIELD( blog_id, ' . implode ( ', ' , array_map ( 'intval ' , $ where ['blog_id ' ] ) ) . ' ) ' ;
0 commit comments