WordPress Movies Plugin

Easily attach movie posters and other movie data from TheMovieDb.org to your blog posts or events in WordPress

View the Project on GitHub zmcghee/wp-movies

Import Tool

The import tool suggests movie matches from TMDb based on your post titles. You can choose from the matches, or leave a post without a movie. The blue icons indicate that a poster (left) and a backdrop image (right) are available for every movie.

Attach Media to a Post

Here we can see the import tool copied a poster and a backdrop image from TMDb for our post about Back to the Future and attached them as media to that post. It also set the backdrop image as the featured image, because we configured the plugin to do that.

Featured Image

We see the featured image showing with our blog post or event post type on our public blog.


Installation

Download this package and upload to plugins: https://github.com/zmcghee/wp-movies/archive/master.zip

After you activate the plugin, configure it by going to the Settings screen under the Movies menu in your admin dashboard. You'll need a TMDb API key, which you can get at http://www.themoviedb.org/documentation/api


How does it work?

To attach movie data to your posts, you use the Import Tool under the Movies menu in your admin dashboard. The tool suggests movie matches based on your post titles.

If you want to filter by a specific post type, you can configure that in Settings, also in the Movies menu. For example, we use the Events Calendar (Pro) plugin, which sets events to a post type of tribe_events.

Unless you've configured it to do otherwise, the import tool will:


What other movie data can I use in my theme?

Once movie data is imported and attached to a post, it's stored as custom metadata which is accessible through the Movie object. A basic example looks like::

$movie = new Movie( $post->ID );
if( $movie->title )
    echo $movie->title;
if( $movie->genres )
    echo implode(", ", $movie->genres);

Properties of every Movie object::

$movie->tmdb_id
$movie->title
$movie->year  # this is parsed from the tmdb release date (if found)
$movie->backdrop_path  # full url from your wp uploads dir
$movie->poster_path  # full url from your wp uploads dir
$movie->genres  # array in plain text, e.g. array('Action', 'Adventure')
$movie->imdb_id
$movie->runtime  # in minutes, e.g. 121
$movie->languages  # array in plain text, e.g. array('English')
$movie->overview  # tmdb's text synopsis of movie

Although every Movie object has these properties, they may be empty depending on the source data.


Credits & License

This package is licensed under the BSD license. A copy of this license is enclosed in license.txt. More information at http://opensource.org/licenses/bsd-license.php

This package also includes open source libraries and code samples from other authors, which are redistributed under the terms of their respective licenses.