Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instagram: update embed to support new TV URLs #11329

Merged
merged 9 commits into from
Feb 25, 2019
Merged

Conversation

jeherve
Copy link
Member

@jeherve jeherve commented Feb 12, 2019

Changes proposed in this Pull Request:

This updates our custom embed provider to support Instagram TV URLs, just like Core will soon: https://core.trac.wordpress.org/changeset/44486

I also took the opportunity to add some Unit Tests for Instagram, we did not have any before.

Testing instructions:

  • Try adding the following URLs to a brand new post, and see that they all get transformed into embeds on publish:
A classic IG embed

https://www.instagram.com/p/BnMOk_FFsxg/

A TV IG embed

https://www.instagram.com/tv/BkQjCfsBIzi/

A profile alternative picture IG embed

https://www.instagram.com/jeherve/p/BnMO9vRleEx/

A profile alternative video IG embed

https://www.instagram.com/instagram/tv/BkQjCfsBIzi/

An Instagram shortcode

[instagram url="http://instagram.com/p/BnMO9vRleEx/"]

Proposed changelog entry for your changes:

  • Instagram: update embed to support Instagram TV URLs

@jeherve jeherve added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Feature] Shortcodes / Embeds [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels Feb 12, 2019
@jeherve jeherve added this to the 7.1 milestone Feb 12, 2019
@jeherve jeherve self-assigned this Feb 12, 2019
@jeherve jeherve requested a review from a team as a code owner February 12, 2019 18:43
@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello jeherve! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer, review, and approve D24268-code before merging this PR. Thank you!

@jetpackbot
Copy link

jetpackbot commented Feb 12, 2019

Thank you for the great PR description!

When this PR is ready for review, please apply the [Status] Needs Review label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.

Scheduled Jetpack release: February 14, 2019.
Scheduled code freeze: February 7, 2019

Generated by 🚫 dangerJS against 3bef5b3

@matticbot
Copy link
Contributor

jeherve, Your synced wpcom patch D24268-code has been updated.

For images, display the image in the RSS feed with a link to the Instagram page.
For videos, display only a link to the video.
@matticbot
Copy link
Contributor

jeherve, Your synced wpcom patch D24268-code has been updated.

This way regardless of your version of Core, we'll remove Core's embed before to add our own.
@matticbot
Copy link
Contributor

jeherve, Your synced wpcom patch D24268-code has been updated.

jeherve and others added 4 commits February 13, 2019 18:08
The code for replacing iframe and blockquote for URLs in terms of pre_kses does not really work, as it's
expecting URL in 2nd matching group, which only exists in the first regex. The second one does not even
have 2nd matching group.

In order to make the code work for both regexes, this changeset updates both regexes to contain
instagram.com URL in 1st matching group.

Originally submitted in D24298
@matticbot
Copy link
Contributor

jeherve, Your synced wpcom patch D24268-code has been updated.

Copy link
Contributor

@brbrr brbrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also took the opportunity to add some Unit Tests for Instagram, we did not have any before.

<3

Works well. Thanks!

@brbrr brbrr added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels Feb 25, 2019
@jeherve jeherve merged commit 2171105 into master Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants