Skip to content

Commit 1308a7b

Browse files
committed
Add support for description.
1 parent 78e1db0 commit 1308a7b

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

features/plugin.feature

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,9 +683,15 @@ Feature: Manage WordPress plugins
683683
"""
684684
<?php
685685
// Plugin Name: Test mu-plugin
686+
// Description: Test mu-plugin description
686687
"""
687688

688689
When I run `wp plugin list --fields=name,title`
689690
Then STDOUT should be a table containing rows:
690691
| name | title |
691692
| test-mu | Test mu-plugin |
693+
694+
When I run `wp plugin list --fields=name,title,description`
695+
Then STDOUT should be a table containing rows:
696+
| name | title | description |
697+
| test | Test mu-plugin | Test mu-plugin description |

src/Plugin_Command.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ protected function get_all_items() {
239239
$mu_title = $mu_plugin['Title'];
240240
}
241241

242+
$mu_description = '';
243+
if ( ! empty( $mu_plugin['Description'] ) ) {
244+
$mu_description = $mu_plugin['Description'];
245+
}
246+
242247
$items[ $file ] = array(
243248
'name' => Utils\get_plugin_name( $file ),
244249
'status' => 'must-use',
@@ -248,7 +253,7 @@ protected function get_all_items() {
248253
'version' => $mu_version,
249254
'update_id' => '',
250255
'title' => $mu_title,
251-
'description' => '',
256+
'description' => $mu_description,
252257
'file' => $file,
253258
);
254259
}

0 commit comments

Comments
 (0)