Ayesh / WordPress-oEmbed-Plus

WordPress plugin to support Facebook and Instagram oEmbed embeds

Home Page:https://php.watch/articles/wordpress-facebook-instagram-oembed

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: Instagram Embeds do not work

mikeyarce opened this issue · comments

Hi @Ayesh,

We're considering recommending this plugin for customers of WordPress VIP and in my review I found a problem with Instagram Embeds:

On this line:
https://github.com/Ayesh/WordPress-oEmbed-Facebook-Instagram/blob/master/oembed-plus.php#L22

There's a check for https://graph.facebook.com/v8.0/oembed_ and since Instagram is using the instagram_oembed the check fails and so the Instagram Embeds never load.

I think adding a check for the Instagram embed would fix this:

if (strpos($provider_url, 'https://graph.facebook.com/v8.0/oembed_') === false 
		|| strpos($provider_url, 'https://graph.facebook.com/v8.0/instagram_oembed') === false) {
		return $provider_url;
	}

Hi @mikeyarce - thanks a lot for this. I just pushed with this change, and will follow up on other two issues as well. I'm happy to hear you are considering this for WordPress VIP 👍🏽 .