Skip to content

Instantly share code, notes, and snippets.

@david-binda
Last active January 3, 2016 13:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save david-binda/8471299 to your computer and use it in GitHub Desktop.
Save david-binda/8471299 to your computer and use it in GitHub Desktop.
Fix for a SSL update of Twitter oembed API for WordPress by Parade dev team ( http://www.parade.com ). Quick fix till we get an core update. See: https://core.trac.wordpress.org/changeset/26967 . Might require you to resave post in which oembed request failed previously as oembeds are being cached ( see: https://github.com/WordPress/WordPress/bl…
add_filter( 'oembed_providers', 'oembed_fix_twitter', 10, 1 );
function oembed_fix_twitter( $providers = array() ){
$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