Using the Video Object Return Value

When you are adding your field in the groups section of the Advanced Custom fields area, you can select the type of return value to get. If you select the Video Object return value you will be able to access a nicely crafted object pulling in data from the YouTube API.


When available the video object pings the YouTube API to gather in specifics about your video. You can use this data to recreate a YouTube type experience on your WordPress site. We use the WordPress Transient API to cache your results for 8 hours (filter available).

The image below shows you the exact object properties that gets returned.


Code Examples

Displaying a title, description and the embed. Click image to view this snippet and copy the code.