Get Post IDs using array_column()

We often have to do queries for post IDs which we then use for a later query. However, I don’t think WordPress has a way to return just the result set we want which is a one dimensional array of post_ids. Instead it returns an array of objects (or arrays) with a post_id property. One way to get those post_ids into their own one dimensional array is to loop through your results and pick them out one by one…boring.

If you run into a similar problem try using array_columns to automagically pull a one dimensional array of post_ids out of a two dimensional array.