Get YouTube video id from url in a custom field
An alternative would be to use WordPress’s build in auto embed, the following line in core is responsible for auto embed: add_filter( ‘the_content’, array(&$this, ‘autoembed’), 8 ); Which means: Whenever we are about to display content try to auto embed all url’s with a priority of 8. You could add a custom filter before this … Read more