I am trying to select all the posts from certain post type and term in custom taxonomy, but what ever I try gets me just the list of all the posts in certain post type
wp post list --post_type=custom-type --fields=post_name,ID
This returns all posts in cpt custom-type
, but say I want to list only posts in term that has id 49, I tried
wp post list --post_type=custom-type --taxonomy=custom-tax --terms=49 --fields=post_name,ID
But again I got everything. In the documentation it says that the arguments are passed to WP_Query, but how do I do a tax_query
?
EDIT:
Ok so wp term list custom-tax
will return the correct list of terms in the taxonomy. So I need to see how to use this to my advantage…