Skip to content

Instantly share code, notes, and snippets.

@dancameron
Created September 16, 2012 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dancameron/3731103 to your computer and use it in GitHub Desktop.
Save dancameron/3731103 to your computer and use it in GitHub Desktop.
Allow WP_Embed (oEmbed) to filter the_content on non post_content.
<?php
// WP_Embed::shortcode will not proceed without a postID
global $post;
$post->ID = PHP_INT_MAX - $data['id']; // Make sure the id is unique so that it can be cached without conflict
echo apply_filters('the_content', $data['content'] );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment