Tweet no longer embed using oembed (3 posts)

  1. marco-raaphorst
    Posted 1 year ago #

    Adding a Tweet by oEmbed not longer seems to work on all my wordpress installations.

    Probably Twitter has changed API. Any fix available yet?

  2. johngorenfeld
    Posted 1 year ago #

    Yeah, you got it right, the Twitter API changed and broke the WordPress wp-include. The following fix worked for me but required re-saving the post in question.

    add_filter( 'oembed_providers', 'twitter_hotfix' );
    function twitter_hotfix( $providers ) {
      $providers['#https?://(www\.)?twitter\.com/.+?/status(es)?/.*#i'] = array( 'https://api.twitter.com/1/statuses/oembed.{format}',\
     true  );
      return $providers;
  3. johngorenfeld
    Posted 1 year ago #

    The big change seems to involve forbidding non-https connections.

Topic Closed

This topic has been closed to new replies.

About this Topic