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]
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…
You’re welcome to contribute your suggestion and code to this open source project at https://github.com/agentevolution/wp-listings
Good point! I didn’t realize it was open source (should have checked). I will do so!