Currently in WordPress 3.5 when you create a new post you can simply paste in a YouTube URL and on the live post this gets converted into an embedded video. This is working great for me within WordPress, however I’m pulling the wordpress post into my non-WP site using get_post and the URL comes over instead of embedded video.
I’m trying to determine the best method to make any YouTube video link that is found in the content of a post, show as embedded video.
Not sure if there is a function I can borrow from WordPress on my page (and how I would do that) or if need to parse the content somehow with PHP to find video links. Not sure how to do that either, given that each video is going to have a different url parameter at the end such as: http://www.youtube.com/watch?v=abcdefghijk
Any thoughts on this?
I stumbled across this function:
I used this as a basis to write an advanced search and replace. this may have been doable with REGEX, I’m not sure, but this has served the purpose. Thanks all!