mirror of
https://ghproxy.net/https://github.com/wp-cli/extension-command.git
synced 2025-10-04 19:59:13 +08:00
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
This commit is contained in:
parent
6a68d24796
commit
1548051ca7
2 changed files with 9 additions and 0 deletions
|
@ -311,6 +311,12 @@ Feature: Manage WordPress plugins
|
|||
| name | status | file |
|
||||
| akismet | active | akismet/akismet.php |
|
||||
|
||||
When I run `wp plugin list --status=active --field=author`
|
||||
Then STDOUT should contain:
|
||||
"""
|
||||
Automattic
|
||||
"""
|
||||
|
||||
Scenario: List plugin by multiple statuses
|
||||
Given a WP multisite install
|
||||
And a wp-content/plugins/network-only.php file:
|
||||
|
|
|
@ -274,6 +274,7 @@ class Plugin_Command extends \WP_CLI\CommandWithUpgrade {
|
|||
'update_id' => '',
|
||||
'file' => $name,
|
||||
'auto_update' => false,
|
||||
'author' => $item_data['Author'],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -720,6 +721,7 @@ class Plugin_Command extends \WP_CLI\CommandWithUpgrade {
|
|||
'description' => wordwrap( $details['Description'] ),
|
||||
'file' => $file,
|
||||
'auto_update' => in_array( $file, $auto_updates, true ),
|
||||
'author' => $details['Author'],
|
||||
];
|
||||
|
||||
if ( null === $update_info ) {
|
||||
|
@ -1184,6 +1186,7 @@ class Plugin_Command extends \WP_CLI\CommandWithUpgrade {
|
|||
* * description
|
||||
* * file
|
||||
* * auto_update
|
||||
* * author
|
||||
*
|
||||
* ## EXAMPLES
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue