Allow WP_Embed (oEmbed) to filter the_content on non post_content.
Ran into a problem tonight where simply applying ‘the_content’ filter to some content wasn’t getting any oembed magic. After a look at WP_Embed class I quickly found that WP does the right thing and caches the filtered content, so without a PostID is quites before it does any work.
Here’s a quick hack to get that non-post content to be filtered.
Hope this comes in handy.
Hi, I came across your post looking for a solution to why echo apply_filters(‘the_content’, term_description()); doesn’t embed YouTube URLs on their own line.
Unfortunately I don’t understand what you’re doing with your solution above – I wonder if you could clarify why changing the ID of the global $post variable makes a difference?
Many thanks in advance,
Iain