Skip to content

hackcurio/oembed_in_library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OEmbed in Library Plugin

This is a modification to bring the now-defunct OEmbed in Library plugin up to speed with the latest Wordpress updates and adapt it for our specific use case. The basic strategy is to create a media library item with a post_title field that contains an embed shortcode with an external link to a video. The format is thus: [embed]https://vimeo.com/rest_of_url[/embed]. When the media item is inserted into a regular post (an "entry" page, in our theme), Wordpress will automatically render it as a video player box.

We use the Vimeo API library for PHP to generate and host thumbnails for our video content. In index.php, the set_thumbnail() function configures the Vimeo API and support for several Vimeo URL structures. (In our use case, because we are hosting videos from a private Vimeo account, our URLs contain two hashes, like: vimeo.com/hash1/hash2.) Support for YouTube URLs has been mostly deprecated and so should not be relied upon to function perfectly without further development tweaks, but some vestigial support does remain.

The thumbnail URL is then automatically saved as post meta on the created media library item. (In our use case, it is surfaced as one of the custom meta fields viewable in the admin interface.)

NB: After WP upgrades, it is a good idea to check for updates to the Vimeo library on GitHub as well. If the OEmbed plugin becomes incompatible with new Vimeo or WP versions, you can always just embed videos directly into posts (by inserting the raw link into the post body text) until you can get a developer to tweak the plugin. The only downside is that you won’t have metadata for those videos in the interim, but you can always add these later (I recommend keeping a list).

About

OEmbed in Library Plugin for Wordpress

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published