Get all posts by many custom post types

Question

Question:
I have many custom post types and i want to return all the posts by just a few of the post types:

For example i have an array and was wondering if there was a way of passing this array to something like the get_posts function and it returning all the post types specified in the array.

Example array:

post_types = [ 
event,
award,
upcoming 
]

The above array would be passed to said function and i would be returned all posts matching only those in the array,

0
, , Anon12 3 years 2020-04-06T16:52:25-05:00 0 Answers 93 views 0

Leave an answer

Browse
Browse