Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@markjaquith
Created January 21, 2014 02:14
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save markjaquith/8533286 to your computer and use it in GitHub Desktop.
Save markjaquith/8533286 to your computer and use it in GitHub Desktop.
Fix Twitter embeds in WordPress < 3.8.1
<?php
add_filter( 'oembed_providers', 'oembed_fix_twitter', 10, 1 );
function oembed_fix_twitter( $providers ) {
$providers[ '#https?://(www\.)?twitter\.com/.+?/status(es)?/.*#i' ] = array( 'https://api.twitter.com/1/statuses/oembed.{format}', true );
return $providers;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment