Skip to content

Add post count post-type list #4573

@Ipstenu

Description

@Ipstenu

I was messing around with wp post-type list and got to thinking it would be awesome if I could do wp post-type list --capability_type=post --fields=name,public,count which would spit out the posts with the counts for each value:

+----------------------+--------+--------+
| name                 | public | count  |
+----------------------+--------+--------+
| post                 | 1      | 156    |
| attachment           | 1      | 3201   |
| revision             |        | N/A    |
| nav_menu_item        |        | 20     |
| custom_css           |        | N/A    |
| oembed_cache         |        | N/A    |
| post_type_characters | 1      | 2201   |
| post_type_shows      | 1      | 750    |
| post_type_actors     | 1      | 2101   |
| jp_pay_order         |        | 120    |
| jp_pay_product       |        | 120    |
+----------------------+--------+--------+

(Numbers are made up)

I'm thinking that custom CSS and cache and revisions MAY not be ones we want to count. Especially if people have unfettered revisions 😬

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions