Question

How can I make oEmbed work on the excerpt field so I only have to paste the youtube url in there and then be able to echo 'get_the_excerpt()'?

I also want to filter oEmbed and change the wmode but I think I found a solution for that here: http://code.hyperspatial.com/all-code/wordpress-code/oembed-wmode/

EDIT: Crap! I was wrong, it doesn't work at all, nothing happens. Anyone got a better solution?

Was it helpful?

Solution

Not entirely sure it is supposed to be used like this, but by analogue with the_content try this:

add_filter('the_excerpt', array($wp_embed, 'autoembed'), 9);
Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top