From cb0048a6c593d96bc394b04e32c13a9a328bdf96 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Fri, 26 Aug 2016 11:56:47 +0000 Subject: [PATCH] Embeds: Add support for embedding Facebook posts and videos via oEmbed. Fixes #34737 Props pento, GaryJ git-svn-id: https://develop.svn.wordpress.org/trunk@38367 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-oembed.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/wp-includes/class-oembed.php b/src/wp-includes/class-oembed.php index 7b835553c1..b1840cf997 100644 --- a/src/wp-includes/class-oembed.php +++ b/src/wp-includes/class-oembed.php @@ -95,6 +95,15 @@ class WP_oEmbed { '#https?://videopress.com/v/.*#' => array( 'https://public-api.wordpress.com/oembed/1.0/?for=' . $host, true ), '#https?://(www\.)?reddit\.com/r/[^/]+/comments/.*#i' => array( 'https://www.reddit.com/oembed', true ), '#https?://(www\.)?speakerdeck\.com/.*#i' => array( 'https://speakerdeck.com/oembed.{format}', true ), + '#https?://www\.facebook\.com/.*/posts/.*#i' => array( 'https://www.facebook.com/plugins/post/oembed.json/', true ), + '#https?://www\.facebook\.com/.*/activity/.*#i' => array( 'https://www.facebook.com/plugins/post/oembed.json/', true ), + '#https?://www\.facebook\.com/photo(s/|\.php).*i' => array( 'https://www.facebook.com/plugins/post/oembed.json/', true ), + '#https?://www\.facebook\.com/permalink\.php.*#i' => array( 'https://www.facebook.com/plugins/post/oembed.json/', true ), + '#https?://www\.facebook\.com/media/.*#i' => array( 'https://www.facebook.com/plugins/post/oembed.json/', true ), + '#https?://www\.facebook\.com/questions/.*#i' => array( 'https://www.facebook.com/plugins/post/oembed.json/', true ), + '#https?://www\.facebook\.com/notes/.*#i' => array( 'https://www.facebook.com/plugins/post/oembed.json/', true ), + '#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 ), ); if ( ! empty( self::$early_providers['add'] ) ) { @@ -164,6 +173,7 @@ class WP_oEmbed { * | Speaker Deck | speakerdeck.com | Yes | 4.4.0 | * | Twitter | twitter.com/timelines | Yes | 4.5.0 | * | Twitter | twitter.com/moments | Yes | 4.5.0 | + * | Facebook | facebook.com | Yes | 4.7.0 | * * No longer supported providers: *