From c2e30ec38262db49c7501293bda0eaf2728c7104 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Wed, 27 Sep 2017 13:25:06 +0000 Subject: [PATCH] Embeds: Add support for Amazon Kindle instant previews. Props jsepia, morganestes, adamsilverstein, swissspidy, jbpaul17, johnbillion, rugved Fixes #38181 git-svn-id: https://develop.svn.wordpress.org/trunk@41615 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-oembed.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/wp-includes/class-oembed.php b/src/wp-includes/class-oembed.php index aba76e5d55..51c7aa1ea5 100644 --- a/src/wp-includes/class-oembed.php +++ b/src/wp-includes/class-oembed.php @@ -104,6 +104,16 @@ class WP_oEmbed { '#https?://www\.facebook\.com/.*/videos/.*#i' => array( 'https://www.facebook.com/plugins/video/oembed.json/', true ), '#https?://www\.facebook\.com/video\.php.*#i' => array( 'https://www.facebook.com/plugins/video/oembed.json/', true ), '#https?://(www\.)?screencast\.com/.*#i' => array( 'https://api.screencast.com/external/oembed', true ), + '#https?://([a-z0-9-]+\.)?amazon\.(com|com\.mx|com\.br|ca)/.*#i' => array( 'https://read.amazon.com/kp/api/oembed', true ), + '#https?://([a-z0-9-]+\.)?amazon\.(co\.uk|de|fr|it|es|in|nl|ru)/.*#i' => array( 'https://read.amazon.co.uk/kp/api/oembed', true ), + '#https?://([a-z0-9-]+\.)?amazon\.(co\.jp|com\.au)/.*#i' => array( 'https://read.amazon.com.au/kp/api/oembed', true ), + '#https?://([a-z0-9-]+\.)?amazon\.cn/.*#i' => array( 'https://read.amazon.cn/kp/api/oembed', true ), + '#https?://(www\.)?a\.co/.*#i' => array( 'https://read.amazon.com/kp/api/oembed', true ), + '#https?://(www\.)?amzn\.to/.*#i' => array( 'https://read.amazon.com/kp/api/oembed', true ), + '#https?://(www\.)?amzn\.eu/.*#i' => array( 'https://read.amazon.co.uk/kp/api/oembed', true ), + '#https?://(www\.)?amzn\.in/.*#i' => array( 'https://read.amazon.in/kp/api/oembed', true ), + '#https?://(www\.)?amzn\.asia/.*#i' => array( 'https://read.amazon.com.au/kp/api/oembed', true ), + '#https?://(www\.)?z\.cn/.*#i' => array( 'https://read.amazon.cn/kp/api/oembed', true ), ); if ( ! empty( self::$early_providers['add'] ) ) { @@ -177,6 +187,13 @@ class WP_oEmbed { * | Twitter | twitter.com/likes | Yes | 4.7.0 | * | Twitter | twitter.com/lists | Yes | 4.7.0 | * | Screencast | screencast.com | Yes | 4.8.0 | + * | Amazon | amazon.com|com.mx|com.br|ca | Yes | 4.9.0 | + * | Amazon | amazon.de|fr|it|es|in|nl|ru|co.uk | Yes | 4.9.0 | + * | Amazon | amazon.co.jp|com.au | Yes | 4.9.0 | + * | Amazon | amazon.cn | Yes | 4.9.0 | + * | Amazon | a.co | Yes | 4.9.0 | + * | Amazon | amzn.to|eu|in|asia | Yes | 4.9.0 | + * | Amazon | z.cn | Yes | 4.9.0 | * * No longer supported providers: *