• Hey folks!

    Since most of WordPress now automatically converts YouTube URLs to embedded videos, it would be great to have the “Enter Video or Virtual Tour Embed Code:” option for each listing do the same.

    It doesn’t have to show it in the editor, but it would be great if the front-end would auto-detect the URL and embed it automatically.

    https://wordpress.org/plugins/wp-listings/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author agentevolution

    (@agentevolution)

    To make it as flexible as possible, not just oEmbed capable URL’s, we decided to go with the text field where any other embed code can be used.

    Does the text field only work with Jetpack shortcodes? I tried [embed] and that didn’t work, installed a different YouTube plugin and it’s shortcode didn’t work either

    Okay, I changed the code in single-listing.php from
    <?php echo get_post_meta( $post->ID, '_listing_video', true); ?>

    to
    <?php echo do_shortcode(get_post_meta( $post->ID, '_listing_video', true)); ?>

    and it now works for the YouTube plugin that I installed – but it still doesn’t work for the WordPress [embed]

    Thread Starter jas8522

    (@jas8522)

    I understand where you guys are coming from in terms of ensuring the flexibility of the embed field, but you have to realize that embed codes aren’t that user friendly for the people that are typically doing the management of listings on the sites.

    Why not simply throw in a conditional that checks if the content contains and embed code. If it’s only a URL (a bit of pattern matching should do the trick) then run it through the wordpress embed function and otherwise leave it as is…

    Plugin Author agentevolution

    (@agentevolution)

    You’re welcome to contribute your suggestion and code to this open source project at https://github.com/agentevolution/wp-listings

    Thread Starter jas8522

    (@jas8522)

    Good point! I didn’t realize it was open source (should have checked). I will do so!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Request: AutoEmbed for YouTube Videos’ is closed to new replies.