From bacb5d26bc8880e1901176fa7e435a67746f9057 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 8 Apr 2022 06:29:26 +0000 Subject: [PATCH] Embeds: Add YouTube shorts to the allow list. YouTube shorts URLs have a different structure to other YouTube videos. This adds support for the structure for YouTube embeds. Props danielbachhuber, johnbillion, mukesh27. Fixes #55528. git-svn-id: https://develop.svn.wordpress.org/trunk@53106 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-oembed.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wp-includes/class-wp-oembed.php b/src/wp-includes/class-wp-oembed.php index 78297780bc..ca54dfa838 100644 --- a/src/wp-includes/class-wp-oembed.php +++ b/src/wp-includes/class-wp-oembed.php @@ -52,6 +52,7 @@ class WP_oEmbed { $providers = array( '#https?://((m|www)\.)?youtube\.com/watch.*#i' => array( 'https://www.youtube.com/oembed', true ), '#https?://((m|www)\.)?youtube\.com/playlist.*#i' => array( 'https://www.youtube.com/oembed', true ), + '#https?://((m|www)\.)?youtube\.com/shorts/*#i' => array( 'https://www.youtube.com/oembed', true ), '#https?://youtu\.be/.*#i' => array( 'https://www.youtube.com/oembed', true ), '#https?://(.+\.)?vimeo\.com/.*#i' => array( 'https://vimeo.com/api/oembed.{format}', true ), '#https?://(www\.)?dailymotion\.com/.*#i' => array( 'https://www.dailymotion.com/services/oembed', true ),