Using the Video Return Object

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 Vimeo API.

return-vimeo-object

When available the video object pings the Vimeo API to gather in specifics about your video. You can use this data to recreate a Vimeo 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.

vimeo-return-object

Code example

Here is a simple example how to create a title, description and thumbnail.

[gist id=”a4aa1d1d9fc6dea4b68e95bb012d46c1″]