Viewing 5 replies - 1 through 5 (of 5 total)
  • J M

    (@hiphopinenglish)

    I’m using wp_oembed_get like so:

    <?php $url = get_post_meta($post->ID, '_cmb_video_url', true);
    echo wp_oembed_get($url, ''); ?>

    Where I have the URL stored in post meta.

    Thread Starter fukr

    (@fukr)

    Does it work for you? It returns nothing on my side.

    J M

    (@hiphopinenglish)

    Yes, it does. I’m using this in a few places and it works with plain YouTube URLs. Are you absolutely sure you’re getting the right piece of data?
    The other thing I’ve just thought of is that hardcoding a link did not work for me. I’m grabbing URLs stored in post meta.

    Thread Starter fukr

    (@fukr)

    Thanks for your reply.
    I am sure I am getting the right data.

    And I’ve tried both the hardcoding video link and link from post meta.
    But failed..

    J M

    (@hiphopinenglish)

    What does print_r return you for your wp_oembed_get variable?
    e.g.

    $url = get_post_meta( $post-ID, 'my_video_meta_key', true);
    $embed = wp_oembed_get( $url, '' );
    echo '<pre>';
    print_r ($embed);
    echo '</pre>';
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Do_Shortcode not working for Embed’ is closed to new replies.