Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi demilio,

    Sure you can! movie metadata are regular WP Post Meta:

    $meta = get_post_meta( get_the_ID(), "_wpmoly_movie_{$meta_slug}" );

    Default supported $meta_slug values are: tmdb_id, title, original_title, tagline, overview, release_date, local_release_date, runtime, production_companies, production_countries, spoken_languages, genres, director, producer, cast, photography, composer, author, writer, certification, budget, revenue, imdb_id, adult, homepage, rating, status, media, language, subtitle and format.

    There’s also an internal way to get these data:

    $meta = wpmoly_get_movie_meta( get_the_ID(), $meta_slug, true );

    Note that this just return the raw, unformatted data; some data can be formatted with a wpmoly_format_movie_{$meta_slug} filter hook, for instance:

    $director = apply_filters( 'wpmoly_format_movie_director', $director );
    Thread Starter demilio

    (@demilio)

    Thanks!! works like a charm 🙂

    Here is how i used it, in case someone wants to know:

    <ul class="list-group">
        <li class="list-group-item"><h4>Overview</h4></li>
    <?php if ( wpmoly_get_movie_meta($post->ID, 'overview', true) ) { ?>
        <li class="list-group-item"><?php echo wpmoly_get_movie_meta( get_the_ID(), 'overview', true ); ?></li>
    <?php } ?>
    </ul>

    Can we use this for trailer extension and uploaded images?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get metadata with PHP’ is closed to new replies.