diff --git a/README.md b/README.md index 0498bda27..d52b3b5c1 100644 --- a/README.md +++ b/README.md @@ -341,6 +341,32 @@ These fields are optionally available: | 29 | 2013-03-14 11:56:08 | Jane Doe | +------------+---------------------+----------------+ + # List unapproved comments. + $ wp comment list --number=3 --status=hold --fields=ID,comment_date,comment_author + +------------+---------------------+----------------+ + | comment_ID | comment_date | comment_author | + +------------+---------------------+----------------+ + | 8 | 2023-11-10 13:13:06 | John Doe | + | 7 | 2023-11-10 13:09:55 | Mr WordPress | + | 9 | 2023-11-10 11:22:31 | Jane Doe | + +------------+---------------------+----------------+ + + # List comments marked as spam. + $ wp comment list --status=spam --fields=ID,comment_date,comment_author + +------------+---------------------+----------------+ + | comment_ID | comment_date | comment_author | + +------------+---------------------+----------------+ + | 2 | 2023-11-10 11:22:31 | Jane Doe | + +------------+---------------------+----------------+ + + # List comments in trash. + $ wp comment list --status=trash --fields=ID,comment_date,comment_author + +------------+---------------------+----------------+ + | comment_ID | comment_date | comment_author | + +------------+---------------------+----------------+ + | 3 | 2023-11-10 11:22:31 | John Doe | + +------------+---------------------+----------------+ + ### wp comment meta diff --git a/src/Comment_Command.php b/src/Comment_Command.php index 99f43fdf5..cfe2b1a19 100644 --- a/src/Comment_Command.php +++ b/src/Comment_Command.php @@ -335,6 +335,32 @@ public function get( $args, $assoc_args ) { * | 29 | 2013-03-14 11:56:08 | Jane Doe | * +------------+---------------------+----------------+ * + * # List unapproved comments. + * $ wp comment list --number=3 --status=hold --fields=ID,comment_date,comment_author + * +------------+---------------------+----------------+ + * | comment_ID | comment_date | comment_author | + * +------------+---------------------+----------------+ + * | 8 | 2023-11-10 13:13:06 | John Doe | + * | 7 | 2023-11-10 13:09:55 | Mr WordPress | + * | 9 | 2023-11-10 11:22:31 | Jane Doe | + * +------------+---------------------+----------------+ + * + * # List comments marked as spam. + * $ wp comment list --status=spam --fields=ID,comment_date,comment_author + * +------------+---------------------+----------------+ + * | comment_ID | comment_date | comment_author | + * +------------+---------------------+----------------+ + * | 2 | 2023-11-10 11:22:31 | Jane Doe | + * +------------+---------------------+----------------+ + * + * # List comments in trash. + * $ wp comment list --status=trash --fields=ID,comment_date,comment_author + * +------------+---------------------+----------------+ + * | comment_ID | comment_date | comment_author | + * +------------+---------------------+----------------+ + * | 3 | 2023-11-10 11:22:31 | John Doe | + * +------------+---------------------+----------------+ + * * @subcommand list */ public function list_( $args, $assoc_args ) {