WordPress.org

Ready to get started?Download WordPress

Forums

Tweet no longer embed using oembed (3 posts)

  1. marco-raaphorst
    Member
    Posted 7 months 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
    Member
    Posted 7 months 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
    Member
    Posted 7 months ago #

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

Reply

You must log in to post.

About this Topic