PluginProbe
Elementor Website Builder – more than just a page builder / 3.4.7
Elementor Website Builder – more than just a page builder v3.4.7
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 +20 -0 3.4.63.4.7 View file →
@@ -117,8 +117,28 @@
117 117 $time_text = date( 'H\hi\ms\s', $options['start'] ); // PHPCS:Ignore WordPress.DateTime.RestrictedFunctions.date_date
118 118 }
119 119
120 120 $replacements['{TIME}'] = $time_text;
121 +
122 + /**
123 + * Handle Vimeo private videos
124 + *
125 + * Vimeo requires an additional parameter when displaying private/unlisted videos. It has two ways of
126 + * passing that parameter:
127 + * * as an endpoint - vimeo.com/{video_id}/{privacy_token}
128 + * OR
129 + * * as a GET parameter named `h` - vimeo.com/{video_id}?h={privacy_token}
130 + *
131 + * The following regex match looks for either of these methods in the Vimeo URL, and if it finds a privacy
132 + * token, it adds it to the embed params array as the `h` parameter (which is how Vimeo can receive it when
133 + * using Oembed).
134 + */
135 + $h_param = [];
136 + preg_match( '/(?|(?:[\?|\&]h={1})([\w]+)|\d\/([\w]+))/', $video_url, $h_param );
137 +
138 + if ( ! empty( $h_param ) ) {
139 + $embed_url_params['h'] = $h_param[1];
140 + }
121 141 }
122 142
123 143 $embed_pattern = str_replace( array_keys( $replacements ), $replacements, $embed_pattern );
124 144