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.

 

Scrape Facebook Open Graph Data

Just found a really neat resource for scraping the open graph data from a url.

100% Credit to Toni Michel Caubet. Stack Overflow Answer.

Auto Populate ACF Select and Checkboxes

Sometimes I need an ACF Select or Checkbox field to be populated dynamically. Sometimes I need to populate it with some Custom Post Types or perhaps another ACF repeater field.

Here is the code I found for this.

You could also do the same thing but with custom post types like this:

 

Get Vimeo Thumbnail

DEPRICATED

Ruthlessly stolen from Stackoverflow