Opened 11 years ago
Closed 10 years ago
#31602 closed enhancement (invalid)
oEmbed: Instagram URL pattern with username in URL
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Embeds | Keywords: | |
| Focuses: | Cc: |
Description
Instagram also gives users URLs like https://instagram.com/pochoy_29/p/yRN4lxGO18/ where pochoy_29 is the username. It would be nice to support this pattern as well.
Change History (5)
#2
@
11 years ago
- Milestone changed from 4.2 to Future Release
We're already planning beta 1, definitely not 4.2.
#3
@
11 years ago
This works as a compatibility shim for me:
wp_oembed_add_provider( '#https?://instagram\.com/[^/]+?/p/.*#i', 'https://api.instagram.com/oembed', true );
add_filter( 'oembed_fetch_url', function( $provider, $url, $args ) {
if ( false === stripos( $provider, 'api.instagram.com' ) ) {
return $provider;
}
$url = preg_replace( '#https?://instagram\.com/([^/]+?/)p/(.*)#i', 'https://instagram.com/p/$2', $url );
$provider = add_query_arg( 'url', $url, $provider );
return $provider;
}, 10, 3 );
This ticket was mentioned in Slack in #core by johnbillion. View the logs.
11 years ago
Note: See
TracTickets for help on using
tickets.
Hm, Instagram doesn't recognize the URL in its oEmbed endpoint:
Do we have a contact there?