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