PluginProbe
Elementor Website Builder – more than just a page builder / 3.21.3
Elementor Website Builder – more than just a page builder v3.21.3
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | includes/embed.php +7 -43 4.2.43.21.3 View file →
@@ -9,9 +9,9 @@
9 9 * Elementor embed.
10 10 *
11 11 * Elementor embed handler class is responsible for Elementor embed functionality.
12 12 * The class holds the supported providers with their embed patters, and handles
13 - * their custom properties to create custom HTML with the embedded content.
13 + * their custom properties to create custom HTML with the embeded content.
14 14 *
15 15 * @since 1.5.0
16 16 */
17 17 class Embed {
@@ -16,25 +16,8 @@
16 16 */
17 17 class Embed {
18 18
19 19 /**
20 - * Embeddable background video providers.
21 - *
22 - * Holds the list of providers whose background video is rendered as an embedded
23 - * iframe player (.elementor-background-video-embed) rather than a hosted <video>
24 - * element. This is intentionally a SUBSET of the providers recognized by
25 - * get_video_properties() — the frontend background-video handler only mounts
26 - * YouTube/Vimeo players, so other providers must fall through to hosted rendering.
27 - *
28 - * @access private
29 - * @static
30 - *
31 - * @var array Embeddable background video provider slugs.
32 - */
33 - private static $video_embed_providers = [ 'youtube', 'vimeo' ];
34 -
35 -
36 - /**
37 20 * Provider match masks.
38 21 *
39 22 * Holds a list of supported providers with their URL structure in a regex format.
40 23 *
@@ -44,9 +27,9 @@
44 27 *
45 28 * @var array Provider URL structure regex.
46 29 */
47 30 private static $provider_match_masks = [
48 - 'youtube' => '/^.*(?:youtu\.be\/|youtube(?:-nocookie)?\.com\/(?:(?:watch)?\?(?:.*&)?vi?=|(?:embed|v|vi|user|shorts)\/))([^\?&\"\'>]+)/',
31 + 'youtube' => '/^.*(?:youtu\.be\/|youtube(?:-nocookie)?\.com\/(?:(?:watch)?\?(?:.*&)?vi?=|(?:embed|v|vi|user)\/))([^\?&\"\'>]+)/',
49 32 'vimeo' => '/^.*vimeo\.com\/(?:[a-z]*\/)*([‌​0-9]{6,11})[?]?.*/',
50 33 'dailymotion' => '/^.*dailymotion.com\/(?:video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/',
51 34 'videopress' => [
52 35 '/^(?:http(?:s)?:\/\/)?videos\.files\.wordpress\.com\/([a-zA-Z\d]{8,})\//i',
@@ -104,24 +87,8 @@
104 87 return null;
105 88 }
106 89
107 90 /**
108 - * Is embeddable background video.
109 - *
110 - * Whether a given video URL belongs to a provider that the frontend
111 - * background-video handler renders as an embedded iframe player.
112 - *
113 - * @param string $video_url Video URL.
114 - *
115 - * @return bool
116 - **/
117 - public static function is_embed_video( $video_url ) {
118 - $video_properties = self::get_video_properties( $video_url );
119 -
120 - return null !== $video_properties && in_array( $video_properties['provider'], self::$video_embed_providers, true );
121 - }
122 -
123 - /**
124 91 * Get embed URL.
125 92 *
126 93 * Retrieve the embed URL for a given video.
127 94 *
@@ -229,12 +196,8 @@
229 196 } else {
230 197 $default_frame_attributes['data-lazy-load'] = $video_embed_url;
231 198 }
232 199
233 - if ( isset( $embed_url_params['autoplay'] ) ) {
234 - $default_frame_attributes['allow'] = 'autoplay';
235 - }
236 -
237 200 $frame_attributes = array_merge( $default_frame_attributes, $frame_attributes );
238 201
239 202 $attributes_for_print = [];
240 203
@@ -259,10 +222,10 @@
259 222 /**
260 223 * Get oembed data from the cache.
261 224 * if not exists in the cache it will fetch from provider and then save to the cache.
262 225 *
263 - * @param string $oembed_url
264 - * @param string $cached_post_id
226 + * @param $oembed_url
227 + * @param $cached_post_id
265 228 *
266 229 * @return array|null
267 230 */
268 231 public static function get_oembed_data( $oembed_url, $cached_post_id ) {
@@ -290,9 +253,10 @@
290 253
291 254 /**
292 255 * Fetch oembed data from oembed provider.
293 256 *
294 - * @param string $oembed_url
257 + * @param $oembed_url
258 + *
295 259 * @return array|null
296 260 */
297 261 public static function fetch_oembed_data( $oembed_url ) {
298 262 $oembed_data = _wp_oembed_get_object()->get_data( $oembed_url );
@@ -307,9 +271,9 @@
307 271 ];
308 272 }
309 273
310 274 /**
311 - * @param string $oembed_url
275 + * @param $oembed_url
312 276 * @param null|string|int $cached_post_id
313 277 *
314 278 * @return string|null
315 279 */