Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
** Please get this plugin from the repo:
** This paste isn't always up to date.
function embedGistsInPosts($post) {
$pat = '/<p>(https?:)\/\/\/(.*)\/(.*)<\/p>/mi';
$sub = '<script src="$1//$2/$3.js"></script>';
$post = preg_replace($pat, $sub, $post);
return ($post);
add_action('the_content', 'embedGistsInPosts');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.