Skip to content

Commit 0cd4840

Browse files
Add examples on listing unapproved, spam and trash comments (#436)
* Add examples on listing unapproved, spam and trash comments * Update README too --------- Co-authored-by: Daniel Bachhuber <[email protected]>
1 parent cb7fe53 commit 0cd4840

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,32 @@ These fields are optionally available:
341341
| 29 | 2013-03-14 11:56:08 | Jane Doe |
342342
+------------+---------------------+----------------+
343343

344+
# List unapproved comments.
345+
$ wp comment list --number=3 --status=hold --fields=ID,comment_date,comment_author
346+
+------------+---------------------+----------------+
347+
| comment_ID | comment_date | comment_author |
348+
+------------+---------------------+----------------+
349+
| 8 | 2023-11-10 13:13:06 | John Doe |
350+
| 7 | 2023-11-10 13:09:55 | Mr WordPress |
351+
| 9 | 2023-11-10 11:22:31 | Jane Doe |
352+
+------------+---------------------+----------------+
353+
354+
# List comments marked as spam.
355+
$ wp comment list --status=spam --fields=ID,comment_date,comment_author
356+
+------------+---------------------+----------------+
357+
| comment_ID | comment_date | comment_author |
358+
+------------+---------------------+----------------+
359+
| 2 | 2023-11-10 11:22:31 | Jane Doe |
360+
+------------+---------------------+----------------+
361+
362+
# List comments in trash.
363+
$ wp comment list --status=trash --fields=ID,comment_date,comment_author
364+
+------------+---------------------+----------------+
365+
| comment_ID | comment_date | comment_author |
366+
+------------+---------------------+----------------+
367+
| 3 | 2023-11-10 11:22:31 | John Doe |
368+
+------------+---------------------+----------------+
369+
344370

345371

346372
### wp comment meta

src/Comment_Command.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,32 @@ public function get( $args, $assoc_args ) {
335335
* | 29 | 2013-03-14 11:56:08 | Jane Doe |
336336
* +------------+---------------------+----------------+
337337
*
338+
* # List unapproved comments.
339+
* $ wp comment list --number=3 --status=hold --fields=ID,comment_date,comment_author
340+
* +------------+---------------------+----------------+
341+
* | comment_ID | comment_date | comment_author |
342+
* +------------+---------------------+----------------+
343+
* | 8 | 2023-11-10 13:13:06 | John Doe |
344+
* | 7 | 2023-11-10 13:09:55 | Mr WordPress |
345+
* | 9 | 2023-11-10 11:22:31 | Jane Doe |
346+
* +------------+---------------------+----------------+
347+
*
348+
* # List comments marked as spam.
349+
* $ wp comment list --status=spam --fields=ID,comment_date,comment_author
350+
* +------------+---------------------+----------------+
351+
* | comment_ID | comment_date | comment_author |
352+
* +------------+---------------------+----------------+
353+
* | 2 | 2023-11-10 11:22:31 | Jane Doe |
354+
* +------------+---------------------+----------------+
355+
*
356+
* # List comments in trash.
357+
* $ wp comment list --status=trash --fields=ID,comment_date,comment_author
358+
* +------------+---------------------+----------------+
359+
* | comment_ID | comment_date | comment_author |
360+
* +------------+---------------------+----------------+
361+
* | 3 | 2023-11-10 11:22:31 | John Doe |
362+
* +------------+---------------------+----------------+
363+
*
338364
* @subcommand list
339365
*/
340366
public function list_( $args, $assoc_args ) {

0 commit comments

Comments
 (0)