Skip to content

Commit

Permalink
Instagram shortcodes: support reels and videos (#40682)
Browse files Browse the repository at this point in the history
Fixes #40680

Follow-up to #19735

Let's grab instagram IDs from reels in AMP views too.
  • Loading branch information
jeherve authored Dec 20, 2024
1 parent a9355bd commit cc8c2f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: bugfix

Shortcode embeds: ensure Instagram reels are properly displayed in AMP views.
2 changes: 1 addition & 1 deletion projects/plugins/jetpack/modules/shortcodes/instagram.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ function jetpack_shortcode_instagram( $atts ) {
}

if ( class_exists( 'Jetpack_AMP_Support' ) && Jetpack_AMP_Support::is_amp_request() ) {
$url_pattern = '#http(s?)://(www\.)?instagr(\.am|am\.com)/p/([^/?]+)#i';
$url_pattern = '#http(s?)://(www\.)?instagr(\.am|am\.com)/(p|tv|reel)/([^/?]+)#i';
preg_match( $url_pattern, $atts['url'], $matches );
if ( ! $matches ) {
return sprintf(
Expand Down

0 comments on commit cc8c2f2

Please sign in to comment.