Skip to content

Commit 1548051

Browse files
authored
Add optional 'author' field to wp plugin list (#369)
* Add `author` as an optional field to `plugin list` * Add test for author field * Update test
1 parent 6a68d24 commit 1548051

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

features/plugin.feature

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,12 @@ Feature: Manage WordPress plugins
311311
| name | status | file |
312312
| akismet | active | akismet/akismet.php |
313313

314+
When I run `wp plugin list --status=active --field=author`
315+
Then STDOUT should contain:
316+
"""
317+
Automattic
318+
"""
319+
314320
Scenario: List plugin by multiple statuses
315321
Given a WP multisite install
316322
And a wp-content/plugins/network-only.php file:

src/Plugin_Command.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ protected function get_all_items() {
274274
'update_id' => '',
275275
'file' => $name,
276276
'auto_update' => false,
277+
'author' => $item_data['Author'],
277278
];
278279
}
279280

@@ -720,6 +721,7 @@ protected function get_item_list() {
720721
'description' => wordwrap( $details['Description'] ),
721722
'file' => $file,
722723
'auto_update' => in_array( $file, $auto_updates, true ),
724+
'author' => $details['Author'],
723725
];
724726

725727
if ( null === $update_info ) {
@@ -1184,6 +1186,7 @@ public function delete( $args, $assoc_args = array() ) {
11841186
* * description
11851187
* * file
11861188
* * auto_update
1189+
* * author
11871190
*
11881191
* ## EXAMPLES
11891192
*

0 commit comments

Comments
 (0)