Return an array of Post IDs from a WordPress WP_Query
object - which can then be used to set up data from the _postmeta table.
By having the query only return IDs, it is quicker and more efficient - but I constantly forget how to set it up.
Note: There’s no loop to set up, you get the array from the object’s posts property: $query_object->posts
.
WP_Query
Resources