Strange Symphonies Don’t worry, be happy

YouTube Post Type

Description

YouTube Post Type allows you to easily add YouTube videos as post into your WordPress installation via the introduction of register_post_types in WordPress v2.9. This will make YouTube a first class citizen in your WordPress.

Why would you want to do this? If you want a post to represent a YouTube video.

You add YouTube videos by specifying the URL or the YouTube id.

Your YouTube thumbnails are also downloaded and pulled into the system so you can use them. Your YouTube also gets associated to the first thumbnail found.

How It Works

YouTube Post Type allows a WordPress post to represent a YouTube video via WordPress custom post types (register_post_types). This makes YouTube a first class citizen, and easily extensible by other plugins.

I've replaced the default "Add New" menu option. You cannot simply add a YouTube video by creating a new "post". You are required to submit a YouTube URL or ID, then a "post" will be created representing the YouTube video. The YouTube ID is stored as the post's guid.

Each of the video's thumbnails are pulled from YouTube and stored in the system as a new Media file. They are associated with the YouTube post through the attachment's post_parent. The first thumbnail is chosen as the default thumbnail. The source of the thumbnail is stored as metadata in the postmeta table.

Installation

  • Download Now
  • Upload the youtube_post_type folder into your plugin directory.
  • Activate the plugin through the 'Plugins' menu in WordPress

If you want to create a custom theme page for YouTube posts. Inside your theme you are required to create a file called single-youtube.php.

Screenshots

Easily add YouTube videos

Why I Created It

Shortcomings of other YouTube plugins:

  • Most of them were to embed YouTube video via a WordPress shortcode.
  • None of them detailed how the plugin worked to support a YouTube as a post.
  • I wanted YouTube to work natively, with as little hacks as possible.

Links

Change Log

v0.2 - 19th March 2010

  • Fixed bug to catch up with WordPress 3 development where a post type has new features for: title, editor, thumbnail, and excerpt

v0.1 - 18th March 2010

  • Initial Release
Comments (2) Trackbacks (0)
  1. Does this plugin work at all with 2.9.2?

    It appears to brilliantly provide exactly the functionality I need, but I’d rather not install 3.0 for clients until it is officially released :)

  2. I haven’t tested it with 2.9.2, but I don’t think it will work.

    You should give 3 a try, its a much needed upgrade, especially with the easy menu generation. I haven’t run into any major bugs since the 3.0-beta1


Leave a comment


No trackbacks yet.