PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents / 3.9.6
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents v3.9.6
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 3 years ago Embedpress_Document.php 2 years ago Embedpress_Elementor.php 2 years ago Embedpress_Pdf.php 2 years ago
Embedpress_Elementor.php
3147 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\Classes\Helper;
11 use EmbedPress\Includes\Traits\Branding;
12 use EmbedPress\Shortcode;
13
14 (defined('ABSPATH')) or die("No direct script access allowed.");
15
16 class Embedpress_Elementor extends Widget_Base
17 {
18
19 use Branding;
20 protected $pro_class = '';
21 protected $pro_text = '';
22 public function get_name()
23 {
24 return 'embedpres_elementor';
25 }
26
27 public function get_title()
28 {
29 return esc_html__('EmbedPress', 'embedpress');
30 }
31
32 public function get_categories()
33 {
34 return ['embedpress'];
35 }
36
37 public function get_custom_help_url()
38 {
39 return 'https://embedpress.com/documentation';
40 }
41
42 public function get_icon()
43 {
44 return 'icon-embedpress';
45 }
46
47 /**
48 * Get widget keywords.
49 *
50 * Retrieve the list of keywords the widget belongs to.
51 *
52 * @return array Widget keywords.
53 * @since 2.4.1
54 * @access public
55 *
56 */
57 public function get_keywords()
58 {
59 return [
60 'embedpress',
61 'audio',
62 'video',
63 'map',
64 'youtube',
65 'vimeo',
66 'wistia',
67 'twitch',
68 'soundcloud',
69 'giphy gifs',
70 'spotify',
71 'smugmug',
72 'meetup',
73 'apple',
74 'apple podcast',
75 'podcast',
76 'dailymotion',
77 'instagram',
78 'slideshare',
79 'flickr',
80 'ted',
81 'google docs',
82 'google slides',
83 'google drawings'
84 ];
85 }
86
87 protected function register_controls()
88 {
89 $this->pro_class = is_embedpress_pro_active() ? '' : 'embedpress-pro-control not-active';
90 $this->pro_text = is_embedpress_pro_active() ? '' : '<sup class="embedpress-pro-label" style="color:red">' . __('Pro', 'embedpress') . '</sup>';
91 /**
92 * EmbedPress General Settings
93 */
94 $this->start_controls_section(
95 'embedpress_elementor_content_settings',
96 [
97 'label' => esc_html__('General', 'embedpress'),
98 ]
99 );
100
101 do_action('embedpress/embeded/extend', $this);
102 $this->add_control(
103 'embedpress_pro_embeded_source',
104 [
105 'label' => __('Source Name', 'embedpress'),
106 'type' => Controls_Manager::SELECT2,
107 'label_block' => false,
108 'default' => 'default',
109 'options' => [
110 'default' => __('Default', 'embedpress'),
111 'youtube' => __('YouTube', 'embedpress'),
112 'vimeo' => __('Vimeo', 'embedpress'),
113 'dailymotion' => __('Dailymotion', 'embedpress'),
114 'wistia' => __('Wistia', 'embedpress'),
115 'twitch' => __('Twitch', 'embedpress'),
116 'soundcloud' => __('SoundCloud', 'embedpress'),
117 'opensea' => __('OpenSea', 'embedpress'),
118 'calendly' => __('Calendly', 'embedpress'),
119 'selfhosted_video' => __('Self-hosted Video', 'embedpress'),
120 'selfhosted_audio' => __('Self-hosted Audio', 'embedpress'),
121 ]
122 ]
123 );
124
125 $this->add_control(
126 'embedpress_pro_embeded_nft_type',
127 [
128 'label' => __('Type', 'embedpress'),
129 'type' => Controls_Manager::SELECT,
130 'label_block' => false,
131 'default' => 'collection',
132 'options' => [
133 'collection' => __('Assets Collection', 'embedpress'),
134 'single' => __('Single Asset', 'embedpress'),
135 ],
136 'condition' => [
137 'embedpress_pro_embeded_source' => 'opensea'
138 ]
139 ]
140 );
141
142 $this->add_control(
143 'embedpress_embeded_link',
144 [
145
146 'label' => __('Embedded Link', 'embedpress'),
147 'type' => Controls_Manager::TEXT,
148 'dynamic' => [
149 'active' => true,
150 ],
151 'placeholder' => __('Enter your Link', 'embedpress'),
152 'label_block' => true,
153 'ai' => [
154 'active' => false,
155 ],
156
157 ]
158 );
159
160 $this->add_control(
161 'spotify_theme',
162 [
163 'label' => __('Player Background', 'embedpress'),
164 'description' => __('Dynamic option will use the most vibrant color from the album art.', 'embedpress'),
165 'type' => Controls_Manager::SELECT,
166 'label_block' => false,
167 'default' => '1',
168 'options' => [
169 '1' => __('Dynamic', 'embedpress'),
170 '0' => __('Black & White', 'embedpress')
171 ],
172 'condition' => [
173 'embedpress_pro_embeded_source' => 'spotify'
174 ]
175 ]
176 );
177 do_action('embedpress/control/extend', $this);
178
179 $this->add_control(
180 'emberpress_custom_player',
181 [
182 'label' => __('Enable Custom Player', 'embedpress'),
183 'type' => Controls_Manager::SWITCHER,
184 'label_block' => false,
185 'return_value' => 'yes',
186 'default' => '',
187 'condition' => [
188 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'selfhosted_video', 'selfhosted_audio']
189 ],
190 ]
191 );
192
193 $this->add_control(
194 'custom_player_important_note',
195 [
196 'type' => \Elementor\Controls_Manager::RAW_HTML,
197 'raw' => esc_html__('Custom player take effect only when a single video is embedded.', 'embedpress'),
198 'content_classes' => 'elementor-panel-alert elementor-panel-warning-info',
199 'condition' => [
200 'emberpress_custom_player' => 'yes',
201 'embedpress_pro_embeded_source' => 'youtube',
202 ],
203 ]
204 );
205
206 $this->add_control(
207 'custom_payer_preset',
208 [
209 'label' => sprintf(__('Preset %s', 'embedpress'), $this->pro_text),
210
211 'type' => Controls_Manager::SELECT,
212 'label_block' => false,
213 'default' => 'default',
214 'options' => [
215 'default' => __('Default', 'embedpress'),
216 'custom-player-preset-1' => __('Preset 1', 'embedpress'),
217 // 'custom-player-preset-2' => __('Preset 2', 'embedpress'),
218 'custom-player-preset-3' => __('Preset 2', 'embedpress'),
219 // 'custom-player-preset-4' => __('Preset 4', 'embedpress'),
220 ],
221 'classes' => $this->pro_class,
222 'condition' => [
223 'emberpress_custom_player' => 'yes',
224 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'selfhosted_video']
225 ],
226 ]
227 );
228
229 $this->add_control(
230 'embedpress_pro_video_start_time',
231 [
232 'label' => __('Start Time', 'embedpress'),
233 'type' => Controls_Manager::NUMBER,
234 'description' => __('Specify a start time (in seconds)', 'embedpress'),
235 'condition' => [
236 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'wistia', 'dailymotion', 'twitch']
237 ],
238 ]
239 );
240
241
242
243
244 /**
245 * Initialized controls
246 */
247 $this->init_youtube_controls();
248 $this->init_vimeo_controls();
249
250 $this->init_wistia_controls();
251 $this->init_soundcloud_controls();
252 $this->init_dailymotion_control();
253 $this->init_twitch_control();
254 $this->init_opensea_control();
255 $this->end_controls_section();
256
257
258 $this->init_youtube_channel_section();
259 $this->init_youtube_subscription_section();
260 $this->init_youtube_livechat_section();
261
262
263 /**
264 * Opensea Control section
265 */
266 $this->init_opensea_control_section();
267
268 /**
269 * Calendly Control section
270 */
271 $this->init_calendly_control_section();
272
273
274 do_action('extend_elementor_controls', $this, '_', $this->pro_text, $this->pro_class);
275
276 if (!is_embedpress_pro_active()) {
277 $this->start_controls_section(
278 'embedpress_pro_section',
279 [
280 'label' => __('Go Premium for More Features', 'embedpress'),
281 ]
282 );
283
284 $this->add_control(
285 'embedpress_pro_cta',
286 [
287 'label' => __('Unlock more possibilities', 'embedpress'),
288 'type' => Controls_Manager::CHOOSE,
289 'options' => [
290 '1' => [
291 'title' => '',
292 'icon' => 'eicon-lock',
293 ],
294 ],
295 'default' => '1',
296 '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>',
297 ]
298 );
299
300 $this->end_controls_section();
301 }
302
303 $this->init_style_controls();
304 $this->init_opensea_color_and_typography();
305 }
306
307 /**
308 * Youtube Controls
309 */
310
311 public function init_youtube_controls()
312 {
313 $yt_condition = [
314 'embedpress_pro_embeded_source' => 'youtube'
315 ];
316 $this->add_control(
317 'embedpress_pro_youtube_end_time',
318 [
319 'label' => __('End Time', 'embedpress'),
320 'type' => Controls_Manager::NUMBER,
321 'description' => __('Specify an end time (in seconds)', 'embedpress'),
322 'condition' => $yt_condition,
323 ]
324 );
325
326
327 $this->add_control(
328 'embedpress_player_color',
329 [
330 'label' => sprintf(__('Player Color %s', 'embedpress'), $this->pro_text),
331 'type' => Controls_Manager::COLOR,
332 'label_block' => false,
333 'classes' => $this->pro_class,
334 'default' => '#5b4e96',
335 'condition' => [
336 'emberpress_custom_player' => 'yes',
337 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'selfhosted_video', 'selfhosted_audio']
338 ],
339 ]
340 );
341
342 $this->add_control(
343 'embedpress_pro_vimeo_auto_play',
344 [
345 'label' => __('Auto Play', 'embedpress'),
346 'type' => Controls_Manager::SWITCHER,
347 'label_block' => false,
348 'return_value' => 'yes',
349 'default' => 'no',
350 'condition' => [
351 'embedpress_pro_embeded_source' => 'vimeo'
352 ]
353 ]
354 );
355
356 $this->add_control(
357 'embedpress_pro_vimeo_autopause',
358 [
359 'label' => sprintf(__('Auto Pause %s', 'embedpress'), $this->pro_text),
360 'type' => Controls_Manager::SWITCHER,
361 'label_block' => false,
362 'return_value' => 'yes',
363 'default' => 'no',
364 'description' => __(
365 'Automatically stop the current video from playing when another one starts.',
366 'embedpress'
367 ),
368 'condition' => [
369 'embedpress_pro_embeded_source' => 'vimeo'
370 ],
371 'classes' => $this->pro_class,
372 ]
373 );
374
375 $this->add_control(
376 'embedpress_pro_vimeo_dnt',
377 [
378 'label' => sprintf(__('DNT %s', 'embedpress'), $this->pro_text),
379 'type' => Controls_Manager::SWITCHER,
380 'label_block' => false,
381 'return_value' => 'yes',
382 'default' => 'yes',
383 'description' => __(
384 'Set this parameter to "yes" will block tracking any session data, including cookies. If Auto Pause is enabled this will not work.',
385 'embedpress'
386 ),
387 'condition' => [
388 'embedpress_pro_embeded_source' => 'vimeo'
389 ],
390 'classes' => $this->pro_class,
391 ]
392 );
393
394
395 $this->add_control(
396 'embedpress_pro_youtube_auto_play',
397 [
398 'label' => __('Auto Play', 'embedpress'),
399 'type' => Controls_Manager::SWITCHER,
400 'label_block' => false,
401 'return_value' => 'yes',
402 'default' => 'no',
403 'condition' => $yt_condition,
404 ]
405 );
406 $this->add_control(
407 'embedpress_pro_youtube_player_options',
408 [
409 'label' => __('Player Options', 'embedpress'),
410 'type' => Controls_Manager::HEADING,
411 'condition' => [
412 'embedpress_pro_embeded_source' => 'youtube',
413 'emberpress_custom_player!' => 'yes'
414 ],
415 ]
416 );
417 $this->add_control(
418 'embedpress_pro_youtube_display_controls',
419 [
420 'label' => __('Controls', 'embedpress'),
421 'type' => Controls_Manager::SELECT,
422 'label_block' => false,
423 'default' => 1,
424 'options' => [
425 '1' => __('Display immediately', 'embedpress'),
426 '2' => __('Display after user initiation', 'embedpress'),
427 '0' => __('Hide controls', 'embedpress')
428 ],
429 'condition' => [
430 'embedpress_pro_embeded_source' => 'youtube',
431 'emberpress_custom_player!' => 'yes'
432 ],
433 ]
434 );
435 $this->add_control(
436 'embedpress_pro_youtube_enable_fullscreen_button',
437 [
438 'label' => __('Fullscreen button', 'embedpress'),
439 'type' => Controls_Manager::SWITCHER,
440 'label_block' => false,
441 'return_value' => 'yes',
442 'default' => 'yes',
443 'condition' => [
444 'embedpress_pro_embeded_source' => ['youtube', 'vimeo'],
445 'embedpress_pro_youtube_display_controls!' => '0'
446 ]
447 ]
448 );
449 $this->add_control(
450 'embedpress_pro_youtube_display_video_annotations',
451 [
452 'label' => __('Video Annotations', 'embedpress'),
453 'type' => Controls_Manager::SWITCHER,
454 'label_block' => false,
455 'default' => 1,
456 'options' => [
457 '1' => __('Display', 'embedpress'),
458 '3' => __('Do Not Display', 'embedpress')
459 ],
460 'condition' => [
461 'embedpress_pro_embeded_source' => 'youtube',
462 'emberpress_custom_player!' => 'yes'
463 ],
464 ]
465 );
466 //--- YouTube Pro control starts ---
467 $this->add_control(
468 'embedpress_pro_youtube_progress_bar_color',
469 [
470 'label' => __('Progress Bar Color', 'embedpress'),
471 'type' => Controls_Manager::SELECT,
472 'label_block' => false,
473 'default' => 'red',
474 'options' => [
475 'red' => __('Red', 'embedpress'),
476 'white' => __('White', 'embedpress')
477 ],
478 'condition' => [
479 'embedpress_pro_embeded_source' => 'youtube',
480 'emberpress_custom_player!' => 'yes'
481 ],
482 ]
483 );
484 $this->add_control(
485 'embedpress_pro_youtube_force_closed_captions',
486 [
487 'label' => sprintf(__('Closed Captions %s', 'embedpress'), $this->pro_text),
488 'type' => Controls_Manager::SWITCHER,
489 'label_block' => false,
490 'return_value' => 'yes',
491 'default' => 'no',
492 'separator' => 'before',
493 'classes' => $this->pro_class,
494 'condition' => [
495 'embedpress_pro_embeded_source' => 'youtube',
496 'emberpress_custom_player!' => 'yes'
497 ],
498 ]
499 );
500 $this->add_control(
501 'embedpress_pro_youtube_modest_branding',
502 [
503 'label' => sprintf(__('Modest Branding %s', 'embedpress'), $this->pro_text),
504 'type' => Controls_Manager::SELECT,
505 'label_block' => false,
506 'default' => 1,
507 'options' => [
508 '0' => __('Display', 'embedpress'),
509 '1' => __('Do Not Display', 'embedpress')
510 ],
511 'condition' => [
512 'embedpress_pro_embeded_source' => 'youtube',
513 'embedpress_pro_youtube_display_controls!' => '0',
514 'embedpress_pro_youtube_progress_bar_color!' => 'white',
515 'embedpress_custom_player!' => 'yes',
516 ],
517 'classes' => $this->pro_class,
518 ]
519 );
520
521
522
523
524
525 do_action('extend_customplayer_controls', $this, '_', $this->pro_text, $this->pro_class);
526
527
528 $this->add_control(
529 'embepress_player_always_on_top',
530 [
531 'label' => sprintf(__('Sticky Video %s', 'embedpress'), $this->pro_text),
532 'description' => __('Watch video and seamlessly scroll through other content with a sleek pop-up window.', 'embedpress'),
533 'type' => Controls_Manager::SWITCHER,
534 'label_block' => false,
535 'return_value' => 'yes',
536 'classes' => $this->pro_class,
537 'default' => '',
538 'condition' => [
539 'emberpress_custom_player' => 'yes',
540 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'selfhosted_video']
541 ],
542 ]
543 );
544
545 $this->add_control(
546 'embedpress_pro_youtube_display_related_videos',
547 [
548 'label' => __('Related Videos', 'embedpress'),
549 'description' => __('Set it to "Yes" to display related videos from all channels. Otherwise, related videos will show from the same channel.', 'embedpress'),
550 'type' => Controls_Manager::SWITCHER,
551 'label_block' => false,
552 'return_value' => 'yes',
553 'default' => 'yes',
554 'condition' => $yt_condition,
555 ]
556 );
557
558
559
560 $this->add_control(
561 "embedpress_player_poster_thumbnail",
562 [
563 'label' => sprintf(__('Thumbnail %s', 'embedpress'), $this->pro_text),
564 'type' => Controls_Manager::MEDIA,
565 'dynamic' => [
566 'active' => true,
567 ],
568 'classes' => $this->pro_class,
569 'condition' => [
570 'emberpress_custom_player' => 'yes',
571 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'selfhosted_video']
572 ],
573 ]
574 );
575
576 $this->init_branding_controls('youtube');
577 }
578
579 public function init_youtube_channel_section()
580 {
581 $yt_condition = [
582 'embedpress_pro_embeded_source' => 'youtube',
583 ];
584 $this->start_controls_section(
585 'embedpress_yt_channel_section',
586 [
587 'label' => __('YouTube Channel', 'embedpress'),
588 'condition' => [
589 'embedpress_pro_embeded_source' => 'youtube',
590 'emberpress_custom_player!' => 'yes'
591 ],
592
593 ]
594 );
595
596 $this->add_control(
597 'important_note',
598 [
599 'type' => \Elementor\Controls_Manager::RAW_HTML,
600 'raw' => esc_html__('These options take effect only when a YouTube channel is embedded.', 'embedpress'),
601 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
602 ]
603 );
604
605 $this->add_control(
606 'pagesize',
607 [
608 'label' => __('Video Per Page', 'embedpress'),
609 'type' => Controls_Manager::NUMBER,
610 'label_block' => false,
611 'default' => 6,
612 'min' => 1,
613 'max' => 50,
614 'conditions' => [
615 'terms' => [
616 [
617 'name' => 'embedpress_pro_embeded_source',
618 'operator' => '===',
619 'value' => 'youtube',
620 ],
621 ],
622 ]
623 ]
624 );
625
626 $this->add_control(
627 'columns',
628 [
629 'label' => __('Column', 'embedpress'),
630 'type' => \Elementor\Controls_Manager::SELECT,
631 'label_block' => false,
632 'default' => '3',
633 'options' => [
634 '2' => esc_html__('2', 'embedpress'),
635 '3' => esc_html__('3', 'embedpress'),
636 '4' => esc_html__('4', 'embedpress'),
637 '6' => esc_html__('6', 'embedpress'),
638 'auto' => esc_html__('Auto', 'embedpress'),
639 ],
640 'conditions' => [
641 'terms' => [
642 [
643 'name' => 'embedpress_pro_embeded_source',
644 'operator' => '===',
645 'value' => 'youtube',
646 ],
647 ],
648 ]
649 ]
650 );
651 $this->add_control(
652 'gapbetweenvideos',
653 [
654 'label' => __('Gap Between Videos', 'embedpress'),
655 'label_block' => true,
656 'type' => \Elementor\Controls_Manager::SLIDER,
657 'size_units' => ['px', '%'],
658 'range' => [
659 'px' => [
660 'min' => 0,
661 'max' => 100,
662 'step' => 1,
663 ],
664 '%' => [
665 'min' => 0,
666 'max' => 100,
667 ],
668 ],
669 'default' => [
670 'unit' => 'px',
671 'size' => 30,
672 ],
673 'conditions' => [
674 'terms' => [
675 [
676 'name' => 'embedpress_pro_embeded_source',
677 'operator' => '===',
678 'value' => 'youtube',
679 ],
680 ],
681 ],
682 'selectors' => [
683 '{{WRAPPER}} .ep-youtube__content__block .youtube__content__body .content__wrap' => 'gap: {{SIZE}}{{UNIT}}!important;margin-top: {{SIZE}}{{UNIT}}!important;',
684 ],
685 ]
686 );
687
688 $this->add_control(
689 'pagination',
690 [
691 'label' => __('Pagination', 'embedpress'),
692 'type' => Controls_Manager::SWITCHER,
693 'label_block' => false,
694 'label_on' => esc_html__('Show', 'embedpress'),
695 'label_off' => esc_html__('Hide', 'embedpress'),
696 'return_value' => 'show',
697 'default' => 'show',
698 'condition' => $yt_condition,
699 ]
700 );
701
702
703 $this->end_controls_section();
704 }
705 public function init_youtube_subscription_section()
706 {
707 $yt_condition = [
708 'embedpress_pro_embeded_source' => 'youtube',
709 ];
710 $this->start_controls_section(
711 'embedpress_yt_subscription_section',
712 [
713 'label' => __('YouTube Subscriber', 'embedpress'),
714 'condition' => $yt_condition,
715
716 ]
717 );
718
719
720 $this->add_control(
721 'yt_sub_channel',
722 [
723
724 'label' => sprintf(__('Channel ID %s', 'embedpress'), $this->pro_text),
725 'type' => Controls_Manager::TEXT,
726 'dynamic' => [
727 'active' => true,
728 ],
729 'placeholder' => __('Enter Channel ID', 'embedpress'),
730 'label_block' => true,
731 'condition' => $yt_condition,
732 'classes' => $this->pro_class,
733 ]
734 );
735 $this->add_control(
736 'yt_sub_text',
737 [
738
739 'label' => sprintf(__('Subscription Text %s', 'embedpress'), $this->pro_text),
740 'type' => Controls_Manager::TEXT,
741 'dynamic' => [
742 'active' => true,
743 ],
744 'placeholder' => __('Eg. Don\'t miss out! Subscribe', 'embedpress'),
745 'label_block' => true,
746 'condition' => $yt_condition,
747 'classes' => $this->pro_class,
748 ]
749 );
750
751
752 $this->add_control(
753 'yt_sub_layout',
754 [
755 'label' => sprintf(__('Layout %s', 'embedpress'), $this->pro_text),
756 'type' => Controls_Manager::SELECT,
757 'label_block' => false,
758 'default' => 'default',
759 'options' => [
760 'default' => __('Default', 'embedpress'),
761 'full' => __('Full', 'embedpress')
762 ],
763 'condition' => [
764 'embedpress_pro_embeded_source' => 'youtube',
765 ],
766 'classes' => $this->pro_class,
767 ]
768 );
769
770 $this->add_control(
771 'yt_sub_theme',
772 [
773 'label' => sprintf(__('Theme %s', 'embedpress'), $this->pro_text),
774 'type' => Controls_Manager::SELECT,
775 'label_block' => false,
776 'default' => 'default',
777 'options' => [
778 'default' => __('Default', 'embedpress'),
779 'dark' => __('Dark', 'embedpress')
780 ],
781 'condition' => [
782 'embedpress_pro_embeded_source' => 'youtube',
783 ],
784 'classes' => $this->pro_class,
785 ]
786 );
787
788 $this->add_control(
789 'yt_sub_count',
790 [
791 'label' => sprintf(__('Subscriber Count %s', 'embedpress'), $this->pro_text),
792 'type' => Controls_Manager::SWITCHER,
793 'label_block' => false,
794 'return_value' => 'yes',
795 'default' => 'yes',
796 'condition' => $yt_condition,
797 'classes' => $this->pro_class,
798 ]
799 );
800
801 $this->end_controls_section();
802 }
803
804 public function init_youtube_livechat_section()
805 {
806 $yt_condition = [
807 'embedpress_pro_embeded_source' => 'youtube',
808 ];
809 $this->start_controls_section(
810 'embedpress_yt_livechat_section',
811 [
812 'label' => __('YouTube Live Chat', 'embedpress'),
813 'condition' => $yt_condition,
814
815 ]
816 );
817
818 $this->add_control(
819 'yt_lc_show',
820 [
821 'label' => sprintf(__('Show YouTube Live Chat %s', 'embedpress'), $this->pro_text),
822 'type' => Controls_Manager::SWITCHER,
823 'label_block' => false,
824 'return_value' => 'yes',
825 'default' => '',
826 'label_off' => __('Hide', 'embedpress'),
827 'label_on' => __('Show', 'embedpress'),
828 'condition' => $yt_condition,
829 'classes' => $this->pro_class,
830 ]
831 );
832
833
834 $this->end_controls_section();
835 }
836
837 //End Youtube Controls
838
839 /**
840 * Dailymotion Controls
841 */
842 public function init_dailymotion_control()
843 {
844 //@TODO; Kamal - migrate from 'embedpress_pro_dailymotion_logo' to 'embedpress_pro_dailymotion_ui_logo'
845 $this->add_control(
846 'embedpress_pro_dailymotion_ui_logo',
847 [
848 'label' => sprintf(__('Logo %s', 'embedpress'), $this->pro_text),
849 'type' => Controls_Manager::SWITCHER,
850 'label_block' => false,
851 'return_value' => 'yes',
852 'default' => 'yes',
853 'label_off' => __('Hide', 'embedpress'),
854 'label_on' => __('Show', 'embedpress'),
855 'condition' => [
856 'embedpress_pro_embeded_source' => 'dailymotion'
857 ],
858 'classes' => $this->pro_class,
859 ]
860 );
861 $this->add_control(
862 'embedpress_pro_dailymotion_autoplay',
863 [
864 'label' => __('Auto Play', 'embedpress'),
865 'type' => Controls_Manager::SWITCHER,
866 'label_block' => false,
867 'return_value' => 'yes',
868 'default' => 'no',
869 'label_off' => __('Hide', 'embedpress'),
870 'label_on' => __('Show', 'embedpress'),
871 'condition' => [
872 'embedpress_pro_embeded_source' => 'dailymotion'
873 ]
874 ]
875 );
876 $this->add_control(
877 'embedpress_pro_dailymotion_play_on_mobile',
878 [
879 'label' => __('Play On Mobile', 'embedpress'),
880 'type' => Controls_Manager::SWITCHER,
881 'label_block' => false,
882 'return_value' => 'yes',
883 'default' => 'no',
884 'label_off' => __('Hide', 'embedpress'),
885 'label_on' => __('Show', 'embedpress'),
886 'condition' => [
887 'embedpress_pro_embeded_source' => 'dailymotion',
888 'embedpress_pro_dailymotion_autoplay' => 'yes'
889 ]
890 ]
891 );
892 $this->add_control(
893 'embedpress_pro_dailymotion_mute',
894 [
895 'label' => __('Mute', 'embedpress'),
896 'type' => Controls_Manager::SWITCHER,
897 'label_block' => false,
898 'return_value' => 'yes',
899 'default' => 'no',
900 'label_off' => __('Hide', 'embedpress'),
901 'label_on' => __('Show', 'embedpress'),
902 'condition' => [
903 'embedpress_pro_embeded_source' => 'dailymotion'
904 ]
905 ]
906 );
907 $this->add_control(
908 'embedpress_pro_dailymotion_player_control',
909 [
910 'label' => __('Player Controls', 'embedpress'),
911 'type' => Controls_Manager::SWITCHER,
912 'label_block' => false,
913 'return_value' => 'yes',
914 'default' => 'yes',
915 'label_off' => __('Hide', 'embedpress'),
916 'label_on' => __('Show', 'embedpress'),
917 'condition' => [
918 'embedpress_pro_embeded_source' => 'dailymotion'
919 ]
920 ]
921 );
922 $this->add_control(
923 'embedpress_pro_dailymotion_video_info',
924 [
925 'label' => __('Video Info', 'embedpress'),
926 'type' => Controls_Manager::SWITCHER,
927 'label_block' => false,
928 'return_value' => 'yes',
929 'default' => 'yes',
930 'label_off' => __('Hide', 'embedpress'),
931 'label_on' => __('Show', 'embedpress'),
932 'condition' => [
933 'embedpress_pro_embeded_source' => 'dailymotion'
934 ]
935 ]
936 );
937 $this->add_control(
938 'embedpress_pro_dailymotion_control_color',
939 [
940 'label' => __('Control Color', 'embedpress'),
941 'type' => Controls_Manager::COLOR,
942 'label_block' => false,
943 'default' => '#dd3333',
944 'condition' => [
945 'embedpress_pro_embeded_source' => 'dailymotion'
946 ]
947 ]
948 );
949 $this->init_branding_controls('dailymotion');
950 }
951 //End Dailymotion Controls
952
953 /**
954 * Wistia Controls
955 */
956 public function init_wistia_controls()
957 {
958 $this->add_control(
959 'embedpress_pro_wistia_auto_play',
960 [
961 'label' => __('Auto Play', 'embedpress'),
962 'type' => Controls_Manager::SWITCHER,
963 'label_block' => false,
964 'return_value' => 'yes',
965 'default' => 'no',
966 'condition' => [
967 'embedpress_pro_embeded_source' => 'wistia'
968 ],
969 ]
970 );
971
972 $this->add_control(
973 'embedpress_pro_wistia_color',
974 [
975 'label' => __('Scheme', 'embedpress'),
976 'type' => Controls_Manager::COLOR,
977 'label_block' => false,
978 'default' => '#dd3333',
979 'condition' => [
980 'embedpress_pro_embeded_source' => 'wistia'
981 ]
982 ]
983 );
984
985
986
987 $this->add_control(
988 'embedpress_pro_wistia_captions_enabled_by_default',
989 [
990 'label' => __('Captions Enabled By Default', 'embedpress'),
991 'type' => Controls_Manager::SWITCHER,
992 'label_block' => false,
993 'return_value' => 'yes',
994 'default' => 'no',
995 'condition' => [
996 'embedpress_pro_embeded_source' => 'wistia',
997 'embedpress_pro_wistia_captions' => 'yes'
998 ],
999 'classes' => $this->pro_class,
1000 ]
1001 );
1002
1003 $this->add_control(
1004 'embedpress_pro_wistia_player_options',
1005 [
1006 'label' => __('Player Options', 'embedpress'),
1007 'type' => Controls_Manager::HEADING,
1008 'separator' => 'before',
1009 'condition' => [
1010 'embedpress_pro_embeded_source' => 'wistia'
1011 ]
1012 ]
1013 );
1014
1015
1016
1017 $this->add_control(
1018 'embedpress_pro_wistia_fullscreen_button',
1019 [
1020 'label' => __('Fullscreen Button', 'embedpress'),
1021 'type' => Controls_Manager::SWITCHER,
1022 'label_block' => false,
1023 'return_value' => 'yes',
1024 'default' => 'no',
1025 'condition' => [
1026 'embedpress_pro_embeded_source' => 'wistia'
1027 ],
1028 ]
1029 );
1030
1031 $this->add_control(
1032 'embedpress_pro_wistia_small_play_button',
1033 [
1034 'label' => __('Small Play Button', 'embedpress'),
1035 'type' => Controls_Manager::SWITCHER,
1036 'label_block' => false,
1037 'return_value' => 'yes',
1038 'default' => 'no',
1039 'condition' => [
1040 'embedpress_pro_embeded_source' => 'wistia'
1041 ],
1042 ]
1043 );
1044
1045
1046
1047
1048 $this->add_control(
1049 'embedpress_pro_wistia_resumable',
1050 [
1051 'label' => __('Resumable', 'embedpress'),
1052 'type' => Controls_Manager::SWITCHER,
1053 'label_block' => false,
1054 'return_value' => 'yes',
1055 'default' => 'no',
1056 'condition' => [
1057 'embedpress_pro_embeded_source' => 'wistia'
1058 ],
1059 ]
1060 );
1061
1062
1063 $this->add_control(
1064 'embedpress_pro_wistia_focus',
1065 [
1066 'label' => __('Focus', 'embedpress'),
1067 'type' => Controls_Manager::SWITCHER,
1068 'label_block' => false,
1069 'return_value' => 'yes',
1070 'default' => 'no',
1071 'condition' => [
1072 'embedpress_pro_embeded_source' => 'wistia'
1073 ],
1074 ]
1075 );
1076
1077 // --- Wistia PRO Controls --
1078 $this->add_control(
1079 'embedpress_pro_wistia_captions',
1080 [
1081 'label' => sprintf(__('Closed Captions %s', 'embedpress'), $this->pro_text),
1082 'type' => Controls_Manager::SWITCHER,
1083 'label_block' => false,
1084 'return_value' => 'yes',
1085 'default' => 'no',
1086 'condition' => [
1087 'embedpress_pro_embeded_source' => 'wistia'
1088 ],
1089 'classes' => $this->pro_class,
1090 ]
1091 );
1092 $this->add_control(
1093 'embedpress_pro_wistia_playbar',
1094 [
1095 'label' => __('Playbar ', 'embedpress'),
1096 'type' => Controls_Manager::SWITCHER,
1097 'label_block' => false,
1098 'return_value' => 'yes',
1099 'default' => 'no',
1100 'condition' => [
1101 'embedpress_pro_embeded_source' => 'wistia'
1102 ],
1103 ]
1104 );
1105
1106 $this->add_control(
1107 'embedpress_pro_wistia_volume_control',
1108 [
1109 'label' => sprintf(__('Volume Control %s', 'embedpress'), $this->pro_text),
1110 'type' => Controls_Manager::SWITCHER,
1111 'label_block' => false,
1112 'return_value' => 'yes',
1113 'default' => 'yes',
1114 'condition' => [
1115 'embedpress_pro_embeded_source' => 'wistia'
1116 ],
1117 'classes' => $this->pro_class,
1118 ]
1119 );
1120
1121
1122 $this->add_control(
1123 'embedpress_pro_wistia_volume',
1124 [
1125 'label' => sprintf(__('Volume %s', 'embedpress'), $this->pro_text),
1126 'type' => Controls_Manager::SLIDER,
1127 'default' => [
1128 'size' => 100,
1129 ],
1130 'range' => [
1131 'px' => [
1132 'min' => 0,
1133 'max' => 100,
1134 ]
1135 ],
1136 'condition' => [
1137 'embedpress_pro_embeded_source' => 'wistia',
1138 'embedpress_pro_wistia_volume_control' => 'yes'
1139 ],
1140 'classes' => $this->pro_class,
1141 ]
1142 );
1143
1144 $this->add_control(
1145 'embedpress_pro_wistia_rewind',
1146 [
1147 'label' => __('Rewind', 'embedpress'),
1148 'type' => Controls_Manager::SWITCHER,
1149 'label_block' => false,
1150 'return_value' => 'yes',
1151 'default' => 'no',
1152 'condition' => [
1153 'embedpress_pro_embeded_source' => 'wistia'
1154 ],
1155 ]
1156 );
1157
1158 $this->add_control(
1159 'embedpress_pro_wistia_rewind_time',
1160 [
1161 'label' => __('Rewind time', 'embedpress'),
1162 'type' => Controls_Manager::SLIDER,
1163 'default' => [
1164 'size' => 10,
1165 ],
1166 'range' => [
1167 'px' => [
1168 'min' => 1,
1169 'max' => 100,
1170 ]
1171 ],
1172 'condition' => [
1173 'embedpress_pro_wistia_rewind' => 'yes',
1174 'embedpress_pro_embeded_source' => 'wistia'
1175 ],
1176 ]
1177 );
1178 $this->init_branding_controls('wistia');
1179 }
1180 //End Wistia controls
1181
1182
1183
1184 /**
1185 * Twitch Controls
1186 */
1187 public function init_twitch_control()
1188 {
1189 $condition = [
1190 'embedpress_pro_embeded_source' => 'twitch'
1191 ];
1192 $this->add_control(
1193 'embedpress_pro_twitch_autoplay',
1194 [
1195 'label' => __('Autoplay', 'embedpress'),
1196 'type' => Controls_Manager::SWITCHER,
1197 'label_off' => __('No', 'embedpress'),
1198 'label_on' => __('Yes', 'embedpress'),
1199 'default' => 'yes',
1200 'condition' => $condition,
1201 ]
1202 );
1203 $this->add_control(
1204 'embedpress_pro_fs',
1205 [
1206 'label' => __('Allow Full Screen Video', 'embedpress'),
1207 'type' => Controls_Manager::SWITCHER,
1208 'label_off' => __('No', 'embedpress'),
1209 'label_on' => __('Yes', 'embedpress'),
1210 'default' => 'yes',
1211 'condition' => $condition,
1212 ]
1213 );
1214
1215 // -- Twitch PRO controls --
1216 $this->add_control(
1217 'embedpress_pro_twitch_chat',
1218 [
1219 'label' => sprintf(__('Show Chat %s', 'embedpress'), $this->pro_text),
1220 'type' => Controls_Manager::SWITCHER,
1221 'label_off' => __('Hide', 'embedpress'),
1222 'label_on' => __('Show', 'embedpress'),
1223 'condition' => $condition,
1224 'classes' => $this->pro_class,
1225
1226 ]
1227 );
1228 $this->add_control(
1229 'embedpress_pro_twitch_mute',
1230 [
1231 'label' => __('Mute on start', 'embedpress'),
1232 'type' => Controls_Manager::SWITCHER,
1233 'label_off' => __('Hide', 'embedpress'),
1234 'label_on' => __('Show', 'embedpress'),
1235 'condition' => $condition,
1236 ]
1237 );
1238 $this->add_control(
1239 'embedpress_pro_twitch_theme',
1240 [
1241 'label' => __('Theme', 'embedpress'),
1242 'type' => Controls_Manager::SELECT,
1243 'default' => 'dark',
1244 'options' => [
1245 'dark' => __('Dark', 'embedpress'),
1246 'light' => __('Light', 'embedpress'),
1247 ],
1248 'condition' => $condition,
1249 ]
1250 );
1251
1252 $this->init_branding_controls('twitch');
1253 }
1254 //End Twitch controls
1255
1256
1257 /**
1258 * SoundCloud Controls
1259 */
1260 public function init_soundcloud_controls()
1261 {
1262 $this->add_control(
1263 'embedpress_pro_soundcloud_visual',
1264 [
1265 'label' => __('Visual Player', 'embedpress'),
1266 'type' => Controls_Manager::SWITCHER,
1267 'label_block' => false,
1268 'return_value' => 'yes',
1269 'default' => 'no',
1270 'label_off' => __('Hide', 'embedpress'),
1271 'label_on' => __('Show', 'embedpress'),
1272 'condition' => [
1273 'embedpress_pro_embeded_source' => 'soundcloud'
1274 ],
1275 ]
1276 );
1277
1278 $this->add_control(
1279 'embedpress_pro_soundcloud_color',
1280 [
1281 'label' => __('Scheme', 'embedpress'),
1282 'type' => Controls_Manager::COLOR,
1283 'label_block' => false,
1284 'default' => '#FF5500',
1285 'condition' => [
1286 'embedpress_pro_embeded_source' => 'soundcloud'
1287 ]
1288 ]
1289 );
1290
1291 $this->add_control(
1292 'embedpress_pro_soundcloud_autoplay',
1293 [
1294 'label' => __('Auto Play', 'embedpress'),
1295 'type' => Controls_Manager::SWITCHER,
1296 'label_block' => false,
1297 'return_value' => 'yes',
1298 'default' => 'no',
1299 'label_off' => __('Hide', 'embedpress'),
1300 'label_on' => __('Show', 'embedpress'),
1301 'condition' => [
1302 'embedpress_pro_embeded_source' => 'soundcloud'
1303 ],
1304 ]
1305 );
1306
1307
1308
1309 $this->add_control(
1310 'embedpress_pro_soundcloud_share_button',
1311 [
1312 'label' => __('Share Button', 'embedpress'),
1313 'type' => Controls_Manager::SWITCHER,
1314 'label_block' => false,
1315 'return_value' => 'yes',
1316 'default' => 'yes',
1317 'label_off' => __('Hide', 'embedpress'),
1318 'label_on' => __('Show', 'embedpress'),
1319 'condition' => [
1320 'embedpress_pro_embeded_source' => 'soundcloud'
1321 ],
1322 ]
1323 );
1324
1325 $this->add_control(
1326 'embedpress_pro_soundcloud_comments',
1327 [
1328 'label' => __('Comments', 'embedpress'),
1329 'type' => Controls_Manager::SWITCHER,
1330 'label_block' => false,
1331 'return_value' => 'yes',
1332 'default' => 'yes',
1333 'label_off' => __('Hide', 'embedpress'),
1334 'label_on' => __('Show', 'embedpress'),
1335 'condition' => [
1336 'embedpress_pro_embeded_source' => 'soundcloud'
1337 ],
1338 ]
1339 );
1340
1341
1342
1343 $this->add_control(
1344 'embedpress_pro_soundcloud_artwork',
1345 [
1346 'label' => __('Artwork', 'embedpress'),
1347 'type' => Controls_Manager::SWITCHER,
1348 'label_block' => false,
1349 'return_value' => 'yes',
1350 'default' => 'yes',
1351 'label_off' => __('Hide', 'embedpress'),
1352 'label_on' => __('Show', 'embedpress'),
1353 'condition' => [
1354 'embedpress_pro_embeded_source' => 'soundcloud',
1355 'embedpress_pro_soundcloud_visual!' => 'yes'
1356 ]
1357 ]
1358 );
1359
1360 $this->add_control(
1361 'embedpress_pro_soundcloud_play_count',
1362 [
1363 'label' => __('Play Count', 'embedpress'),
1364 'type' => Controls_Manager::SWITCHER,
1365 'label_block' => false,
1366 'return_value' => 'yes',
1367 'default' => 'yes',
1368 'label_off' => __('Hide', 'embedpress'),
1369 'label_on' => __('Show', 'embedpress'),
1370 'condition' => [
1371 'embedpress_pro_embeded_source' => 'soundcloud',
1372 'embedpress_pro_soundcloud_visual!' => 'yes'
1373 ],
1374 ]
1375 );
1376
1377 $this->add_control(
1378 'embedpress_pro_soundcloud_user_name',
1379 [
1380 'label' => __('User Name', 'embedpress'),
1381 'type' => Controls_Manager::SWITCHER,
1382 'label_block' => false,
1383 'return_value' => 'yes',
1384 'default' => 'yes',
1385 'label_off' => __('Hide', 'embedpress'),
1386 'label_on' => __('Show', 'embedpress'),
1387 'condition' => [
1388 'embedpress_pro_embeded_source' => 'soundcloud'
1389 ],
1390 ]
1391 );
1392
1393 $this->add_control(
1394 'embedpress_pro_soundcloud_buy_button',
1395 [
1396 'label' => sprintf(__('Buy Button %s', 'embedpress'), $this->pro_text),
1397 'type' => Controls_Manager::SWITCHER,
1398 'label_block' => false,
1399 'return_value' => 'yes',
1400 'default' => 'yes',
1401 'label_off' => __('Hide', 'embedpress'),
1402 'label_on' => __('Show', 'embedpress'),
1403 'condition' => [
1404 'embedpress_pro_embeded_source' => 'soundcloud'
1405 ],
1406 'classes' => $this->pro_class,
1407 ]
1408 );
1409 $this->add_control(
1410 'embedpress_pro_soundcloud_download_button',
1411 [
1412 'label' => sprintf(__('Download Button %s', 'embedpress'), $this->pro_text),
1413 'type' => Controls_Manager::SWITCHER,
1414 'label_block' => false,
1415 'return_value' => 'yes',
1416 'default' => 'yes',
1417 'label_off' => __('Hide', 'embedpress'),
1418 'label_on' => __('Show', 'embedpress'),
1419 'condition' => [
1420 'embedpress_pro_embeded_source' => 'soundcloud'
1421 ],
1422 'classes' => $this->pro_class,
1423 ]
1424 );
1425 }
1426 //End SoundCloud controls
1427
1428 /**
1429 * Vimeo Controls
1430 */
1431 public function init_vimeo_controls()
1432 {
1433
1434
1435
1436 $this->add_control(
1437 'embedpress_pro_vimeo_color',
1438 [
1439 'label' => __('Scheme', 'embedpress'),
1440 'type' => Controls_Manager::COLOR,
1441 'label_block' => false,
1442 'default' => '#00adef',
1443 'condition' => [
1444 'emberpress_custom_player!' => 'yes',
1445 'embedpress_pro_embeded_source' => 'vimeo'
1446 ]
1447 ]
1448 );
1449
1450 $this->add_control(
1451 'embedpress_pro_vimeo_author_options',
1452 [
1453 'label' => __('Author Information', 'embedpress'),
1454 'type' => Controls_Manager::HEADING,
1455 'separator' => 'before',
1456 'condition' => [
1457 'embedpress_pro_embeded_source' => 'vimeo',
1458 'emberpress_custom_player!' => 'yes',
1459 ]
1460 ]
1461 );
1462
1463 $this->add_control(
1464 'embedpress_pro_vimeo_display_title',
1465 [
1466 'label' => __('Title', 'embedpress'),
1467 'type' => Controls_Manager::SWITCHER,
1468 'label_block' => false,
1469 'return_value' => 'yes',
1470 'default' => 'yes',
1471 'condition' => [
1472 'emberpress_custom_player!' => 'yes',
1473 'embedpress_pro_embeded_source' => 'vimeo'
1474 ]
1475 ]
1476 );
1477
1478 //----- Vimeo PRO controls
1479
1480 $this->add_control(
1481 'embedpress_pro_vimeo_display_author',
1482 [
1483 'label' => __('Author', 'embedpress'),
1484 'type' => Controls_Manager::SWITCHER,
1485 'label_block' => false,
1486 'return_value' => 'yes',
1487 'default' => 'yes',
1488 'condition' => [
1489 'emberpress_custom_player!' => 'yes',
1490 'embedpress_pro_embeded_source' => 'vimeo'
1491 ],
1492 ]
1493 );
1494
1495 $this->add_control(
1496 'embedpress_pro_vimeo_avatar',
1497 [
1498 'label' => __('Avatar', 'embedpress'),
1499 'type' => Controls_Manager::SWITCHER,
1500 'label_block' => false,
1501 'return_value' => 'yes',
1502 'default' => 'yes',
1503 'condition' => [
1504 'emberpress_custom_player!' => 'yes',
1505 'embedpress_pro_embeded_source' => 'vimeo'
1506 ],
1507 ]
1508 );
1509
1510 $this->add_control(
1511 'embedpress_pro_vimeo_loop',
1512 [
1513 'label' => sprintf(__('Loop %s', 'embedpress'), $this->pro_text),
1514 'type' => Controls_Manager::SWITCHER,
1515 'label_block' => false,
1516 'return_value' => 'yes',
1517 'default' => 'no',
1518 'condition' => [
1519 'emberpress_custom_player!' => 'yes',
1520 'embedpress_pro_embeded_source' => 'vimeo'
1521 ],
1522 'classes' => $this->pro_class,
1523 ]
1524 );
1525
1526 $this->init_branding_controls('vimeo');
1527 }
1528 //End Vimeo controls
1529
1530
1531 /**
1532 * Spotify Controls
1533 */
1534 public function init_spotify_controls()
1535 {
1536 $condition = [
1537 'embedpress_pro_embeded_source' => 'spotify'
1538 ];
1539
1540 $this->add_control(
1541 'spotify_theme',
1542 [
1543 'label' => __('Player Background', 'embedpress'),
1544 'description' => __('Dynamic option will use the most vibrant color from the album art.', 'embedpress'),
1545 'type' => Controls_Manager::SELECT,
1546 'label_block' => false,
1547 'default' => '1',
1548 'options' => [
1549 '1' => __('Dynamic', 'embedpress'),
1550 '0' => __('Black & White', 'embedpress')
1551 ],
1552 'condition' => $condition
1553 ]
1554 );
1555 }
1556 //End Spotify controls
1557
1558 /**
1559 * OpenSea Controls
1560 */
1561 public function init_opensea_control()
1562 {
1563 $condition = [
1564 'embedpress_pro_embeded_source' => 'opensea'
1565 ];
1566
1567 $this->add_control(
1568 'limit',
1569 [
1570 'type' => \Elementor\Controls_Manager::NUMBER,
1571 'label' => esc_html__('Limit', 'embedpress'),
1572 'placeholder' => '9',
1573 'min' => 1,
1574 'max' => 100,
1575 'step' => 1,
1576 'default' => 20,
1577 'condition' => [
1578 'embedpress_pro_embeded_nft_type' => ['collection'],
1579 'embedpress_pro_embeded_source!' => [
1580 'default',
1581 'youtube',
1582 'vimeo',
1583 'dailymotion',
1584 'wistia',
1585 'twitch',
1586 'soundcloud',
1587 'calendly',
1588 'selfhosted_video',
1589 'selfhosted_audio',
1590 ],
1591 ],
1592 ]
1593 );
1594
1595
1596 $this->add_control(
1597 'orderby',
1598 [
1599 'type' => \Elementor\Controls_Manager::SELECT,
1600 'label' => esc_html__('Order By', 'embedpress'),
1601 'options' => [
1602 'asc' => esc_html__('Oldest', 'embedpress'),
1603 'desc' => esc_html__('Newest', 'embedpress'),
1604 ],
1605 'default' => 'desc',
1606 'condition' => [
1607 'embedpress_pro_embeded_nft_type' => ['collection'],
1608 'embedpress_pro_embeded_source!' => [
1609 'default',
1610 'youtube',
1611 'vimeo',
1612 'dailymotion',
1613 'wistia',
1614 'twitch',
1615 'soundcloud',
1616 'calendly',
1617 'selfhosted_video',
1618 'selfhosted_audio',
1619 ],
1620 ],
1621 ]
1622 );
1623 }
1624
1625 public function init_opensea_control_section()
1626 {
1627 $condition = [
1628 'embedpress_pro_embeded_source' => 'opensea',
1629 ];
1630
1631 $this->start_controls_section(
1632 'embedpress_opensea_control_section',
1633 [
1634 'label' => __('OpenSea Control Settings', 'embedpress'),
1635 'condition' => $condition,
1636 ]
1637 );
1638
1639 $this->add_control(
1640 'opense_important_note_single',
1641 [
1642 'type' => \Elementor\Controls_Manager::RAW_HTML,
1643 'raw' => esc_html__('These options take effect only when a Opensea Single Asset is embedded.', 'embedpress'),
1644 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
1645 'condition' => [
1646 'embedpress_pro_embeded_nft_type' => 'single'
1647 ],
1648
1649 ]
1650 );
1651 $this->add_control(
1652 'opense_important_note_collection',
1653 [
1654 'type' => \Elementor\Controls_Manager::RAW_HTML,
1655 'raw' => esc_html__('These options take effect only when a Opensea Collection is embedded.', 'embedpress'),
1656 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
1657 'condition' => [
1658 'embedpress_pro_embeded_nft_type' => 'collection'
1659 ],
1660 ]
1661 );
1662
1663 $this->add_control(
1664 'layout',
1665 [
1666 'label' => __('Layout', 'embedpress'),
1667 'type' => \Elementor\Controls_Manager::SELECT,
1668 'label_block' => false,
1669 'default' => 'ep-grid',
1670 'options' => [
1671 'ep-grid' => esc_html__('Grid', 'embedpress'),
1672 'ep-list' => esc_html__('List', 'embedpress'),
1673 ],
1674 'conditions' => [
1675 'terms' => [
1676 [
1677 'name' => 'embedpress_pro_embeded_nft_type',
1678 'operator' => '===',
1679 'value' => 'collection',
1680 ],
1681 ],
1682 ]
1683
1684 ]
1685 );
1686
1687
1688 $this->add_control(
1689 'preset',
1690 [
1691 'label' => __('Preset', 'embedpress'),
1692 'type' => \Elementor\Controls_Manager::SELECT,
1693 'label_block' => false,
1694 'default' => 'ep-preset-1',
1695 'options' => [
1696 'ep-preset-1' => esc_html__('Preset 1', 'embedpress'),
1697 'ep-preset-2' => esc_html__('Preset 2', 'embedpress'),
1698 ],
1699 'conditions' => [
1700 'terms' => [
1701 [
1702 'name' => 'embedpress_pro_embeded_nft_type',
1703 'operator' => '===',
1704 'value' => 'collection',
1705 'relation' => 'and'
1706 ],
1707 [
1708 'name' => 'layout',
1709 'operator' => '===',
1710 'value' => 'ep-grid',
1711 'relation' => 'and'
1712 ],
1713 ],
1714 ]
1715
1716 ]
1717 );
1718
1719 $this->add_control(
1720 'nftperrow',
1721 [
1722 'label' => __('Column', 'embedpress'),
1723 'type' => \Elementor\Controls_Manager::SELECT,
1724 'label_block' => false,
1725 'default' => '3',
1726 'options' => [
1727 '1' => esc_html__('1', 'embedpress'),
1728 '2' => esc_html__('2', 'embedpress'),
1729 '3' => esc_html__('3', 'embedpress'),
1730 '4' => esc_html__('4', 'embedpress'),
1731 '5' => esc_html__('5', 'embedpress'),
1732 '6' => esc_html__('6', 'embedpress'),
1733 'auto' => esc_html__('Auto', 'embedpress'),
1734 ],
1735 'condition' => [
1736 'embedpress_pro_embeded_nft_type' => ['collection']
1737 ],
1738
1739 ]
1740 );
1741
1742 $this->add_control(
1743 'gapbetweenitem',
1744 [
1745 'label' => esc_html__('Gap Between Item', 'embedpress'),
1746 'type' => \Elementor\Controls_Manager::SLIDER,
1747 'size_units' => ['px'],
1748 'range' => [
1749 'px' => [
1750 'min' => 1,
1751 'max' => 100,
1752 'step' => 1,
1753 ],
1754 ],
1755 'default' => [
1756 'unit' => 'px',
1757 'size' => 15,
1758 ],
1759 'condition' => [
1760 'embedpress_pro_embeded_nft_type' => ['collection']
1761 ],
1762 ]
1763 );
1764
1765 $this->add_control(
1766 'collectionname',
1767 [
1768 'label' => __('Collection Name', 'embedpress'),
1769 'type' => Controls_Manager::SWITCHER,
1770 'label_block' => false,
1771 'return_value' => 'yes',
1772 'label_off' => __('Hide', 'embedpress'),
1773 'label_on' => __('Show', 'embedpress'),
1774 'default' => 'yes',
1775 'condition' => [
1776 'embedpress_pro_embeded_nft_type' => 'single'
1777 ],
1778 ]
1779 );
1780 $this->add_control(
1781 'nftimage',
1782 [
1783 'label' => __('Thumbnail', 'embedpress'),
1784 'type' => Controls_Manager::SWITCHER,
1785 'label_block' => false,
1786 'return_value' => 'yes',
1787 'label_off' => __('Hide', 'embedpress'),
1788 'label_on' => __('Show', 'embedpress'),
1789 'default' => 'yes',
1790 'condition' => $condition,
1791 ]
1792 );
1793 $this->add_control(
1794 'nfttitle',
1795 [
1796 'label' => __('Title', 'embedpress'),
1797 'type' => Controls_Manager::SWITCHER,
1798 'label_block' => false,
1799 'return_value' => 'yes',
1800 'default' => '',
1801 'label_off' => __('Hide', 'embedpress'),
1802 'label_on' => __('Show', 'embedpress'),
1803 'default' => 'yes',
1804 'condition' => $condition,
1805 ]
1806 );
1807 $this->add_control(
1808 'nftcreator',
1809 [
1810 'label' => __('Creator', 'embedpress'),
1811 'type' => Controls_Manager::SWITCHER,
1812 'label_block' => false,
1813 'return_value' => 'yes',
1814 'default' => '',
1815 'label_off' => __('Hide', 'embedpress'),
1816 'label_on' => __('Show', 'embedpress'),
1817 'default' => 'yes',
1818 'condition' => $condition,
1819 ]
1820 );
1821
1822 $this->add_control(
1823 'prefix_nftcreator',
1824 [
1825 'label' => sprintf(__('Prefix %s', 'embedpress'), $this->pro_text),
1826 'type' => \Elementor\Controls_Manager::TEXT,
1827 'default' => esc_html__('Created By', 'embedpress'),
1828 'placeholder' => esc_html__('Created By', 'embedpress'),
1829 'classes' => $this->pro_class,
1830 'condition' => [
1831 'nftcreator' => 'yes',
1832 ]
1833 ]
1834 );
1835
1836 $this->add_control(
1837 'nftprice',
1838 [
1839 'label' => __('Current Price', 'embedpress'),
1840 'type' => Controls_Manager::SWITCHER,
1841 'label_block' => false,
1842 'return_value' => 'yes',
1843 'default' => '',
1844 'label_off' => __('Hide', 'embedpress'),
1845 'label_on' => __('Show', 'embedpress'),
1846 'default' => 'yes',
1847 'condition' => $condition,
1848 ]
1849 );
1850
1851 $this->add_control(
1852 'prefix_nftprice',
1853 [
1854 'label' => sprintf(__('Prefix %s', 'embedpress'), $this->pro_text),
1855 'type' => \Elementor\Controls_Manager::TEXT,
1856 'default' => esc_html__('Current Price', 'embedpress'),
1857 'placeholder' => esc_html__('Current Price', 'embedpress'),
1858 'classes' => $this->pro_class,
1859 'condition' => [
1860 'nftprice' => 'yes',
1861 ]
1862 ]
1863 );
1864
1865 $this->add_control(
1866 'nftlastsale',
1867 [
1868 'label' => __('Last Sale', 'embedpress'),
1869 'type' => Controls_Manager::SWITCHER,
1870 'label_block' => false,
1871 'return_value' => 'yes',
1872 'default' => '',
1873 'label_off' => __('Hide', 'embedpress'),
1874 'label_on' => __('Show', 'embedpress'),
1875 'default' => 'yes',
1876 'condition' => $condition,
1877 ]
1878 );
1879
1880 $this->add_control(
1881 'prefix_nftlastsale',
1882 [
1883 'label' => sprintf(__('Prefix %s', 'embedpress'), $this->pro_text),
1884 'type' => \Elementor\Controls_Manager::TEXT,
1885 'default' => esc_html__('Last Sale', 'embedpress'),
1886 'placeholder' => esc_html__('Last Sale', 'embedpress'),
1887 'classes' => $this->pro_class,
1888 'condition' => [
1889 'nftlastsale' => 'yes',
1890 ]
1891 ]
1892 );
1893
1894 $this->add_control(
1895 'nftbutton',
1896 [
1897 'label' => __('Button', 'embedpress'),
1898 'type' => Controls_Manager::SWITCHER,
1899 'label_block' => false,
1900 'return_value' => 'yes',
1901 'default' => '',
1902 'label_off' => __('Hide', 'embedpress'),
1903 'label_on' => __('Show', 'embedpress'),
1904 'default' => 'yes',
1905 'condition' => $condition,
1906 ]
1907 );
1908 $this->add_control(
1909 'label_nftbutton',
1910 [
1911 'label' => sprintf(__('Button Label %s', 'embedpress'), $this->pro_text),
1912 'type' => \Elementor\Controls_Manager::TEXT,
1913 'default' => esc_html__('See Details', 'embedpress'),
1914 'placeholder' => esc_html__('See Details', 'embedpress'),
1915 'classes' => $this->pro_class,
1916 'condition' => [
1917 'nftbutton' => 'yes',
1918 ]
1919 ]
1920 );
1921
1922 $this->add_control(
1923 'loadmore',
1924 [
1925 'label' => sprintf(__('Load More %s', 'embedpress'), $this->pro_text),
1926 'type' => Controls_Manager::SWITCHER,
1927 'label_block' => false,
1928 'return_value' => 'yes',
1929 'default' => '',
1930 'label_off' => __('Hide', 'embedpress'),
1931 'label_on' => __('Show', 'embedpress'),
1932 'default' => '',
1933 'classes' => $this->pro_class,
1934 'condition' => [
1935 'embedpress_pro_embeded_nft_type' => ['collection']
1936 ],
1937 ]
1938 );
1939 $this->add_control(
1940 'itemperpage',
1941 [
1942 'type' => \Elementor\Controls_Manager::NUMBER,
1943 'label' => esc_html__('Item Per Page', 'embedpress'),
1944 'placeholder' => '9',
1945 'min' => 1,
1946 'max' => 100,
1947 'step' => 1,
1948 'default' => 9,
1949 'condition' => [
1950 'loadmore' => 'yes'
1951 ],
1952 ]
1953 );
1954 $this->add_control(
1955 'loadmorelabel',
1956 [
1957 'type' => \Elementor\Controls_Manager::TEXT,
1958 'label' => esc_html__('Load More Label', 'embedpress'),
1959 'placeholder' => 'Load More',
1960 'default' => 'Load More',
1961 'condition' => [
1962 'loadmore' => 'yes'
1963 ],
1964 ]
1965 );
1966
1967 $this->add_control(
1968 'nftrank',
1969 [
1970 'label' => __('Rank', 'embedpress'),
1971 'type' => Controls_Manager::SWITCHER,
1972 'label_block' => false,
1973 'return_value' => 'yes',
1974 'label_off' => __('Hide', 'embedpress'),
1975 'label_on' => __('Show', 'embedpress'),
1976 'default' => 'yes',
1977 'condition' => [
1978 'embedpress_pro_embeded_nft_type' => 'single'
1979 ],
1980 ]
1981 );
1982 $this->add_control(
1983 'label_nftrank',
1984 [
1985 'label' => sprintf(__('Rank Label %s', 'embedpress'), $this->pro_text),
1986 'type' => \Elementor\Controls_Manager::TEXT,
1987 'default' => esc_html__('Rank', 'embedpress'),
1988 'placeholder' => esc_html__('Rank', 'embedpress'),
1989 'classes' => $this->pro_class,
1990 'condition' => [
1991 'nftrank' => 'yes',
1992 'embedpress_pro_embeded_nft_type!' => 'collection'
1993 ]
1994 ]
1995 );
1996
1997 $this->add_control(
1998 'nftdetails',
1999 [
2000 'label' => __('Details', 'embedpress'),
2001 'type' => Controls_Manager::SWITCHER,
2002 'label_block' => false,
2003 'return_value' => 'yes',
2004 'label_off' => __('Hide', 'embedpress'),
2005 'label_on' => __('Show', 'embedpress'),
2006 'default' => 'yes',
2007 'condition' => [
2008 'embedpress_pro_embeded_nft_type' => 'single'
2009 ],
2010 ]
2011 );
2012
2013 $this->add_control(
2014 'label_nftdetails',
2015 [
2016 'label' => sprintf(__('Details Label %s', 'embedpress'), $this->pro_text),
2017 'type' => \Elementor\Controls_Manager::TEXT,
2018 'default' => esc_html__('Details', 'embedpress'),
2019 'placeholder' => esc_html__('Details', 'embedpress'),
2020 'classes' => $this->pro_class,
2021 'condition' => [
2022 'nftdetails' => 'yes',
2023 'embedpress_pro_embeded_nft_type!' => 'collection'
2024 ]
2025 ]
2026 );
2027
2028 $this->end_controls_section();
2029 }
2030
2031 public function init_opensea_color_and_typography()
2032 {
2033 $condition = [
2034 'embedpress_pro_embeded_source' => 'opensea',
2035 ];
2036
2037 $this->start_controls_section(
2038 'embedpress_color_typography_control_section',
2039 [
2040 'label' => __('Color and Typography', 'embedpress'),
2041 'tab' => Controls_Manager::TAB_STYLE,
2042 'condition' => $condition,
2043 ]
2044 );
2045
2046 $this->add_control(
2047 'opense_color_important_note_single',
2048 [
2049 'type' => \Elementor\Controls_Manager::RAW_HTML,
2050 'raw' => esc_html__('These options take effect only when a Opensea Single Asset is embedded.', 'embedpress'),
2051 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
2052 'condition' => [
2053 'embedpress_pro_embeded_nft_type' => 'single'
2054 ],
2055
2056 ]
2057 );
2058 $this->add_control(
2059 'opense_color_important_note_collection',
2060 [
2061 'type' => \Elementor\Controls_Manager::RAW_HTML,
2062 'raw' => esc_html__('These options take effect only when a Opensea Collection is embedded.', 'embedpress'),
2063 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
2064 'condition' => [
2065 'embedpress_pro_embeded_nft_type' => 'collection'
2066 ],
2067 ]
2068 );
2069
2070
2071 $this->add_control(
2072 'item_heading',
2073 [
2074 'label' => esc_html__('Item', 'embedpress'),
2075 'type' => \Elementor\Controls_Manager::HEADING,
2076 'separator' => 'before',
2077 ]
2078 );
2079
2080 $this->add_control(
2081 'nft_item_background_color',
2082 [
2083 'label' => esc_html__('Background Color', 'embedpress'),
2084 'type' => \Elementor\Controls_Manager::COLOR,
2085 'selectors' => [
2086 '{{WRAPPER}} .ep_nft_content_wrap .ep_nft_item' => 'background-color: {{VALUE}}',
2087 ],
2088 ]
2089 );
2090
2091 $this->add_control(
2092 'collectionname_heading',
2093 [
2094 'label' => esc_html__('Collection Name', 'embedpress'),
2095 'type' => \Elementor\Controls_Manager::HEADING,
2096 'separator' => 'before',
2097 ]
2098 );
2099
2100 $this->add_control(
2101 'nft_collectionname_color',
2102 [
2103 'label' => esc_html__('Color', 'embedpress'),
2104 'type' => \Elementor\Controls_Manager::COLOR,
2105 'selectors' => [
2106 '{{WRAPPER}} .ep-nft-single-item-wraper a.CollectionLink--link' => 'color: {{VALUE}}',
2107 ],
2108 ]
2109 );
2110 $this->add_control(
2111 'nft_collectionname_hover_color',
2112 [
2113 'label' => esc_html__('Hove Color', 'embedpress'),
2114 'type' => \Elementor\Controls_Manager::COLOR,
2115 'selectors' => [
2116 '{{WRAPPER}} .ep-nft-single-item-wraper a.CollectionLink--link:hover' => 'color: {{VALUE}}',
2117 ],
2118 ]
2119 );
2120 $this->add_group_control(
2121 \Elementor\Group_Control_Typography::get_type(),
2122 [
2123 'name' => 'nft_collectionname_typography',
2124 'selector' => '{{WRAPPER}} .ep-nft-single-item-wraper a.CollectionLink--link',
2125 ]
2126 );
2127
2128 $this->add_control(
2129 'title_heading',
2130 [
2131 'label' => esc_html__('Title', 'embedpress'),
2132 'type' => \Elementor\Controls_Manager::HEADING,
2133 'separator' => 'before',
2134 ]
2135 );
2136
2137 $this->add_control(
2138 'nft_title_color',
2139 [
2140 'label' => esc_html__('Color', 'embedpress'),
2141 'type' => \Elementor\Controls_Manager::COLOR,
2142 'selectors' => [
2143 '{{WRAPPER}} .ep_nft_title' => 'color: {{VALUE}}',
2144 ],
2145 ]
2146 );
2147 $this->add_group_control(
2148 \Elementor\Group_Control_Typography::get_type(),
2149 [
2150 'name' => 'nft_title_typography',
2151 'selector' => '{{WRAPPER}} .ep_nft_title',
2152 ]
2153 );
2154
2155
2156 $this->add_control(
2157 'creator_heading',
2158 [
2159 'label' => esc_html__('Creator', 'embedpress'),
2160 'type' => \Elementor\Controls_Manager::HEADING,
2161 'separator' => 'before',
2162 ]
2163 );
2164
2165 $this->add_control(
2166 'nft_creator_color',
2167 [
2168 'label' => esc_html__('Color', 'embedpress'),
2169 'type' => \Elementor\Controls_Manager::COLOR,
2170 'selectors' => [
2171 '{{WRAPPER}} .ep_nft_creator span' => 'color: {{VALUE}}',
2172 ],
2173 ]
2174 );
2175 $this->add_group_control(
2176 \Elementor\Group_Control_Typography::get_type(),
2177 [
2178 'name' => 'nft_creator_typography',
2179 'selector' => '{{WRAPPER}} .ep_nft_creator span',
2180 ]
2181 );
2182
2183 $this->add_control(
2184 'nft_created_by_color',
2185 [
2186 'label' => esc_html__('Link Color', 'embedpress'),
2187 'type' => \Elementor\Controls_Manager::COLOR,
2188 'selectors' => [
2189 '{{WRAPPER}} .ep_nft_creator span a' => 'color: {{VALUE}}',
2190 ],
2191 ]
2192 );
2193 $this->add_group_control(
2194 \Elementor\Group_Control_Typography::get_type(),
2195 [
2196 'label' => esc_html__('Link Typography', 'embedpress'),
2197 'name' => 'nft_created_by_typography',
2198 'selector' => '{{WRAPPER}} .ep_nft_creator span a',
2199 ]
2200 );
2201
2202 $this->add_control(
2203 'price_heading',
2204 [
2205 'label' => esc_html__('Current Price', 'embedpress'),
2206 'type' => \Elementor\Controls_Manager::HEADING,
2207 'separator' => 'before',
2208 ]
2209 );
2210
2211 $this->add_control(
2212 'nft_price_color',
2213 [
2214 'label' => esc_html__('Color', 'embedpress'),
2215 'type' => \Elementor\Controls_Manager::COLOR,
2216 'selectors' => [
2217 '{{WRAPPER}} .ep_current_price span' => 'color: {{VALUE}}',
2218 ],
2219 ]
2220 );
2221
2222 $this->add_group_control(
2223 \Elementor\Group_Control_Typography::get_type(),
2224 [
2225 'name' => 'nft_price_typography',
2226 'selector' => '{{WRAPPER}} .ep_current_price span',
2227 ]
2228 );
2229 $this->add_control(
2230 'last_sale_heading',
2231 [
2232 'label' => esc_html__('Last Sale Price', 'embedpress'),
2233 'type' => \Elementor\Controls_Manager::HEADING,
2234 'separator' => 'before',
2235 ]
2236 );
2237
2238 $this->add_control(
2239 'nft_last_sale_color',
2240 [
2241 'label' => esc_html__('Color', 'embedpress'),
2242 'type' => \Elementor\Controls_Manager::COLOR,
2243 'selectors' => [
2244 '{{WRAPPER}} .ep_nft_last_sale span' => 'color: {{VALUE}}',
2245 ],
2246 ]
2247 );
2248 $this->add_group_control(
2249 \Elementor\Group_Control_Typography::get_type(),
2250 [
2251 'name' => 'nft_last_sale_typography',
2252 'selector' => '{{WRAPPER}} .ep_nft_last_sale span',
2253 ]
2254 );
2255 $this->add_control(
2256 'nftbutton_heading',
2257 [
2258 'label' => esc_html__('Button', 'embedpress'),
2259 'type' => \Elementor\Controls_Manager::HEADING,
2260 'separator' => 'before',
2261 ]
2262 );
2263
2264
2265 $this->add_control(
2266 'nftbutton_color',
2267 [
2268 'label' => esc_html__('Color', 'embedpress'),
2269 'type' => \Elementor\Controls_Manager::COLOR,
2270 'selectors' => [
2271 '{{WRAPPER}} .ep-nft-gallery-wrapper.ep-nft-gallery-r1a5mbx .ep_nft_button a' => 'color: {{VALUE}}',
2272 ],
2273 ]
2274 );
2275 $this->add_control(
2276 'nftbutton_bg_color',
2277 [
2278 'label' => esc_html__('Background Color', 'embedpress'),
2279 'type' => \Elementor\Controls_Manager::COLOR,
2280 'selectors' => [
2281 '{{WRAPPER}} .ep-nft-gallery-wrapper.ep-nft-gallery-r1a5mbx .ep_nft_button a' => 'background-color: {{VALUE}}',
2282 ],
2283 ]
2284 );
2285 $this->add_group_control(
2286 \Elementor\Group_Control_Typography::get_type(),
2287 [
2288 'name' => 'nftbutton_typography',
2289 'selector' => '{{WRAPPER}} .ep-nft-gallery-wrapper.ep-nft-gallery-r1a5mbx .ep_nft_button a',
2290 ]
2291 );
2292 $this->add_control(
2293 'nft_loadmore_style',
2294 [
2295 'label' => esc_html__('Load More', 'embedpress'),
2296 'type' => \Elementor\Controls_Manager::HEADING,
2297 'separator' => 'before',
2298 'condition' => [
2299 'loadmore' => 'yes',
2300 'embedpress_pro_embeded_nft_type' => 'collection'
2301 ]
2302 ]
2303 );
2304
2305 $this->add_control(
2306 'nft_loadmore_color',
2307 [
2308 'label' => esc_html__('Text Color', 'embedpress'),
2309 'type' => \Elementor\Controls_Manager::COLOR,
2310 'selectors' => [
2311 '{{WRAPPER}} .nft-loadmore' => 'color: {{VALUE}}!important;',
2312 '{{WRAPPER}} .nft-loadmore svg' => 'fill: {{VALUE}}!important;',
2313 ],
2314 'condition' => [
2315 'loadmore' => 'yes',
2316 'embedpress_pro_embeded_nft_type' => 'collection'
2317 ]
2318 ]
2319 );
2320 $this->add_group_control(
2321 \Elementor\Group_Control_Typography::get_type(),
2322 [
2323 'name' => 'nft_loadmore_typography',
2324 'selector' => '{{WRAPPER}} .nft-loadmore, {{WRAPPER}} .nft-loadmore svg',
2325 'condition' => [
2326 'loadmore' => 'yes',
2327 'embedpress_pro_embeded_nft_type' => 'collection'
2328 ]
2329 ]
2330 );
2331 $this->add_control(
2332 'nft_loadmore_bgcolor',
2333 [
2334 'label' => esc_html__('Background Color', 'embedpress'),
2335 'type' => \Elementor\Controls_Manager::COLOR,
2336 'selectors' => [
2337 '{{WRAPPER}} .nft-loadmore' => 'background-color: {{VALUE}}!important;',
2338 ],
2339 'condition' => [
2340 'loadmore' => 'yes',
2341 'embedpress_pro_embeded_nft_type' => 'collection'
2342 ]
2343 ]
2344 );
2345
2346 $this->add_control(
2347 'nftrank_heading',
2348 [
2349 'label' => esc_html__('Rank', 'embedpress'),
2350 'type' => \Elementor\Controls_Manager::HEADING,
2351 'separator' => 'before',
2352 'condition' => [
2353 'nftrank' => 'yes',
2354 'embedpress_pro_embeded_nft_type!' => 'collection'
2355 ]
2356 ]
2357 );
2358
2359 $this->add_control(
2360 'nftrank_label_color',
2361 [
2362 'label' => esc_html__('Label Color', 'embedpress'),
2363 'type' => \Elementor\Controls_Manager::COLOR,
2364 'selectors' => [
2365 '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper' => 'color: {{VALUE}}!important;',
2366 ],
2367 'condition' => [
2368 'nftrank' => 'yes',
2369 'embedpress_pro_embeded_nft_type!' => 'collection'
2370 ]
2371 ]
2372 );
2373 $this->add_group_control(
2374 \Elementor\Group_Control_Typography::get_type(),
2375 [
2376 'name' => 'nftrank_label_typography',
2377 'selector' => '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper ',
2378 'condition' => [
2379 'nftrank' => 'yes',
2380 'embedpress_pro_embeded_nft_type!' => 'collection'
2381 ]
2382 ]
2383 );
2384 $this->add_control(
2385 'nftrank_color',
2386 [
2387 'label' => esc_html__('Rank Color', 'embedpress'),
2388 'type' => \Elementor\Controls_Manager::COLOR,
2389 'selectors' => [
2390 '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper span.ep-nft-rank' => 'color: {{VALUE}}!important;',
2391 ],
2392 'condition' => [
2393 'nftrank' => 'yes',
2394 'embedpress_pro_embeded_nft_type!' => 'collection'
2395 ]
2396 ]
2397 );
2398 $this->add_control(
2399 'nftrank_border_color',
2400 [
2401 'label' => esc_html__('Border Color', 'embedpress'),
2402 'type' => \Elementor\Controls_Manager::COLOR,
2403 'selectors' => [
2404 '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper span.ep-nft-rank' => 'border-color: {{VALUE}}!important',
2405 ],
2406 'condition' => [
2407 'nftrank' => 'yes',
2408 'embedpress_pro_embeded_nft_type!' => 'collection'
2409 ]
2410 ]
2411 );
2412 $this->add_group_control(
2413 \Elementor\Group_Control_Typography::get_type(),
2414 [
2415 'name' => 'nftrank_typography',
2416 'selector' => '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper span.ep-nft-rank',
2417 'condition' => [
2418 'nftrank' => 'yes',
2419 'embedpress_pro_embeded_nft_type!' => 'collection'
2420 ]
2421 ]
2422 );
2423
2424
2425
2426 $this->add_control(
2427 'nftdetails_heading',
2428 [
2429 'label' => esc_html__('Details', 'embedpress'),
2430 'type' => \Elementor\Controls_Manager::HEADING,
2431 'separator' => 'before',
2432 'condition' => [
2433 'nftrank' => 'yes',
2434 'embedpress_pro_embeded_nft_type!' => 'collection'
2435 ]
2436 ]
2437 );
2438
2439 $this->add_control(
2440 'nftdetail_title_color',
2441 [
2442 'label' => esc_html__('Title Color', 'embedpress'),
2443 'type' => \Elementor\Controls_Manager::COLOR,
2444 'selectors' => [
2445 '{{WRAPPER}} .ep-title' => 'color: {{VALUE}}',
2446 ],
2447 'condition' => [
2448 'nftrank' => 'yes',
2449 'embedpress_pro_embeded_nft_type!' => 'collection'
2450 ]
2451 ]
2452 );
2453 $this->add_group_control(
2454 \Elementor\Group_Control_Typography::get_type(),
2455 [
2456 'label' => esc_html__('Title Typography', 'embedpress'),
2457 'name' => 'nftdetail_title_typography',
2458 'selector' => '{{WRAPPER}} .ep-title',
2459 'condition' => [
2460 'nftrank' => 'yes',
2461 'embedpress_pro_embeded_nft_type!' => 'collection'
2462 ]
2463 ]
2464 );
2465
2466 $this->add_control(
2467 'nftdetail_color',
2468 [
2469 'label' => esc_html__('Content Color', 'embedpress'),
2470 'type' => \Elementor\Controls_Manager::COLOR,
2471 'selectors' => [
2472 '{{WRAPPER}} .ep-asset-detail-item' => 'color: {{VALUE}}',
2473 ],
2474 'condition' => [
2475 'nftrank' => 'yes',
2476 'embedpress_pro_embeded_nft_type!' => 'collection'
2477 ]
2478 ]
2479 );
2480 $this->add_group_control(
2481 \Elementor\Group_Control_Typography::get_type(),
2482 [
2483 'label' => esc_html__('Content Typography', 'embedpress'),
2484 'name' => 'nftdetail_typography',
2485 'selector' => '{{WRAPPER}} .ep-asset-detail-item',
2486 'condition' => [
2487 'nftrank' => 'yes',
2488 'embedpress_pro_embeded_nft_type!' => 'collection'
2489 ]
2490 ]
2491 );
2492
2493 $this->add_control(
2494 'nftdetail_link_color',
2495 [
2496 'label' => esc_html__('Link Color', 'embedpress'),
2497 'type' => \Elementor\Controls_Manager::COLOR,
2498 'selectors' => [
2499 '{{WRAPPER}} .ep-asset-detail-item a' => 'color: {{VALUE}}',
2500 ],
2501 'condition' => [
2502 'nftrank' => 'yes',
2503 'embedpress_pro_embeded_nft_type!' => 'collection'
2504 ]
2505 ]
2506 );
2507 $this->add_group_control(
2508 \Elementor\Group_Control_Typography::get_type(),
2509 [
2510 'name' => 'nftdetail_link_typography',
2511 'selector' => '{{WRAPPER}} .ep-asset-detail-item a, .ep-asset-detail-item',
2512 'condition' => [
2513 'nftrank' => 'yes',
2514 'embedpress_pro_embeded_nft_type!' => 'collection'
2515 ]
2516 ]
2517 );
2518
2519
2520 $this->end_controls_section();
2521 }
2522 //End OpenSea controls
2523
2524 /**
2525 * Calendly Controls
2526 */
2527
2528 public function init_calendly_control_section(){
2529
2530 $condition = [
2531 'embedpress_pro_embeded_source' => 'calendly',
2532 ];
2533
2534 $this->start_controls_section(
2535 'embedpress_calendly_control_section',
2536 [
2537 'label' => __('Calendly Controls', 'embedpress'),
2538 'condition' => $condition,
2539 ]
2540 );
2541 $this->add_control(
2542 'cEmbedType',
2543 [
2544 'label' => __( 'Embed Type', 'embedpress' ),
2545 'type' => \Elementor\Controls_Manager::SELECT,
2546 'default' => 'inline',
2547 'options' => [
2548 'inline' => __( 'Inline', 'embedpress' ),
2549 'popup_button' => __( 'Popup Button', 'embedpress' ),
2550 ],
2551 'condition' => $condition
2552 ]
2553 );
2554 $this->add_control(
2555 'popupControlsHeadding',
2556 [
2557 'label' => esc_html__( 'Popup Button Settings', 'embedpress' ),
2558 'type' => \Elementor\Controls_Manager::HEADING,
2559 'separator' => 'before',
2560 'condition' => [
2561 'embedpress_pro_embeded_source' => 'calendly',
2562 'cEmbedType' => 'popup_button'
2563 ]
2564 ]
2565 );
2566 $this->add_control(
2567 'cPopupButtonText',
2568 [
2569 'label' => __( 'Button Text', 'embedpress' ),
2570 'type' => \Elementor\Controls_Manager::TEXT,
2571 'label_block' => true,
2572 'default' => 'Schedule time with me',
2573 'condition' => [
2574 'embedpress_pro_embeded_source' => 'calendly',
2575 'cEmbedType' => 'popup_button'
2576 ],
2577 'ai' => [
2578 'active' => false,
2579 ],
2580 ]
2581 );
2582
2583
2584 $this->add_control(
2585 'cPopupButtonTextColor',
2586 [
2587 'label' => __( 'Text Color', 'embedpress' ),
2588 'type' => \Elementor\Controls_Manager::COLOR,
2589 'default' => '#ffffff',
2590 'condition' => [
2591 'embedpress_pro_embeded_source' => 'calendly',
2592 'cEmbedType' => 'popup_button'
2593 ]
2594 ]
2595 );
2596 $this->add_control(
2597 'cPopupButtonBGColor',
2598 [
2599 'label' => __( 'Background Color', 'embedpress' ),
2600 'type' => \Elementor\Controls_Manager::COLOR,
2601 'default' => '#0000FF',
2602 'condition' => [
2603 'embedpress_pro_embeded_source' => 'calendly',
2604 'cEmbedType' => 'popup_button'
2605 ]
2606 ]
2607 );
2608
2609 $this->add_control(
2610 'calendlyControlsHeadding',
2611 [
2612 'label' => esc_html__( 'Calender Settings', 'embedpress' ),
2613 'type' => \Elementor\Controls_Manager::HEADING,
2614 'separator' => 'before',
2615 ]
2616 );
2617
2618 $this->add_control(
2619 'calendlyData',
2620 [
2621 'label' => sprintf(__('Calendly Data %s', 'embedpress'), $this->pro_text),
2622 'type' => \Elementor\Controls_Manager::SWITCHER,
2623 'default' => '',
2624 'classes' => $this->pro_class,
2625 'condition' => $condition
2626 ]
2627 );
2628
2629 $this->add_control(
2630 'calendlyDataLink',
2631 [
2632 'type' => \Elementor\Controls_Manager::RAW_HTML,
2633 'raw' => '<div style="display: flex; align-items: center;gap:5px;"><span style="font-size:18px" class="eicon-editor-external-link"></span><a href="/wp-admin/admin.php?page=embedpress&page_type=calendly" target="_blank" >View Calendly Data</a></div>',
2634 'condition' => [
2635 'calendlyData' => 'yes'
2636 ]
2637
2638 ]
2639 );
2640
2641 $this->add_control(
2642 'hideCookieBanner',
2643 [
2644 'label' => __( 'Hide Cookie Banner', 'embedpress' ),
2645 'type' => \Elementor\Controls_Manager::SWITCHER,
2646 'default' => '',
2647 'condition' => $condition
2648 ]
2649 );
2650 $this->add_control(
2651 'hideEventTypeDetails',
2652 [
2653 'label' => __( 'Hide Event Type Details', 'embedpress' ),
2654 'type' => \Elementor\Controls_Manager::SWITCHER,
2655 'default' => '',
2656 'condition' => $condition
2657 ]
2658 );
2659
2660 $this->add_control(
2661 'cBackgroundColor',
2662 [
2663 'label' => __( 'Background Color', 'embedpress' ),
2664 'type' => \Elementor\Controls_Manager::COLOR,
2665 'default' => '',
2666 'condition' => $condition
2667 ]
2668 );
2669
2670 $this->add_control(
2671 'cTextColor',
2672 [
2673 'label' => __( 'Text Color', 'embedpress' ),
2674 'type' => \Elementor\Controls_Manager::COLOR,
2675 'default' => '',
2676 'condition' => $condition
2677 ]
2678 );
2679
2680 $this->add_control(
2681 'cButtonLinkColor',
2682 [
2683 'label' => __( 'Button & Link Color', 'embedpress' ),
2684 'type' => \Elementor\Controls_Manager::COLOR,
2685 'default' => '',
2686 'condition' => $condition
2687 ]
2688 );
2689
2690 $this->end_controls_section();
2691
2692 }
2693
2694 //End calendly controlS
2695
2696 public function init_style_controls()
2697 {
2698 $this->start_controls_section(
2699 'embedpress_style_section',
2700 [
2701 'label' => __('General', 'embedpress'),
2702 'tab' => Controls_Manager::TAB_STYLE,
2703 'condition' => [
2704 'embedpress_pro_embeded_source!' => 'opensea',
2705 ]
2706
2707 ]
2708 );
2709 $this->add_responsive_control(
2710 'width',
2711 [
2712 'label' => __('Width', 'embedpress'),
2713 'type' => Controls_Manager::SLIDER,
2714 'size_units' => ['px'],
2715 'range' => [
2716 'px' => [
2717 'min' => 0,
2718 'max' => 1500,
2719 'step' => 1,
2720 ],
2721 ],
2722 'devices' => [ 'desktop', 'tablet', 'mobile' ],
2723 'default' => [
2724 'size' => 600,
2725 'unit' => 'px',
2726 ],
2727 'desktop_default' => [
2728 'size' => 600,
2729 'unit' => 'px',
2730 ],
2731 'tablet_default' => [
2732 'size' => 600,
2733 'unit' => 'px',
2734 ],
2735 'mobile_default' => [
2736 'size' => 600,
2737 'unit' => 'px',
2738 ],
2739 'selectors' => [
2740 '{{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive>iframe,{{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive, {{WRAPPER}} .ad-youtube-video > iframe
2741 ' => 'width: {{size}}{{UNIT}}!important; max-width: 100%!important;',
2742 ],
2743 ]
2744 );
2745
2746 $this->add_responsive_control(
2747 'height',
2748 [
2749 'label' => __('Height', 'embedpress'),
2750 'type' => Controls_Manager::SLIDER,
2751 'size_units' => ['px'],
2752 'range' => [
2753 'px' => [
2754 'min' => 0,
2755 'max' => 1500,
2756 'step' => 1,
2757 ],
2758 ],
2759 'devices' => [ 'desktop', 'tablet', 'mobile' ],
2760 'desktop_default' => [
2761 'size' => 400,
2762 'unit' => 'px',
2763 ],
2764 'default' => [
2765 'size' => 400,
2766 'unit' => 'px',
2767 ],
2768 'tablet_default' => [
2769 'size' => 400,
2770 'unit' => 'px',
2771 ],
2772 'mobile_default' => [
2773 'size' => 400,
2774 'unit' => 'px',
2775 ],
2776 'selectors' => [
2777 '{{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive>iframe, {{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive,{{WRAPPER}} .ad-youtube-video > iframe
2778 ' => 'height: {{size}}{{UNIT}}!important;max-height: 100%!important',
2779 ],
2780 ]
2781 );
2782 $this->add_control(
2783 'width_height_important_note',
2784 [
2785 'type' => \Elementor\Controls_Manager::RAW_HTML,
2786 'raw' => esc_html__('Note: The maximum width and height are set to 100%.', 'embedpress'),
2787 'content_classes' => 'elementor-panel-alert elementor-panel-warning-info',
2788 ]
2789 );
2790 $this->add_responsive_control(
2791 'margin',
2792 [
2793 'label' => __('Margin', 'embedpress'),
2794 'type' => Controls_Manager::DIMENSIONS,
2795 'size_units' => ['px', '%', 'em'],
2796 'selectors' => [
2797 '{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2798 ],
2799 ]
2800 );
2801 $this->add_responsive_control(
2802 'padding',
2803 [
2804 'label' => __('Padding', 'embedpress'),
2805 'type' => Controls_Manager::DIMENSIONS,
2806 'size_units' => ['px', '%', 'em'],
2807 'selectors' => [
2808 '{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2809 ],
2810 ]
2811 );
2812 $this->add_responsive_control(
2813 'align',
2814 [
2815 'label' => esc_html__('Alignment', 'embedpress'),
2816 'type' => Controls_Manager::CHOOSE,
2817 'options' => [
2818 'left' => [
2819 'title' => esc_html__('Left', 'embedpress'),
2820 'icon' => 'eicon-text-align-left',
2821 ],
2822 'center' => [
2823 'title' => esc_html__('Center', 'embedpress'),
2824 'icon' => 'eicon-text-align-center',
2825 ],
2826 'right' => [
2827 'title' => esc_html__('Right', 'embedpress'),
2828 'icon' => 'eicon-text-align-right',
2829 ],
2830 ],
2831 'prefix_class' => 'elementor%s-align-',
2832 'default' => '',
2833 ]
2834 );
2835 $this->end_controls_section();
2836 }
2837
2838 public function render_plain_content()
2839 {
2840 $args = "";
2841 $settings = $this->get_settings_for_display();
2842
2843 $_settings = $this->convert_settings($settings);
2844 foreach ($_settings as $key => $value) {
2845 $args .= "$key='$value' ";
2846 }
2847
2848 $args = trim($args);
2849 echo "[embedpress $args]{$settings['embedpress_embeded_link']}\[/embedpress]";
2850 }
2851
2852 public function get_custom_player_options($settings)
2853 {
2854
2855 $_player_options = '';
2856
2857 if (!empty($settings['emberpress_custom_player'])) {
2858
2859 $player_preset = !empty($settings['custom_payer_preset']) ? $settings['custom_payer_preset'] : 'preset-default';
2860
2861 $player_color = !empty($settings['embedpress_player_color']) ? $settings['embedpress_player_color'] : '';
2862
2863 $poster_thumbnail = !empty($settings['embedpress_player_poster_thumbnail']['url']) ? $settings['embedpress_player_poster_thumbnail']['url'] : '';
2864
2865 $is_self_hosted = Helper::check_media_format($settings['embedpress_embeded_link']);
2866
2867
2868 $player_pip = !empty($settings['embepress_player_always_on_top']) ? true : false;
2869 $player_restart = !empty($settings['embepress_player_restart']) ? true : false;
2870 $player_rewind = !empty($settings['embepress_player_rewind']) ? true : false;
2871 $player_fastForward = !empty($settings['embepress_player_fast_forward']) ? true : false;
2872 $player_tooltip = !empty($settings['embepress_player_tooltip']) ? true : false;
2873 $player_hide_controls = !empty($settings['embepress_player_hide_controls']) ? true : false;
2874 $player_download = !empty($settings['embepress_player_download']) ? true : false;
2875 $player_fullscreen = !empty($settings['embedpress_pro_youtube_enable_fullscreen_button']) ? true : false;
2876
2877 $playerOptions = [
2878 'rewind' => $player_rewind,
2879 'restart' => $player_restart,
2880 'pip' => $player_pip,
2881 'poster_thumbnail' => $poster_thumbnail,
2882 'player_color' => $player_color,
2883 'player_preset' => $player_preset,
2884 'fast_forward' => $player_fastForward,
2885 'player_tooltip' => $player_tooltip,
2886 'hide_controls' => $player_hide_controls,
2887 'download' => $player_download,
2888 'fullscreen' => $player_fullscreen,
2889 ];
2890
2891
2892 //Youtube options
2893 if (!empty($settings['embedpress_pro_video_start_time'])) {
2894 $playerOptions['start'] = $settings['embedpress_pro_video_start_time'];
2895 }
2896 if (!empty($settings['embedpress_pro_youtube_end_time'])) {
2897 $playerOptions['end'] = $settings['embedpress_pro_youtube_end_time'];
2898 }
2899 if (!empty($settings['embedpress_pro_youtube_display_related_videos'])) {
2900 $playerOptions['rel'] = true;
2901 } else {
2902 $playerOptions['rel'] = false;
2903 }
2904
2905 //vimeo options
2906 if (!empty($settings['embedpress_pro_video_start_time'])) {
2907 $playerOptions['t'] = $settings['embedpress_pro_video_start_time'];
2908 }
2909 if (!empty($settings['embedpress_pro_vimeo_auto_play'])) {
2910 $playerOptions['vautoplay'] = true;
2911 } else {
2912 $playerOptions['vautoplay'] = false;
2913 }
2914 if (!empty($settings['embedpress_pro_vimeo_autopause'])) {
2915 $playerOptions['autopause'] = true;
2916 } else {
2917 $playerOptions['autopause'] = false;
2918 }
2919
2920 if (!empty($settings['embedpress_pro_vimeo_dnt'])) {
2921 $playerOptions['dnt'] = true;
2922 } else {
2923 $playerOptions['dnt'] = false;
2924 }
2925
2926 if (!empty($is_self_hosted['selhosted'])) {
2927 $playerOptions['self_hosted'] = $is_self_hosted['selhosted'];
2928 $playerOptions['hosted_format'] = $is_self_hosted['format'];
2929 }
2930
2931 $playerOptionsString = json_encode($playerOptions);
2932 $_player_options = 'data-options=\'' . htmlentities($playerOptionsString, ENT_QUOTES) . '\'';
2933 }
2934
2935 return $_player_options;
2936 }
2937
2938 protected function convert_settings($settings)
2939 {
2940 $_settings = [];
2941 foreach ($settings as $key => $value) {
2942 if (empty($value)) {
2943 $_settings[$key] = 'false';
2944 } else if (!empty($value['size'])) {
2945 $_settings[$key] = $value['size'];
2946 } else if (!empty($value['url'])) {
2947 $_settings[$key] = $value['url'];
2948 } else if (\is_scalar($value)) {
2949 $_settings[$key] = $value;
2950 }
2951 }
2952
2953 return $_settings;
2954 }
2955
2956
2957
2958 protected function render()
2959 {
2960
2961 add_filter('embedpress_should_modify_spotify', '__return_false');
2962 $settings = $this->get_settings_for_display();
2963
2964 $is_editor_view = Plugin::$instance->editor->is_edit_mode();
2965 $link = $settings['embedpress_embeded_link'];
2966 $is_apple_podcast = (strpos($link, 'podcasts.apple.com') !== false);
2967
2968 // conditionaly convert settings data
2969 $_settings = [];
2970 $source = isset($settings['embedpress_pro_embeded_source']) ? $settings['embedpress_pro_embeded_source'] : 'default';
2971 $embed_link = isset($settings['embedpress_embeded_link']) ? $settings['embedpress_embeded_link'] : '';
2972 $pass_hash_key = isset($settings['embedpress_lock_content_password']) ? md5($settings['embedpress_lock_content_password']) : '';
2973
2974
2975
2976 Helper::get_source_data(md5($this->get_id()) . '_eb_elementor', $embed_link, 'elementor_source_data', 'elementor_temp_source_data');
2977
2978 if (!(($source === 'default' || !empty($source[0]) && $source[0] === 'default') && strpos($embed_link, 'opensea.io') !== false)) {
2979 $_settings = $this->convert_settings($settings);
2980 }
2981
2982 if (strpos($embed_link, 'opensea.io') !== false) {
2983 $source = 'opensea';
2984 }
2985
2986
2987 $embed_content = Shortcode::parseContent($settings['embedpress_embeded_link'], true, $_settings);
2988 $embed_content = $this->onAfterEmbedSpotify($embed_content, $settings);
2989 $embed = apply_filters('embedpress_elementor_embed', $embed_content, $settings);
2990 $content = is_object($embed) ? $embed->embed : $embed;
2991
2992 $embed_settings = [];
2993 $embed_settings['customThumbnail'] = !empty($settings['embedpress_content_share_custom_thumbnail']['url']) ? $settings['embedpress_content_share_custom_thumbnail']['url'] : '';
2994
2995 $embed_settings['customTitle'] = !empty($settings['embedpress_content_title']) ? $settings['embedpress_content_title'] : Helper::get_file_title($embed_link);
2996
2997 $embed_settings['customDescription'] = !empty($settings['embedpress_content_descripiton']) ? $settings['embedpress_content_descripiton'] : Helper::get_file_title($embed_link);
2998
2999 $embed_settings['sharePosition'] = !empty($settings['embedpress_content_share_position']) ? $settings['embedpress_content_share_position'] : 'right';
3000
3001 $embed_settings['lockHeading'] = !empty($settings['embedpress_lock_content_heading']) ? $settings['embedpress_lock_content_heading'] : '';
3002
3003 $embed_settings['lockSubHeading'] = !empty($settings['embedpress_lock_content_sub_heading']) ? $settings['embedpress_lock_content_sub_heading'] : '';
3004
3005 $embed_settings['passwordPlaceholder'] = !empty($settings['embedpress_password_placeholder']) ? $settings['embedpress_password_placeholder'] : '';
3006
3007 $embed_settings['submitButtonText'] = !empty($settings['embedpress_submit_button_text']) ? $settings['embedpress_submit_button_text'] : '';
3008
3009 $embed_settings['submitUnlockingText'] = !empty($settings['embedpress_submit_Unlocking_text']) ? $settings['embedpress_submit_Unlocking_text'] : '';
3010
3011 $embed_settings['lockErrorMessage'] = !empty($settings['embedpress_lock_content_error_message']) ? $settings['embedpress_lock_content_error_message'] : '';
3012
3013 $embed_settings['enableFooterMessage'] = !empty($settings['embedpress_enable_footer_message']) ? $settings['embedpress_enable_footer_message'] : '';
3014
3015 $embed_settings['footerMessage'] = !empty($settings['embedpress_lock_content_footer_message']) ? $settings['embedpress_lock_content_footer_message'] : '';
3016
3017
3018 $client_id = $this->get_id();
3019 $hash_pass = hash('sha256', wp_salt(32) . md5($settings['embedpress_lock_content_password']?$settings['embedpress_lock_content_password'] : ''));
3020
3021 $password_correct = isset($_COOKIE['password_correct_'.$client_id]) ? $_COOKIE['password_correct_'.$client_id] : '';
3022
3023 $ispagination = 'flex';
3024
3025 if ($settings['pagination'] != 'show') {
3026 $ispagination = 'none';
3027 }
3028
3029 if (!empty($settings['columns']) && (int) $settings['columns'] > 0) {
3030 $calVal = 'calc(' . (100 / (int) $settings['columns']) . '% - ' . $settings['gapbetweenvideos']['size'] . 'px)';
3031 } else {
3032 $calVal = 'auto';
3033 }
3034
3035 $content_share_class = '';
3036 $share_position_class = '';
3037 $share_position = isset($settings['embedpress_content_share_position']) ? $settings['embedpress_content_share_position'] : 'right';
3038
3039 if (!empty($settings['embedpress_content_share'])) {
3040 $content_share_class = 'ep-content-share-enabled';
3041 $share_position_class = 'ep-share-position-' . $share_position;
3042 }
3043
3044 $content_protection_class = 'ep-content-protection-enabled';
3045 if (empty($settings['embedpress_lock_content']) || empty($settings['embedpress_lock_content_password']) || $hash_pass === $password_correct) {
3046 $content_protection_class = 'ep-content-protection-disabled';
3047 }
3048
3049 $cEmbedType = !empty($settings['cEmbedType']) ? $settings['cEmbedType'] : '';
3050
3051 $adsAtts = '';
3052
3053 if(!empty($settings['adManager'])) {
3054 $ad = base64_encode(json_encode($settings));
3055 $adsAtts = "data-ad-id=$client_id data-ad-attrs=$ad class=ad-mask";
3056 }
3057
3058 $data_player_id = '';
3059 if(!empty($settings['emberpress_custom_player']) === 'yes') {
3060 $data_player_id = "data-playerid=".$this->get_id();
3061 }
3062
3063 ?>
3064
3065 <div class="embedpress-elements-wrapper <?php echo !empty($settings['embedpress_elementor_aspect_ratio']) ? 'embedpress-fit-aspect-ratio' : ''; echo esc_attr( $cEmbedType );?>" id="ep-elements-id-<?php echo $this->get_id(); ?>">
3066 <?php
3067 // handle notice display
3068 if ($is_editor_view && $is_apple_podcast && !is_embedpress_pro_active()) {
3069 ?>
3070 <p><?php esc_html_e('You need EmbedPress Pro to Embed Apple Podcast. Note. This message is only visible to you.', 'embedpress'); ?></p>
3071 <?php
3072 } else { ?>
3073
3074 <div id="ep-elementor-content-<?php echo esc_attr($client_id) ?>" class="ep-elementor-content <?php if (!empty($settings['embedpress_content_share'])) : echo esc_attr('position-' . $settings['embedpress_content_share_position'] . '-wraper');
3075 endif; ?> <?php echo esc_attr($content_share_class . ' ' . $share_position_class . ' ' . $content_protection_class);
3076 echo esc_attr(' source-' . $source); ?>">
3077 <div <?php echo esc_attr( $adsAtts ); ?>>
3078 <div id="<?php echo esc_attr($this->get_id()); ?>" class="ep-embed-content-wraper <?php echo esc_attr($settings['custom_payer_preset']); ?>" <?php echo esc_attr($data_player_id); ?> <?php echo $this->get_custom_player_options($settings); ?>>
3079 <?php
3080 $content_id = $client_id;
3081
3082 if ((empty($settings['embedpress_lock_content']) || empty($settings['embedpress_lock_content_password']) || $settings['embedpress_lock_content'] == 'no') || (!empty(Helper::is_password_correct($client_id)) && ($hash_pass === $password_correct))) {
3083
3084 if (!empty($settings['embedpress_content_share'])) {
3085 $content .= Helper::embed_content_share($content_id, $embed_settings);
3086 }
3087 echo $content;
3088 } else {
3089 if (!empty($settings['embedpress_content_share'])) {
3090 $content .= Helper::embed_content_share($content_id, $embed_settings);
3091 }
3092 Helper::display_password_form($client_id, $content, $pass_hash_key, $embed_settings);
3093 }
3094 ?>
3095 </div>
3096 <?php
3097
3098 if(!empty($settings['adManager'])) {
3099 $content .= Helper::generateAdTemplate($client_id, $settings, 'elementor');
3100 }
3101 ?>
3102 </div>
3103 </div>
3104 <?php
3105 }
3106 ?>
3107 </div>
3108
3109
3110 <?php if ($settings['embedpress_pro_embeded_source'] === 'youtube') : ?>
3111 <style>
3112 #ep-elements-id-<?php echo esc_html($this->get_id()); ?>.ep-youtube__content__block .youtube__content__body .content__wrap {
3113 grid-template-columns: repeat(auto-fit, minmax(<?php echo esc_html($calVal); ?>, 1fr)) !important;
3114 }
3115
3116 #ep-elements-id-<?php echo esc_html($this->get_id()); ?>.ep-youtube__content__pagination {
3117 display: <?php echo esc_html($ispagination); ?> !important;
3118 }
3119 </style>
3120 <?php endif; ?>
3121
3122 <?php
3123 }
3124 public function onAfterEmbedSpotify($embed, $setting)
3125 {
3126 if (!isset($embed->provider_name) || strtolower($embed->provider_name) !== 'spotify' || !isset($embed->embed)) {
3127 return $embed;
3128 }
3129 $match = array();
3130 preg_match('/src=\"(.+?)\"/', $embed->embed, $match);
3131 if (empty($match)) {
3132 return $embed;
3133 }
3134 $url_full = $match[1];
3135 $modified_url = str_replace('playlist-v2', 'playlist', $url_full);
3136 if (isset($setting['spotify_theme'])) {
3137 if (strpos($modified_url, '?') !== false) {
3138 $modified_url .= '&theme=' . sanitize_text_field($setting['spotify_theme']);
3139 } else {
3140 $modified_url .= '?theme=' . sanitize_text_field($setting['spotify_theme']);
3141 }
3142 }
3143 $embed->embed = str_replace($url_full, $modified_url, $embed->embed);
3144 return $embed;
3145 }
3146 }
3147