PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents / 3.5.1
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents v3.5.1
4.6.5 4.6.4 4.6.3 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.2.0 2.2.1 2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.7.0 3.7.1 3.7.2 3.7.3 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.14 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.10 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.4.0 4.4.1 4.4.10 4.4.11 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5.0 4.5.1
embedpress / EmbedPress / Elementor / Widgets / Embedpress_Elementor.php
embedpress / EmbedPress / Elementor / Widgets Last commit date
Embedpress_Calendar.php 4 years ago Embedpress_Document.php 3 years ago Embedpress_Elementor.php 4 years ago Embedpress_Pdf.php 4 years ago
Embedpress_Elementor.php
1390 lines
1 <?php
2
3 namespace EmbedPress\Elementor\Widgets;
4
5
6 use Elementor\Controls_Manager as Controls_Manager;
7
8 use Elementor\Plugin;
9 use Elementor\Widget_Base as Widget_Base;
10 use EmbedPress\Includes\Traits\Branding;
11 use EmbedPress\Shortcode;
12
13 (defined( 'ABSPATH' )) or die( "No direct script access allowed." );
14
15 class Embedpress_Elementor extends Widget_Base {
16 use Branding;
17 protected $pro_class = '';
18 protected $pro_text = '';
19 public function get_name() {
20 return 'embedpres_elementor';
21 }
22
23 public function get_title() {
24 return esc_html__( 'EmbedPress', 'embedpress' );
25 }
26
27 public function get_categories() {
28 return [ 'embedpress' ];
29 }
30
31 public function get_custom_help_url() {
32 return 'https://embedpress.com/documentation';
33 }
34
35 public function get_icon() {
36 return 'icon-embedpress';
37 }
38
39 /**
40 * Get widget keywords.
41 *
42 * Retrieve the list of keywords the widget belongs to.
43 *
44 * @return array Widget keywords.
45 * @since 2.4.1
46 * @access public
47 *
48 */
49 public function get_keywords() {
50 return [
51 'embedpress',
52 'audio',
53 'video',
54 'map',
55 'youtube',
56 'vimeo',
57 'wistia',
58 'twitch',
59 'soundcloud',
60 'giphy gifs',
61 'spotify',
62 'smugmug',
63 'meetup',
64 'apple',
65 'apple podcast',
66 'podcast',
67 'dailymotion',
68 'instagram',
69 'slideshare',
70 'flickr',
71 'ted',
72 'google docs',
73 'google slides',
74 'google drawings'
75 ];
76 }
77
78 protected function register_controls() {
79 $this->pro_class = is_embedpress_pro_active() ? '': 'embedpress-pro-control';
80 $this->pro_text = is_embedpress_pro_active() ? '': '<sup class="embedpress-pro-label" style="color:red">'.__('Pro', 'embedpress').'</sup>';
81 /**
82 * EmbedPress Content Settings
83 */
84 $this->start_controls_section(
85 'embedpress_elementor_content_settings',
86 [
87 'label' => esc_html__( 'Content Settings', 'embedpress' ),
88 ]
89 );
90
91 do_action( 'embedpress/embeded/extend', $this );
92 $this->add_control(
93 'embedpress_pro_embeded_source',
94 [
95 'label' => __( 'Source Name', 'embedpress' ),
96 'type' => Controls_Manager::SELECT,
97 'label_block' => false,
98 'default' => ['default'],
99 'options' => [
100 'default' => __( 'Default', 'embedpress' ),
101 'youtube' => __( 'YouTube', 'embedpress' ),
102 'vimeo' => __( 'Vimeo', 'embedpress' ),
103 'dailymotion' => __( 'Dailymotion', 'embedpress' ),
104 'wistia' => __( 'Wistia', 'embedpress' ),
105 'twitch' => __( 'Twitch', 'embedpress' ),
106 'soundcloud' => __( 'SoundCloud', 'embedpress' ),
107 ]
108 ]
109 );
110 $this->add_control(
111 'embedpress_embeded_link',
112 [
113
114 'label' => __( 'Embedded Link', 'embedpress' ),
115 'type' => Controls_Manager::TEXT,
116 'dynamic' => [
117 'active' => true,
118 ],
119 'placeholder' => __( 'Enter your Link', 'embedpress' ),
120 'label_block' => true
121
122 ]
123 );
124 $this->add_control(
125 'spotify_theme',
126 [
127 'label' => __( 'Player Background', 'embedpress' ),
128 'description' => __( 'Dynamic option will use the most vibrant color from the album art.', 'embedpress' ),
129 'type' => Controls_Manager::SELECT,
130 'label_block' => false,
131 'default' => '1',
132 'options' => [
133 '1' => __( 'Dynamic', 'embedpress' ),
134 '0' => __( 'Black & White', 'embedpress' )
135 ],
136 'condition' => [
137 'embedpress_pro_embeded_source' => 'spotify'
138 ]
139 ]
140 );
141 do_action( 'embedpress/control/extend', $this );
142 $this->add_control(
143 'embedpress_pro_video_start_time',
144 [
145 'label' => __( 'Start Time', 'embedpress' ),
146 'type' => Controls_Manager::NUMBER,
147 'description' => __( 'Specify a start time (in seconds)', 'embedpress' ),
148 'condition' => [
149 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'wistia', 'dailymotion', 'twitch']
150 ],
151 ]
152 );
153 $this->init_youtube_controls();
154 $this->init_vimeo_controls();
155 $this->init_wistia_controls();
156 $this->init_soundcloud_controls();
157 $this->init_dailymotion_control();
158 $this->init_twitch_control();
159
160 $this->end_controls_section();
161
162 $this->init_youtube_subscription_section();
163 $this->init_youtube_livechat_section();
164
165 if (! is_embedpress_pro_active()) {
166 $this->start_controls_section(
167 'embedpress_pro_section',
168 [
169 'label' => __('Go Premium for More Features', 'embedpress'),
170 ]
171 );
172
173 $this->add_control(
174 'embedpress_pro_cta',
175 [
176 'label' => __('Unlock more possibilities', 'embedpress'),
177 'type' => Controls_Manager::CHOOSE,
178 'options' => [
179 '1' => [
180 'title' => '',
181 'icon' => 'eicon-lock',
182 ],
183 ],
184 'default' => '1',
185 'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/in/upgrade-embedpress" target="_blank">Pro version</a> for more provider support and customization options.</span>',
186 ]
187 );
188
189 $this->end_controls_section();
190 }
191
192 $this->init_style_controls();
193 }
194 public function init_youtube_controls() {
195 $yt_condition = [
196 'embedpress_pro_embeded_source' => 'youtube'
197 ];
198 $this->add_control(
199 'embedpress_pro_youtube_end_time',
200 [
201 'label' => __( 'End Time', 'embedpress' ),
202 'type' => Controls_Manager::NUMBER,
203 'description' => __( 'Specify an end time (in seconds)', 'embedpress' ),
204 'condition' => $yt_condition,
205 ]
206 );
207 $this->add_control(
208 'pagesize',
209 [
210 'label' => __( 'Video Per Page', 'embedpress' ),
211 'description' => __( 'Specify the number of videos you wish to show on each page. Note: This option takes effect only when a YouTube channel is embedded.', 'embedpress' ),
212 'type' => Controls_Manager::NUMBER,
213 'label_block' => false,
214 'default' => 6,
215 'min' => 1,
216 'max' => 50,
217 'conditions' => [
218 'terms' => [
219 [
220 'name' => 'embedpress_pro_embeded_source',
221 'operator' => '===',
222 'value' => 'youtube',
223 ],
224 ],
225 ]
226 ]
227 );
228 $this->add_control(
229 'embedpress_pro_youtube_auto_play',
230 [
231 'label' => __( 'Auto Play', 'embedpress' ),
232 'type' => Controls_Manager::SWITCHER,
233 'label_block' => false,
234 'return_value' => 'yes',
235 'default' => 'no',
236 'condition' => $yt_condition,
237 ]
238 );
239 $this->add_control(
240 'embedpress_pro_youtube_player_options',
241 [
242 'label' => __( 'Player Options', 'embedpress' ),
243 'type' => Controls_Manager::HEADING,
244 'condition' => $yt_condition,
245 ]
246 );
247 $this->add_control(
248 'embedpress_pro_youtube_display_controls',
249 [
250 'label' => __( 'Controls', 'embedpress' ),
251 'type' => Controls_Manager::SELECT,
252 'label_block' => false,
253 'default' => 1,
254 'options' => [
255 '1' => __( 'Display immediately', 'embedpress' ),
256 '2' => __( 'Display after user initiation', 'embedpress' ),
257 '0' => __( 'Hide controls', 'embedpress' )
258 ],
259 'condition' => $yt_condition,
260 ]
261 );
262 $this->add_control(
263 'embedpress_pro_youtube_enable_fullscreen_button',
264 [
265 'label' => __( 'Fullscreen button', 'embedpress' ),
266 'type' => Controls_Manager::SWITCHER,
267 'label_block' => false,
268 'return_value' => 'yes',
269 'default' => 'yes',
270 'condition' => [
271 'embedpress_pro_embeded_source' => 'youtube',
272 'embedpress_pro_youtube_display_controls!' => '0'
273 ]
274 ]
275 );
276 $this->add_control(
277 'embedpress_pro_youtube_display_video_annotations',
278 [
279 'label' => __( 'Video Annotations', 'embedpress' ),
280 'type' => Controls_Manager::SWITCHER,
281 'label_block' => false,
282 'default' => 1,
283 'options' => [
284 '1' => __( 'Display', 'embedpress' ),
285 '3' => __( 'Do Not Display', 'embedpress' )
286 ],
287 'condition' => $yt_condition,
288 ]
289 );
290 //--- YouTube Pro control starts ---
291 $this->add_control(
292 'embedpress_pro_youtube_progress_bar_color',
293 [
294 'label' => __( 'Progress Bar Color', 'embedpress' ),
295 'type' => Controls_Manager::SELECT,
296 'label_block' => false,
297 'default' => 'red',
298 'options' => [
299 'red' => __( 'Red', 'embedpress' ),
300 'white' => __( 'White', 'embedpress' )
301 ],
302 'condition' => $yt_condition,
303 ]
304 );
305 $this->add_control(
306 'embedpress_pro_youtube_force_closed_captions',
307 [
308 'label' => sprintf(__( 'Closed Captions %s', 'embedpress' ), $this->pro_text ),
309 'type' => Controls_Manager::SWITCHER,
310 'label_block' => false,
311 'return_value' => 'yes',
312 'default' => 'no',
313 'separator' => 'before',
314 'classes' => $this->pro_class,
315 'condition' => $yt_condition,
316 ]
317 );
318 $this->add_control(
319 'embedpress_pro_youtube_modest_branding',
320 [
321 'label' => sprintf(__( 'Modest Branding %s', 'embedpress' ), $this->pro_text ),
322 'type' => Controls_Manager::SELECT,
323 'label_block' => false,
324 'default' => 1,
325 'options' => [
326 '0' => __( 'Display', 'embedpress' ),
327 '1' => __( 'Do Not Display', 'embedpress' )
328 ],
329 'condition' => [
330 'embedpress_pro_embeded_source' => 'youtube',
331 'embedpress_pro_youtube_display_controls!' => '0',
332 'embedpress_pro_youtube_progress_bar_color!' => 'white'
333 ],
334 'classes' => $this->pro_class,
335 ]
336 );
337 $this->add_control(
338 'embedpress_pro_youtube_display_related_videos',
339 [
340 'label' => __( 'Related Videos', 'embedpress' ),
341 'description' => __( 'Set it to "Yes" to display related videos from all channels. Otherwise, related videos will show from the same channel.', 'embedpress' ),
342 'type' => Controls_Manager::SWITCHER,
343 'label_block' => false,
344 'return_value' => 'yes',
345 'default' => 'yes',
346 'condition' => $yt_condition,
347 ]
348 );
349 $this->init_branding_controls( 'youtube');
350 }
351 public function init_youtube_subscription_section() {
352 $yt_condition = [
353 'embedpress_pro_embeded_source' => 'youtube',
354 ];
355 $this->start_controls_section(
356 'embedpress_yt_subscription_section',
357 [
358 'label' => __( 'YouTube Subscriber', 'embedpress' ),
359 'condition' => $yt_condition,
360
361 ]
362 );
363
364
365 $this->add_control(
366 'yt_sub_channel',
367 [
368
369 'label' => sprintf( __( 'Channel ID %s', 'embedpress' ), $this->pro_text),
370 'type' => Controls_Manager::TEXT,
371 'dynamic' => [
372 'active' => true,
373 ],
374 'placeholder' => __( 'Enter Channel ID', 'embedpress' ),
375 'label_block' => true,
376 'condition' => $yt_condition,
377 'classes' => $this->pro_class,
378 ]
379 );
380 $this->add_control(
381 'yt_sub_text',
382 [
383
384 'label' => sprintf( __( 'Subscription Text %s', 'embedpress' ), $this->pro_text),
385 'type' => Controls_Manager::TEXT,
386 'dynamic' => [
387 'active' => true,
388 ],
389 'placeholder' => __( 'Eg. Don\'t miss out! Subscribe', 'embedpress' ),
390 'label_block' => true,
391 'condition' => $yt_condition,
392 'classes' => $this->pro_class,
393 ]
394 );
395
396
397 $this->add_control(
398 'yt_sub_layout',
399 [
400 'label' => sprintf(__( 'Layout %s', 'embedpress' ), $this->pro_text ),
401 'type' => Controls_Manager::SELECT,
402 'label_block' => false,
403 'default' => 'default',
404 'options' => [
405 'default' => __( 'Default', 'embedpress' ),
406 'full' => __( 'Full', 'embedpress' )
407 ],
408 'condition' => [
409 'embedpress_pro_embeded_source' => 'youtube',
410 ],
411 'classes' => $this->pro_class,
412 ]
413 );
414
415 $this->add_control(
416 'yt_sub_theme',
417 [
418 'label' => sprintf(__( 'Theme %s', 'embedpress' ), $this->pro_text ),
419 'type' => Controls_Manager::SELECT,
420 'label_block' => false,
421 'default' => 'default',
422 'options' => [
423 'default' => __( 'Default', 'embedpress' ),
424 'dark' => __( 'Dark', 'embedpress' )
425 ],
426 'condition' => [
427 'embedpress_pro_embeded_source' => 'youtube',
428 ],
429 'classes' => $this->pro_class,
430 ]
431 );
432
433 $this->add_control(
434 'yt_sub_count',
435 [
436 'label' => sprintf(__( 'Subscriber Count %s', 'embedpress' ), $this->pro_text ),
437 'type' => Controls_Manager::SWITCHER,
438 'label_block' => false,
439 'return_value' => 'yes',
440 'default' => 'yes',
441 'condition' => $yt_condition,
442 'classes' => $this->pro_class,
443 ]
444 );
445
446 $this->end_controls_section();
447
448 }
449 public function init_youtube_livechat_section() {
450 $yt_condition = [
451 'embedpress_pro_embeded_source' => 'youtube',
452 ];
453 $this->start_controls_section(
454 'embedpress_yt_livechat_section',
455 [
456 'label' => __( 'YouTube Live Chat', 'embedpress' ),
457 'condition' => $yt_condition,
458
459 ]
460 );
461
462 $this->add_control(
463 'yt_lc_show',
464 [
465 'label' => sprintf(__( 'Show YouTube Live Chat %s', 'embedpress' ), $this->pro_text ),
466 'type' => Controls_Manager::SWITCHER,
467 'label_block' => false,
468 'return_value' => 'yes',
469 'default' => '',
470 'label_off' => __( 'Hide', 'embedpress' ),
471 'label_on' => __( 'Show', 'embedpress' ),
472 'condition' => $yt_condition,
473 'classes' => $this->pro_class,
474 ]
475 );
476
477
478 $this->end_controls_section();
479
480 }
481 public function init_dailymotion_control ( ){
482 //@TODO; Kamal - migrate from 'embedpress_pro_dailymotion_logo' to 'embedpress_pro_dailymotion_ui_logo'
483 $this->add_control(
484 'embedpress_pro_dailymotion_ui_logo',
485 [
486 'label' => sprintf(__( 'Logo %s', 'embedpress' ), $this->pro_text ),
487 'type' => Controls_Manager::SWITCHER,
488 'label_block' => false,
489 'return_value' => 'yes',
490 'default' => 'yes',
491 'label_off' => __( 'Hide', 'embedpress' ),
492 'label_on' => __( 'Show', 'embedpress' ),
493 'condition' => [
494 'embedpress_pro_embeded_source' => 'dailymotion'
495 ],
496 'classes' => $this->pro_class,
497 ]
498 );
499 $this->add_control(
500 'embedpress_pro_dailymotion_autoplay',
501 [
502 'label' => __( 'Auto Play', 'embedpress' ),
503 'type' => Controls_Manager::SWITCHER,
504 'label_block' => false,
505 'return_value' => 'yes',
506 'default' => 'no',
507 'label_off' => __( 'Hide', 'embedpress' ),
508 'label_on' => __( 'Show', 'embedpress' ),
509 'condition' => [
510 'embedpress_pro_embeded_source' => 'dailymotion'
511 ]
512 ]
513 );
514 $this->add_control(
515 'embedpress_pro_dailymotion_play_on_mobile',
516 [
517 'label' => __( 'Play On Mobile', 'embedpress' ),
518 'type' => Controls_Manager::SWITCHER,
519 'label_block' => false,
520 'return_value' => 'yes',
521 'default' => 'no',
522 'label_off' => __( 'Hide', 'embedpress' ),
523 'label_on' => __( 'Show', 'embedpress' ),
524 'condition' => [
525 'embedpress_pro_embeded_source' => 'dailymotion',
526 'embedpress_pro_dailymotion_autoplay' => 'yes'
527 ]
528 ]
529 );
530 $this->add_control(
531 'embedpress_pro_dailymotion_mute',
532 [
533 'label' => __( 'Mute', 'embedpress' ),
534 'type' => Controls_Manager::SWITCHER,
535 'label_block' => false,
536 'return_value' => 'yes',
537 'default' => 'no',
538 'label_off' => __( 'Hide', 'embedpress' ),
539 'label_on' => __( 'Show', 'embedpress' ),
540 'condition' => [
541 'embedpress_pro_embeded_source' => 'dailymotion'
542 ]
543 ]
544 );
545 $this->add_control(
546 'embedpress_pro_dailymotion_player_control',
547 [
548 'label' => __( 'Player Controls', 'embedpress' ),
549 'type' => Controls_Manager::SWITCHER,
550 'label_block' => false,
551 'return_value' => 'yes',
552 'default' => 'yes',
553 'label_off' => __( 'Hide', 'embedpress' ),
554 'label_on' => __( 'Show', 'embedpress' ),
555 'condition' => [
556 'embedpress_pro_embeded_source' => 'dailymotion'
557 ]
558 ]
559 );
560 $this->add_control(
561 'embedpress_pro_dailymotion_video_info',
562 [
563 'label' => __( 'Video Info', 'embedpress' ),
564 'type' => Controls_Manager::SWITCHER,
565 'label_block' => false,
566 'return_value' => 'yes',
567 'default' => 'yes',
568 'label_off' => __( 'Hide', 'embedpress' ),
569 'label_on' => __( 'Show', 'embedpress' ),
570 'condition' => [
571 'embedpress_pro_embeded_source' => 'dailymotion'
572 ]
573 ]
574 );
575 $this->add_control(
576 'embedpress_pro_dailymotion_control_color',
577 [
578 'label' => __( 'Control Color', 'embedpress' ),
579 'type' => Controls_Manager::COLOR,
580 'label_block' => false,
581 'default' => '#dd3333',
582 'condition' => [
583 'embedpress_pro_embeded_source' => 'dailymotion'
584 ]
585 ]
586 );
587 $this->init_branding_controls( 'dailymotion');
588
589 }
590 public function init_wistia_controls( ) {
591 $this->add_control(
592 'embedpress_pro_wistia_auto_play',
593 [
594 'label' => __( 'Auto Play', 'embedpress' ),
595 'type' => Controls_Manager::SWITCHER,
596 'label_block' => false,
597 'return_value' => 'yes',
598 'default' => 'no',
599 'condition' => [
600 'embedpress_pro_embeded_source' => 'wistia'
601 ],
602 ]
603 );
604
605 $this->add_control(
606 'embedpress_pro_wistia_color',
607 [
608 'label' => __( 'Scheme', 'embedpress' ),
609 'type' => Controls_Manager::COLOR,
610 'label_block' => false,
611 'default' => '#dd3333',
612 'condition' => [
613 'embedpress_pro_embeded_source' => 'wistia'
614 ]
615 ]
616 );
617
618
619
620 $this->add_control(
621 'embedpress_pro_wistia_captions_enabled_by_default',
622 [
623 'label' => __( 'Captions Enabled By Default', 'embedpress' ),
624 'type' => Controls_Manager::SWITCHER,
625 'label_block' => false,
626 'return_value' => 'yes',
627 'default' => 'no',
628 'condition' => [
629 'embedpress_pro_embeded_source' => 'wistia',
630 'embedpress_pro_wistia_captions' => 'yes'
631 ],
632 'classes' => $this->pro_class,
633 ]
634 );
635
636 $this->add_control(
637 'embedpress_pro_wistia_player_options',
638 [
639 'label' => __( 'Player Options', 'embedpress' ),
640 'type' => Controls_Manager::HEADING,
641 'separator' => 'before',
642 'condition' => [
643 'embedpress_pro_embeded_source' => 'wistia'
644 ]
645 ]
646 );
647
648
649
650 $this->add_control(
651 'embedpress_pro_wistia_fullscreen_button',
652 [
653 'label' => __( 'Fullscreen Button', 'embedpress' ),
654 'type' => Controls_Manager::SWITCHER,
655 'label_block' => false,
656 'return_value' => 'yes',
657 'default' => 'no',
658 'condition' => [
659 'embedpress_pro_embeded_source' => 'wistia'
660 ],
661 ]
662 );
663
664 $this->add_control(
665 'embedpress_pro_wistia_small_play_button',
666 [
667 'label' => __( 'Small Play Button', 'embedpress' ),
668 'type' => Controls_Manager::SWITCHER,
669 'label_block' => false,
670 'return_value' => 'yes',
671 'default' => 'no',
672 'condition' => [
673 'embedpress_pro_embeded_source' => 'wistia'
674 ],
675 ]
676 );
677
678
679
680
681 $this->add_control(
682 'embedpress_pro_wistia_resumable',
683 [
684 'label' => __( 'Resumable', 'embedpress' ),
685 'type' => Controls_Manager::SWITCHER,
686 'label_block' => false,
687 'return_value' => 'yes',
688 'default' => 'no',
689 'condition' => [
690 'embedpress_pro_embeded_source' => 'wistia'
691 ],
692 ]
693 );
694
695
696 $this->add_control(
697 'embedpress_pro_wistia_focus',
698 [
699 'label' => __( 'Focus', 'embedpress' ),
700 'type' => Controls_Manager::SWITCHER,
701 'label_block' => false,
702 'return_value' => 'yes',
703 'default' => 'no',
704 'condition' => [
705 'embedpress_pro_embeded_source' => 'wistia'
706 ],
707 ]
708 );
709
710 // --- Wistia PRO Controls --
711 $this->add_control(
712 'embedpress_pro_wistia_captions',
713 [
714 'label' => sprintf(__( 'Captions %s', 'embedpress' ), $this->pro_text ),
715 'type' => Controls_Manager::SWITCHER,
716 'label_block' => false,
717 'return_value' => 'yes',
718 'default' => 'no',
719 'condition' => [
720 'embedpress_pro_embeded_source' => 'wistia'
721 ],
722 'classes' => $this->pro_class,
723 ]
724 );
725 $this->add_control(
726 'embedpress_pro_wistia_playbar',
727 [
728 'label' => __( 'Playbar ', 'embedpress' ),
729 'type' => Controls_Manager::SWITCHER,
730 'label_block' => false,
731 'return_value' => 'yes',
732 'default' => 'no',
733 'condition' => [
734 'embedpress_pro_embeded_source' => 'wistia'
735 ],
736 ]
737 );
738
739 $this->add_control(
740 'embedpress_pro_wistia_volume_control',
741 [
742 'label' => sprintf(__( 'Volume Control %s', 'embedpress' ), $this->pro_text ),
743 'type' => Controls_Manager::SWITCHER,
744 'label_block' => false,
745 'return_value' => 'yes',
746 'default' => 'yes',
747 'condition' => [
748 'embedpress_pro_embeded_source' => 'wistia'
749 ],
750 'classes' => $this->pro_class,
751 ]
752 );
753
754
755 $this->add_control(
756 'embedpress_pro_wistia_volume',
757 [
758 'label' => sprintf(__( 'Volume %s', 'embedpress' ), $this->pro_text ),
759 'type' => Controls_Manager::SLIDER,
760 'default' => [
761 'size' => 100,
762 ],
763 'range' => [
764 'px' => [
765 'min' => 0,
766 'max' => 100,
767 ]
768 ],
769 'condition' => [
770 'embedpress_pro_embeded_source' => 'wistia',
771 'embedpress_pro_wistia_volume_control' => 'yes'
772 ],
773 'classes' => $this->pro_class,
774 ]
775 );
776
777 $this->add_control(
778 'embedpress_pro_wistia_rewind',
779 [
780 'label' => __( 'Rewind', 'embedpress' ),
781 'type' => Controls_Manager::SWITCHER,
782 'label_block' => false,
783 'return_value' => 'yes',
784 'default' => 'no',
785 'condition' => [
786 'embedpress_pro_embeded_source' => 'wistia'
787 ],
788 ]
789 );
790
791 $this->add_control(
792 'embedpress_pro_wistia_rewind_time',
793 [
794 'label' => __( 'Rewind time', 'embedpress' ),
795 'type' => Controls_Manager::SLIDER,
796 'default' => [
797 'size' => 10,
798 ],
799 'range' => [
800 'px' => [
801 'min' => 1,
802 'max' => 100,
803 ]
804 ],
805 'condition' => [
806 'embedpress_pro_wistia_rewind' => 'yes',
807 'embedpress_pro_embeded_source' => 'wistia'
808 ],
809 ]
810 );
811 $this->init_branding_controls( 'wistia');
812
813 }
814 public function init_twitch_control( ) {
815 $condition = [
816 'embedpress_pro_embeded_source' => 'twitch'
817 ];
818 $this->add_control(
819 'embedpress_pro_twitch_autoplay',
820 [
821 'label' => __( 'Autoplay', 'embedpress' ),
822 'type' => Controls_Manager::SWITCHER,
823 'label_off' => __( 'No', 'embedpress' ),
824 'label_on' => __( 'Yes', 'embedpress' ),
825 'default' => 'yes',
826 'condition' => $condition,
827 ]
828 );
829 $this->add_control(
830 'embedpress_pro_fs',
831 [
832 'label' => __( 'Allow Full Screen Video', 'embedpress' ),
833 'type' => Controls_Manager::SWITCHER,
834 'label_off' => __( 'No', 'embedpress' ),
835 'label_on' => __( 'Yes', 'embedpress' ),
836 'default' => 'yes',
837 'condition' => $condition,
838 ]
839 );
840
841 // -- Twitch PRO controls --
842 $this->add_control(
843 'embedpress_pro_twitch_chat',
844 [
845 'label' => sprintf(__( 'Show Chat %s', 'embedpress' ), $this->pro_text ),
846 'type' => Controls_Manager::SWITCHER,
847 'label_off' => __( 'Hide', 'embedpress' ),
848 'label_on' => __( 'Show', 'embedpress' ),
849 'condition' => $condition,
850 'classes' => $this->pro_class,
851
852 ]
853 );
854 $this->add_control(
855 'embedpress_pro_twitch_mute',
856 [
857 'label' => __( 'Mute on start', 'embedpress' ),
858 'type' => Controls_Manager::SWITCHER,
859 'label_off' => __( 'Hide', 'embedpress' ),
860 'label_on' => __( 'Show', 'embedpress' ),
861 'condition' => $condition,
862 ]
863 );
864 $this->add_control(
865 'embedpress_pro_twitch_theme',
866 [
867 'label' => __( 'Theme', 'embedpress' ),
868 'type' => Controls_Manager::SELECT,
869 'default' => 'dark',
870 'options' => [
871 'dark' => __( 'Dark', 'embedpress' ),
872 'light' => __( 'Light', 'embedpress' ),
873 ],
874 'condition' => $condition,
875 ]
876 );
877
878 $this->init_branding_controls( 'twitch');
879
880 }
881 public function init_soundcloud_controls( ) {
882 $this->add_control(
883 'embedpress_pro_soundcloud_visual',
884 [
885 'label' => __( 'Visual Player', 'embedpress' ),
886 'type' => Controls_Manager::SWITCHER,
887 'label_block' => false,
888 'return_value' => 'yes',
889 'default' => 'no',
890 'label_off' => __( 'Hide', 'embedpress' ),
891 'label_on' => __( 'Show', 'embedpress' ),
892 'condition' => [
893 'embedpress_pro_embeded_source' => 'soundcloud'
894 ],
895 ]
896 );
897
898 $this->add_control(
899 'embedpress_pro_soundcloud_color',
900 [
901 'label' => __( 'Scheme', 'embedpress' ),
902 'type' => Controls_Manager::COLOR,
903 'label_block' => false,
904 'default' => '#FF5500',
905 'condition' => [
906 'embedpress_pro_embeded_source' => 'soundcloud'
907 ]
908 ]
909 );
910
911 $this->add_control(
912 'embedpress_pro_soundcloud_autoplay',
913 [
914 'label' => __( 'Auto Play', 'embedpress' ),
915 'type' => Controls_Manager::SWITCHER,
916 'label_block' => false,
917 'return_value' => 'yes',
918 'default' => 'no',
919 'label_off' => __( 'Hide', 'embedpress' ),
920 'label_on' => __( 'Show', 'embedpress' ),
921 'condition' => [
922 'embedpress_pro_embeded_source' => 'soundcloud'
923 ],
924 ]
925 );
926
927
928
929 $this->add_control(
930 'embedpress_pro_soundcloud_share_button',
931 [
932 'label' => __( 'Share Button', 'embedpress' ),
933 'type' => Controls_Manager::SWITCHER,
934 'label_block' => false,
935 'return_value' => 'yes',
936 'default' => 'yes',
937 'label_off' => __( 'Hide', 'embedpress' ),
938 'label_on' => __( 'Show', 'embedpress' ),
939 'condition' => [
940 'embedpress_pro_embeded_source' => 'soundcloud'
941 ],
942 ]
943 );
944
945 $this->add_control(
946 'embedpress_pro_soundcloud_comments',
947 [
948 'label' => __( 'Comments', 'embedpress' ),
949 'type' => Controls_Manager::SWITCHER,
950 'label_block' => false,
951 'return_value' => 'yes',
952 'default' => 'yes',
953 'label_off' => __( 'Hide', 'embedpress' ),
954 'label_on' => __( 'Show', 'embedpress' ),
955 'condition' => [
956 'embedpress_pro_embeded_source' => 'soundcloud'
957 ],
958 ]
959 );
960
961
962
963 $this->add_control(
964 'embedpress_pro_soundcloud_artwork',
965 [
966 'label' => __( 'Artwork', 'embedpress' ),
967 'type' => Controls_Manager::SWITCHER,
968 'label_block' => false,
969 'return_value' => 'yes',
970 'default' => 'yes',
971 'label_off' => __( 'Hide', 'embedpress' ),
972 'label_on' => __( 'Show', 'embedpress' ),
973 'condition' => [
974 'embedpress_pro_embeded_source' => 'soundcloud',
975 'embedpress_pro_soundcloud_visual!' => 'yes'
976 ]
977 ]
978 );
979
980 $this->add_control(
981 'embedpress_pro_soundcloud_play_count',
982 [
983 'label' => __( 'Play Count', 'embedpress' ),
984 'type' => Controls_Manager::SWITCHER,
985 'label_block' => false,
986 'return_value' => 'yes',
987 'default' => 'yes',
988 'label_off' => __( 'Hide', 'embedpress' ),
989 'label_on' => __( 'Show', 'embedpress' ),
990 'condition' => [
991 'embedpress_pro_embeded_source' => 'soundcloud',
992 'embedpress_pro_soundcloud_visual!' => 'yes'
993 ],
994 ]
995 );
996
997 $this->add_control(
998 'embedpress_pro_soundcloud_user_name',
999 [
1000 'label' => __( 'User Name', 'embedpress' ),
1001 'type' => Controls_Manager::SWITCHER,
1002 'label_block' => false,
1003 'return_value' => 'yes',
1004 'default' => 'yes',
1005 'label_off' => __( 'Hide', 'embedpress' ),
1006 'label_on' => __( 'Show', 'embedpress' ),
1007 'condition' => [
1008 'embedpress_pro_embeded_source' => 'soundcloud'
1009 ],
1010 ]
1011 );
1012
1013 $this->add_control(
1014 'embedpress_pro_soundcloud_buy_button',
1015 [
1016 'label' => sprintf(__( 'Buy Button %s', 'embedpress' ), $this->pro_text ),
1017 'type' => Controls_Manager::SWITCHER,
1018 'label_block' => false,
1019 'return_value' => 'yes',
1020 'default' => 'yes',
1021 'label_off' => __( 'Hide', 'embedpress' ),
1022 'label_on' => __( 'Show', 'embedpress' ),
1023 'condition' => [
1024 'embedpress_pro_embeded_source' => 'soundcloud'
1025 ],
1026 'classes' => $this->pro_class,
1027 ]
1028 );
1029 $this->add_control(
1030 'embedpress_pro_soundcloud_download_button',
1031 [
1032 'label' => sprintf(__( 'Download Button %s', 'embedpress' ), $this->pro_text ),
1033 'type' => Controls_Manager::SWITCHER,
1034 'label_block' => false,
1035 'return_value' => 'yes',
1036 'default' => 'yes',
1037 'label_off' => __( 'Hide', 'embedpress' ),
1038 'label_on' => __( 'Show', 'embedpress' ),
1039 'condition' => [
1040 'embedpress_pro_embeded_source' => 'soundcloud'
1041 ],
1042 'classes' => $this->pro_class,
1043 ]
1044 );
1045 }
1046 public function init_vimeo_controls( ) {
1047 $this->add_control(
1048 'embedpress_pro_vimeo_auto_play',
1049 [
1050 'label' => __( 'Auto Play', 'embedpress' ),
1051 'type' => Controls_Manager::SWITCHER,
1052 'label_block' => false,
1053 'return_value' => 'yes',
1054 'default' => 'no',
1055 'condition' => [
1056 'embedpress_pro_embeded_source' => 'vimeo'
1057 ]
1058 ]
1059 );
1060
1061
1062 $this->add_control(
1063 'embedpress_pro_vimeo_color',
1064 [
1065 'label' => __( 'Scheme', 'embedpress' ),
1066 'type' => Controls_Manager::COLOR,
1067 'label_block' => false,
1068 'default' => '#00adef',
1069 'condition' => [
1070 'embedpress_pro_embeded_source' => 'vimeo'
1071 ]
1072 ]
1073 );
1074
1075 $this->add_control(
1076 'embedpress_pro_vimeo_author_options',
1077 [
1078 'label' => __( 'Author Information', 'embedpress' ),
1079 'type' => Controls_Manager::HEADING,
1080 'separator' => 'before',
1081 'condition' => [
1082 'embedpress_pro_embeded_source' => 'vimeo'
1083 ]
1084 ]
1085 );
1086
1087 $this->add_control(
1088 'embedpress_pro_vimeo_display_title',
1089 [
1090 'label' => __( 'Title', 'embedpress' ),
1091 'type' => Controls_Manager::SWITCHER,
1092 'label_block' => false,
1093 'return_value' => 'yes',
1094 'default' => 'yes',
1095 'condition' => [
1096 'embedpress_pro_embeded_source' => 'vimeo'
1097 ]
1098 ]
1099 );
1100
1101 //----- Vimeo PRO controls
1102
1103 $this->add_control(
1104 'embedpress_pro_vimeo_display_author',
1105 [
1106 'label' => __( 'Author', 'embedpress' ),
1107 'type' => Controls_Manager::SWITCHER,
1108 'label_block' => false,
1109 'return_value' => 'yes',
1110 'default' => 'yes',
1111 'condition' => [
1112 'embedpress_pro_embeded_source' => 'vimeo'
1113 ],
1114 ]
1115 );
1116
1117 $this->add_control(
1118 'embedpress_pro_vimeo_avatar',
1119 [
1120 'label' => __( 'Avatar', 'embedpress' ),
1121 'type' => Controls_Manager::SWITCHER,
1122 'label_block' => false,
1123 'return_value' => 'yes',
1124 'default' => 'yes',
1125 'condition' => [
1126 'embedpress_pro_embeded_source' => 'vimeo'
1127 ],
1128 ]
1129 );
1130
1131 $this->add_control(
1132 'embedpress_pro_vimeo_loop',
1133 [
1134 'label' => sprintf(__( 'Loop %s', 'embedpress' ), $this->pro_text ),
1135 'type' => Controls_Manager::SWITCHER,
1136 'label_block' => false,
1137 'return_value' => 'yes',
1138 'default' => 'no',
1139 'condition' => [
1140 'embedpress_pro_embeded_source' => 'vimeo'
1141 ],
1142 'classes' => $this->pro_class,
1143 ]
1144 );
1145
1146 $this->add_control(
1147 'embedpress_pro_vimeo_autopause',
1148 [
1149 'label' => sprintf(__( 'Auto Pause %s', 'embedpress' ), $this->pro_text ),
1150 'type' => Controls_Manager::SWITCHER,
1151 'label_block' => false,
1152 'return_value' => 'yes',
1153 'default' => 'no',
1154 'condition' => [
1155 'embedpress_pro_embeded_source' => 'vimeo'
1156 ],
1157 'classes' => $this->pro_class,
1158 ]
1159 );
1160
1161 $this->add_control(
1162 'embedpress_pro_vimeo_dnt',
1163 [
1164 'label' => sprintf(__( 'DNT %s', 'embedpress' ), $this->pro_text ),
1165 'type' => Controls_Manager::SWITCHER,
1166 'label_block' => false,
1167 'return_value' => 'yes',
1168 'default' => 'yes',
1169 'description' => __( 'Set this parameter to "yes" will block the player from tracking any session data, including all cookies',
1170 'embedpress' ),
1171 'condition' => [
1172 'embedpress_pro_embeded_source' => 'vimeo'
1173 ],
1174 'classes' => $this->pro_class,
1175 ]
1176 );
1177
1178
1179 $this->init_branding_controls( 'vimeo');
1180
1181 }
1182 public function init_spotify_controls() {
1183 $condition = [
1184 'embedpress_pro_embeded_source' => 'spotify'
1185 ];
1186
1187
1188 $this->add_control(
1189 'spotify_theme',
1190 [
1191 'label' => __( 'Player Background', 'embedpress' ),
1192 'description' => __( 'Dynamic option will use the most vibrant color from the album art.', 'embedpress' ),
1193 'type' => Controls_Manager::SELECT,
1194 'label_block' => false,
1195 'default' => '1',
1196 'options' => [
1197 '1' => __( 'Dynamic', 'embedpress' ),
1198 '0' => __( 'Black & White', 'embedpress' )
1199 ],
1200 'condition' => $condition
1201 ]
1202 );
1203 }
1204
1205 public function init_style_controls() {
1206 $this->start_controls_section(
1207 'embedpress_style_section',
1208 [
1209 'label' => __( 'Style', 'embedpress' ),
1210 'tab' => Controls_Manager::TAB_STYLE,
1211 ]
1212 );
1213 //$this->add_control(
1214 // 'embedpress_elementor_aspect_ratio',
1215 // [
1216 // 'label' => __( 'Aspect Ratio', 'embedpress' ),
1217 // 'description' => __( 'Good for any video. You may turn it off for other embed type.', 'embedpress' ),
1218 // 'type' => Controls_Manager::SELECT,
1219 // 'options' => [
1220 // 0 => __('None'),
1221 // '169' => '16:9',
1222 // '219' => '21:9',
1223 // '43' => '4:3',
1224 // '32' => '3:2',
1225 // '11' => '1:1',
1226 // '916' => '9:16',
1227 // ],
1228 // 'default' => 0,
1229 // 'prefix_class' => 'embedpress-aspect-ratio-',
1230 // 'frontend_available' => true,
1231 // ]
1232 //);
1233 $this->add_control(
1234 'width',
1235 [
1236 'label' => __( 'Width', 'embedpress' ),
1237 'type' => Controls_Manager::SLIDER,
1238 'size_units' => [ 'px' ],
1239 'range' => [
1240 'px' => [
1241 'min' => 0,
1242 'max' => 1500,
1243 'step' => 5,
1244 ],
1245 ],
1246 'default' => [
1247 'unit' => 'px',
1248 'size' => 600,
1249 ]
1250 ]
1251 );
1252 $this->add_control(
1253 'height',
1254 [
1255 'label' => __( 'Height', 'embedpress' ),
1256 'type' => Controls_Manager::SLIDER,
1257 'size_units' => [ 'px' ],
1258 'range' => [
1259 'px' => [
1260 'min' => 0,
1261 'max' => 1500,
1262 'step' => 5,
1263 ],
1264 ],
1265 'default' => [
1266 'unit' => 'px',
1267 'size' => 400,
1268 ]
1269 ]
1270 );
1271 $this->add_responsive_control(
1272 'margin',
1273 [
1274 'label' => __( 'Margin', 'embedpress' ),
1275 'type' => Controls_Manager::DIMENSIONS,
1276 'size_units' => [ 'px', '%', 'em' ],
1277 'selectors' => [
1278 '{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1279 ],
1280 ]
1281 );
1282 $this->add_responsive_control(
1283 'padding',
1284 [
1285 'label' => __( 'Padding', 'embedpress' ),
1286 'type' => Controls_Manager::DIMENSIONS,
1287 'size_units' => [ 'px', '%', 'em' ],
1288 'selectors' => [
1289 '{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1290 ],
1291 ]
1292 );
1293 $this->add_responsive_control(
1294 'align',
1295 [
1296 'label' => esc_html__( 'Alignment', 'embedpress' ),
1297 'type' => Controls_Manager::CHOOSE,
1298 'options' => [
1299 'left' => [
1300 'title' => esc_html__( 'Left', 'embedpress' ),
1301 'icon' => 'eicon-text-align-left',
1302 ],
1303 'center' => [
1304 'title' => esc_html__( 'Center', 'embedpress' ),
1305 'icon' => 'eicon-text-align-center',
1306 ],
1307 'right' => [
1308 'title' => esc_html__( 'Right', 'embedpress' ),
1309 'icon' => 'eicon-text-align-right',
1310 ],
1311 ],
1312 'prefix_class' => 'elementor%s-align-',
1313 'default' => '',
1314 ]
1315 );
1316 $this->end_controls_section();
1317 }
1318
1319 public function render_plain_content() {
1320 $args = "";
1321 $settings = $this->get_settings_for_display();
1322
1323 if(!empty( $settings['height']['size'] )){
1324 $args .= "height='{$settings['height']['size']}' ";
1325 }
1326 if(!empty( $settings['width']['size'] )){
1327 $args .= "width='{$settings['width']['size']}' ";
1328 }
1329 if(!empty( $settings['pagesize'] )){
1330 $args .= "pagesize='{$settings['pagesize']}' ";
1331 }
1332 $args = trim($args);
1333 echo "[embedpress $args]{$settings['embedpress_embeded_link']}\[/embedpress]";
1334 }
1335
1336 protected function render() {
1337 add_filter( 'embedpress_should_modify_spotify', '__return_false');
1338 $settings = $this->get_settings_for_display();
1339 $is_editor_view = Plugin::$instance->editor->is_edit_mode();
1340 $link = $settings['embedpress_embeded_link'];
1341 $is_apple_podcast = (strpos( $link, 'podcasts.apple.com') !== false);
1342 $height = (!empty( $settings['height']) && !empty( $settings['height']['size'] ))
1343 ? $settings['height']['size'] : null;
1344 $width = (!empty( $settings['width']) && !empty( $settings['width']['size'] ))
1345 ? $settings['width']['size'] : null;
1346 $pagesize = (!empty( $settings['pagesize']) && !empty( $settings['pagesize'] ))
1347 ? $settings['pagesize'] : 6;
1348
1349 $embed_content = Shortcode::parseContent( $settings['embedpress_embeded_link'], true, [ 'height'=> $height, 'width'=>$width, 'pagesize'=>$pagesize ] );
1350 $embed_content = $this->onAfterEmbedSpotify($embed_content, $settings);
1351 $embed = apply_filters( 'embedpress_elementor_embed', $embed_content, $settings );
1352 $content = is_object( $embed ) ? $embed->embed : $embed;
1353
1354 ?>
1355 <div class="embedpress-elements-wrapper <?php echo !empty( $settings['embedpress_elementor_aspect_ratio']) ? 'embedpress-fit-aspect-ratio': ''; ?>">
1356 <?php
1357 // handle notice display
1358 if ( $is_editor_view && $is_apple_podcast && !is_embedpress_pro_active() ) {
1359 ?>
1360 <p><?php esc_html_e( 'You need EmbedPress Pro to Embed Apple Podcast. Note. This message is only visible to you.', 'embedpress'); ?></p>
1361 <?php
1362 }else {
1363 echo $content;
1364 }
1365 ?>
1366 </div>
1367 <?php
1368 }
1369 public function onAfterEmbedSpotify( $embed, $setting ) {
1370 if ( !isset( $embed->provider_name ) || strtolower( $embed->provider_name ) !== 'spotify' || !isset( $embed->embed ) ) {
1371 return $embed;
1372 }
1373 preg_match( '/src=\"(.+?)\"/', $embed->embed, $match );
1374 $url_full = $match[ 1 ];
1375 $modified_url = str_replace( 'playlist-v2', 'playlist', $url_full);
1376 // apply elementor related mod
1377 if(isset( $setting['spotify_theme'])){
1378 if ( strpos( $modified_url, '?') !== false ) {
1379 $modified_url .= '&theme='.sanitize_text_field( $setting['spotify_theme']);
1380 }else{
1381 $modified_url .= '?theme='.sanitize_text_field( $setting['spotify_theme']);
1382 }
1383 }
1384
1385
1386 $embed->embed = str_replace( $url_full, $modified_url, $embed->embed );
1387 return $embed;
1388 }
1389 }
1390