Allow WP_Embed (oEmbed) to filter the_content on non post_content.

September 15, 2012

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.