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