PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents / 4.2.4
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents v4.2.4
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 1 year ago Embedpress_Document.php 1 year ago Embedpress_Elementor.php 1 year ago Embedpress_Pdf.php 1 year ago
Embedpress_Elementor.php
4553 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 protected $pro_label = '';
23 public function get_name()
24 {
25 return 'embedpres_elementor';
26 }
27
28 public function get_title()
29 {
30 return esc_html__('EmbedPress', 'embedpress');
31 }
32
33 public function get_categories()
34 {
35 return ['embedpress'];
36 }
37
38 public function get_custom_help_url()
39 {
40 return 'https://embedpress.com/documentation';
41 }
42
43 public function get_icon()
44 {
45 return 'icon-embedpress';
46 }
47
48 public function get_style_depends() {
49 $handler_keys = get_option('enabled_elementor_scripts', []);
50
51 $handles = [];
52
53 if (isset($handler_keys['enabled_custom_player']) && $handler_keys['enabled_custom_player'] === 'yes') {
54 $handles[] = 'plyr';
55 }
56 if (isset($handler_keys['enabled_instafeed']) && $handler_keys['enabled_instafeed'] === 'yes') {
57 $handles[] = 'cg-carousel';
58 }
59
60 $handles[] = 'embedpress-elementor-css';
61 $handles[] = 'embedpress-style';
62
63
64 return $handles;
65 }
66
67
68
69 public function get_script_depends()
70 {
71 $handler_keys = get_option('enabled_elementor_scripts', []);
72
73 $handles = [];
74
75 if (isset($handler_keys['enabled_custom_player']) && $handler_keys['enabled_custom_player'] === 'yes') {
76 $handles[] = 'plyr.polyfilled';
77 $handles[] = 'initplyr';
78 $handles[] = 'vimeo-player';
79 }
80 $handles[] = 'embedpress-front';
81
82 if (isset($handler_keys['enabled_ads']) && $handler_keys['enabled_ads'] === 'yes') {
83 $handles[] = 'embedpress-ads';
84 }
85
86 if (isset($handler_keys['enabled_instafeed']) && $handler_keys['enabled_instafeed'] === 'yes') {
87 $handles[] = 'cg-carousel';
88 }
89
90 return $handles;
91 }
92
93
94 /**
95 * Get widget keywords.
96 *
97 * Retrieve the list of keywords the widget belongs to.
98 *
99 * @return array Widget keywords.
100 * @since 2.4.1
101 * @access public
102 *
103 */
104 public function get_keywords()
105 {
106 return [
107 'embedpress',
108 'audio',
109 'video',
110 'map',
111 'youtube',
112 'vimeo',
113 'wistia',
114 'twitch',
115 'soundcloud',
116 'giphy gifs',
117 'spotify',
118 'smugmug',
119 'meetup',
120 'apple',
121 'apple podcast',
122 'podcast',
123 'dailymotion',
124 'instagram',
125 'slideshare',
126 'flickr',
127 'ted',
128 'google docs',
129 'google slides',
130 'google drawings'
131 ];
132 }
133
134
135
136 protected function register_controls()
137 {
138 $class = 'embedpress-pro-control not-active';
139 $text = '<sup class="embedpress-pro-label" style="color:red">' . __('(Pro)', 'embedpress') . '</sup>';
140 $label = '(pro)';
141 $this->pro_class = apply_filters('embedpress/pro_class', $class);
142 $this->pro_label = apply_filters('embedpress/pro_label', $label);
143 $this->pro_text = apply_filters('embedpress/pro_text', $text);
144
145 /**
146 * EmbedPress General Settings
147 */
148 $this->start_controls_section(
149 'embedpress_elementor_content_settings',
150 [
151 'label' => esc_html__('General', 'embedpress'),
152 ]
153 );
154
155 $this->add_control(
156 'instafeed_access_token_notice',
157 [
158 'type' => \Elementor\Controls_Manager::RAW_HTML,
159 'raw' => sprintf('%s <a href="%s" target="_blank">here</a>.',
160 esc_html__('To enable full Instagram embedding experience, please add your access token ', 'embedpress'),
161 esc_url(admin_url('/admin.php?page=embedpress&page_type=instagram'))
162 ),
163 'content_classes' => 'elementor-panel-alert elementor-panel-warning-info',
164 'condition' => [
165 'embedpress_pro_embeded_source' => 'instafeed',
166 ],
167 ]
168 );
169
170
171
172 do_action('embedpress/embeded/extend', $this);
173 $this->add_control(
174 'embedpress_pro_embeded_source',
175 [
176 'label' => __('Source Name', 'embedpress'),
177 'type' => Controls_Manager::SELECT2,
178 'label_block' => false,
179 'default' => 'default',
180 'options' => [
181 'default' => __('Default', 'embedpress'),
182 'youtube' => __('YouTube', 'embedpress'),
183 'vimeo' => __('Vimeo', 'embedpress'),
184 'instafeed' => __('Instagram Feed', 'embedpress'),
185 'twitch' => __('Twitch', 'embedpress'),
186 'soundcloud' => __('SoundCloud', 'embedpress'),
187 'dailymotion' => __('Dailymotion', 'embedpress'),
188 'wistia' => __('Wistia', 'embedpress'),
189 'calendly' => __('Calendly', 'embedpress'),
190 'opensea' => __('OpenSea', 'embedpress'),
191 'spreaker' => __('Spreaker', 'embedpress'),
192 'google_photos' => __('Google Photos', 'embedpress'),
193 'selfhosted_video' => __('Self-hosted Video', 'embedpress'),
194 'selfhosted_audio' => __('Self-hosted Audio', 'embedpress'),
195 ]
196
197 ]
198 );
199
200
201 $this->add_control(
202 'instafeedFeedType',
203 [
204 'type' => \Elementor\Controls_Manager::SELECT,
205 'label' => esc_html__( 'Feed Type', 'embedpress' ),
206 'options' => [
207 'user_account_type' => esc_html__( 'User Account', 'embedpress' ),
208 'hashtag_type' => sprintf(__('Hashtag%s', 'embedpress'), $this->pro_label),
209 'tagged_type' => esc_html__( 'Tagged(Coming Soon)', 'embedpress' ),
210 'mixed_type' => esc_html__( 'Mixed(Coming Soon)', 'embedpress' ),
211 ],
212 'default' => 'user_account_type',
213 'condition' => [
214 'embedpress_pro_embeded_source' => 'instafeed',
215 ]
216 ]
217 );
218
219 if ( !apply_filters('embedpress/is_allow_rander', false) ) {
220 $this->add_control(
221 'embedpress_insta_layout__pro_enable_warning_1',
222 [
223 'label' => sprintf( '<a style="color: red" target="_blank" href="https://wpdeveloper.com/in/upgrade-embedpress">%s</a>',
224 esc_html__( 'Only Available in Pro Version!', 'essential-addons-for-elementor-lite' ) ),
225 'type' => Controls_Manager::RAW_HTML,
226 'condition' => [
227 'instafeedFeedType' => [ 'hashtag_type'],
228 ],
229 ]
230 );
231 }
232
233 $this->add_control(
234 'instafeedAccountType',
235 [
236 'type' => \Elementor\Controls_Manager::SELECT,
237 'label' => esc_html__( 'Account Type', 'embedpress' ),
238 'options' => [
239 'personal' => esc_html__( 'Personal', 'embedpress' ),
240 'business' => esc_html__( 'Business', 'embedpress' ),
241 ],
242 'default' => 'personal',
243 'condition' => [
244 'instafeedFeedType' => 'user_account_type',
245 'embedpress_pro_embeded_source' => 'instafeed'
246 ]
247 ]
248 );
249
250 $this->add_control(
251 'instafeed_feed_type_important_note',
252 [
253 'type' => \Elementor\Controls_Manager::RAW_HTML,
254 'raw' => 'To embed #hashtag posts you need to connect bussiness account. <a href="'.esc_url('https://embedpress.com/docs/generate-instagram-access-token/').'">Learn More</a>',
255 'content_classes' => 'elementor-panel-alert elementor-panel-warning-info',
256 'condition' => [
257 'instafeedFeedType' => 'hashtag_type',
258 ],
259 ]
260 );
261
262 $this->add_control(
263 'embedpress_pro_embeded_nft_type',
264 [
265 'label' => __('Type', 'embedpress'),
266 'type' => Controls_Manager::SELECT,
267 'label_block' => false,
268 'default' => 'collection',
269 'options' => [
270 'collection' => __('Assets Collection', 'embedpress'),
271 'single' => __('Single Asset', 'embedpress'),
272 ],
273 'condition' => [
274 'embedpress_pro_embeded_source' => 'opensea'
275 ]
276 ]
277 );
278
279 $this->add_control(
280 'embedpress_embeded_link',
281 [
282
283 'label' => __('Embedded Link', 'embedpress'),
284 'type' => Controls_Manager::TEXT,
285 'dynamic' => [
286 'active' => true,
287 ],
288 'placeholder' => __('Enter your Link', 'embedpress'),
289 'label_block' => true,
290 'ai' => [
291 'active' => false,
292 ],
293 'condition' => [
294 'instafeedAccountType!' => 'hashtag'
295 ]
296
297 ]
298 );
299
300 $this->add_control(
301 'embedpress_audio_video_auto_pause',
302 [
303 'label' => __('Auto Pause', 'embedpress'),
304 'description' => __('Set it to "Yes" to display related videos from all channels. Otherwise, related videos will show from the same channel.', 'embedpress'),
305 'type' => Controls_Manager::SWITCHER,
306 'label_block' => false,
307 'return_value' => 'yes',
308 'default' => 'yes',
309 'condition' => [
310 'embedpress_pro_embeded_source' => ['selfhosted_video', 'selfhosted_audio']
311 ],
312 ]
313 );
314
315 $this->add_control(
316 'spotify_theme',
317 [
318 'label' => __('Player Background', 'embedpress'),
319 'description' => __('Dynamic option will use the most vibrant color from the album art.', 'embedpress'),
320 'type' => Controls_Manager::SELECT,
321 'label_block' => false,
322 'default' => '1',
323 'options' => [
324 '1' => __('Dynamic', 'embedpress'),
325 '0' => __('Black & White', 'embedpress')
326 ],
327 'condition' => [
328 'embedpress_pro_embeded_source' => 'spotify'
329 ]
330 ]
331 );
332 do_action('embedpress/control/extend', $this);
333
334 $this->add_control(
335 'emberpress_custom_player',
336 [
337 'label' => __('Enable Custom Player', 'embedpress'),
338 'type' => Controls_Manager::SWITCHER,
339 'label_block' => false,
340 'return_value' => 'yes',
341 'default' => '',
342 'condition' => [
343 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'selfhosted_video', 'selfhosted_audio']
344 ],
345 ]
346 );
347
348 $this->add_control(
349 'custom_player_important_note',
350 [
351 'type' => \Elementor\Controls_Manager::RAW_HTML,
352 'raw' => esc_html__('Custom player take effect only when a single video is embedded.', 'embedpress'),
353 'content_classes' => 'elementor-panel-alert elementor-panel-warning-info',
354 'condition' => [
355 'emberpress_custom_player' => 'yes',
356 'embedpress_pro_embeded_source' => 'youtube',
357 ],
358 ]
359 );
360
361 $this->add_control(
362 'custom_payer_preset',
363 [
364 'label' => sprintf(__('Preset %s', 'embedpress'), $this->pro_text),
365
366 'type' => Controls_Manager::SELECT,
367 'label_block' => false,
368 'default' => 'default',
369 'options' => [
370 'default' => __('Default', 'embedpress'),
371 'custom-player-preset-1' => __('Preset 1', 'embedpress'),
372 // 'custom-player-preset-2' => __('Preset 2', 'embedpress'),
373 'custom-player-preset-3' => __('Preset 2', 'embedpress'),
374 // 'custom-player-preset-4' => __('Preset 4', 'embedpress'),
375 ],
376 'classes' => $this->pro_class,
377 'condition' => [
378 'emberpress_custom_player' => 'yes',
379 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'selfhosted_video']
380 ],
381 ]
382 );
383
384 $this->add_control(
385 'embedpress_pro_video_start_time',
386 [
387 'label' => __('Start Time', 'embedpress'),
388 'type' => Controls_Manager::NUMBER,
389 'description' => __('Specify a start time (in seconds)', 'embedpress'),
390 'condition' => [
391 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'wistia', 'dailymotion', 'twitch']
392 ],
393 ]
394 );
395
396
397
398
399 /**
400 * Initialized controls
401 */
402 $this->init_youtube_controls();
403 $this->init_vimeo_controls();
404
405 $this->init_wistia_controls();
406 $this->init_soundcloud_controls();
407 $this->init_dailymotion_control();
408 $this->init_twitch_control();
409 $this->init_opensea_control();
410 $this->end_controls_section();
411
412
413 $this->init_youtube_channel_section();
414 $this->init_youtube_subscription_section();
415 $this->init_youtube_livechat_section();
416
417
418 /**
419 * Opensea Control section
420 */
421 $this->init_opensea_control_section();
422 $this->init_instafeed_control_section();
423
424 /**
425 * Calendly Control section
426 */
427 $this->init_calendly_control_section();
428
429 /**
430 * Spreaker Control section
431 */
432 $this->init_spreaker_control_section();
433
434 $this->init_google_photos_control_setion();
435
436
437
438 do_action('extend_elementor_controls', $this, '_', $this->pro_text, $this->pro_class);
439
440 $this->init_style_controls();
441 $this->init_opensea_color_and_typography();
442 }
443
444 /**
445 * Youtube Controls
446 */
447
448 public function init_youtube_controls()
449 {
450 $yt_condition = [
451 'embedpress_pro_embeded_source' => 'youtube'
452 ];
453 $this->add_control(
454 'embedpress_pro_youtube_end_time',
455 [
456 'label' => __('End Time', 'embedpress'),
457 'type' => Controls_Manager::NUMBER,
458 'description' => __('Specify an end time (in seconds)', 'embedpress'),
459 'condition' => $yt_condition,
460 ]
461 );
462
463
464 $this->add_control(
465 'embedpress_player_color',
466 [
467 'label' => sprintf(__('Player Color %s', 'embedpress'), $this->pro_text),
468 'type' => Controls_Manager::COLOR,
469 'label_block' => false,
470 'classes' => $this->pro_class,
471 'default' => '#5b4e96',
472 'condition' => [
473 'emberpress_custom_player' => 'yes',
474 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'selfhosted_video', 'selfhosted_audio']
475 ],
476 ]
477 );
478
479 $this->add_control(
480 'embedpress_pro_vimeo_auto_play',
481 [
482 'label' => __('Auto Play', 'embedpress'),
483 'type' => Controls_Manager::SWITCHER,
484 'label_block' => false,
485 'return_value' => 'yes',
486 'default' => 'no',
487 'condition' => [
488 'embedpress_pro_embeded_source' => 'vimeo'
489 ]
490 ]
491 );
492
493 $this->add_control(
494 'embedpress_pro_vimeo_autopause',
495 [
496 'label' => sprintf(__('Auto Pause %s', 'embedpress'), $this->pro_text),
497 'type' => Controls_Manager::SWITCHER,
498 'label_block' => false,
499 'return_value' => 'yes',
500 'default' => 'no',
501 'description' => __(
502 'Automatically stop the current video from playing when another one starts.',
503 'embedpress'
504 ),
505 'condition' => [
506 'embedpress_pro_embeded_source' => 'vimeo'
507 ],
508 'classes' => $this->pro_class,
509 ]
510 );
511
512 $this->add_control(
513 'embedpress_pro_vimeo_dnt',
514 [
515 'label' => sprintf(__('DNT %s', 'embedpress'), $this->pro_text),
516 'type' => Controls_Manager::SWITCHER,
517 'label_block' => false,
518 'return_value' => 'yes',
519 'default' => 'yes',
520 'description' => __(
521 'Set this parameter to "yes" will block tracking any session data, including cookies. If Auto Pause is enabled this will not work.',
522 'embedpress'
523 ),
524 'condition' => [
525 'embedpress_pro_embeded_source' => 'vimeo'
526 ],
527 'classes' => $this->pro_class,
528 ]
529 );
530
531
532 $this->add_control(
533 'embedpress_pro_youtube_auto_play',
534 [
535 'label' => __('Auto Play', 'embedpress'),
536 'type' => Controls_Manager::SWITCHER,
537 'label_block' => false,
538 'return_value' => 'yes',
539 'default' => 'no',
540 'condition' => $yt_condition,
541 ]
542 );
543 $this->add_control(
544 'embedpress_pro_youtube_player_options',
545 [
546 'label' => __('Player Options', 'embedpress'),
547 'type' => Controls_Manager::HEADING,
548 'condition' => [
549 'embedpress_pro_embeded_source' => 'youtube',
550 'emberpress_custom_player!' => 'yes'
551 ],
552 ]
553 );
554 $this->add_control(
555 'embedpress_pro_youtube_display_controls',
556 [
557 'label' => __('Controls', 'embedpress'),
558 'type' => Controls_Manager::SELECT,
559 'label_block' => false,
560 'default' => 1,
561 'options' => [
562 '1' => __('Display immediately', 'embedpress'),
563 '2' => __('Display after user initiation', 'embedpress'),
564 '0' => __('Hide controls', 'embedpress')
565 ],
566 'condition' => [
567 'embedpress_pro_embeded_source' => 'youtube',
568 'emberpress_custom_player!' => 'yes'
569 ],
570 ]
571 );
572 $this->add_control(
573 'embedpress_pro_youtube_enable_fullscreen_button',
574 [
575 'label' => __('Fullscreen button', 'embedpress'),
576 'type' => Controls_Manager::SWITCHER,
577 'label_block' => false,
578 'return_value' => 'yes',
579 'default' => 'yes',
580 'condition' => [
581 'embedpress_pro_embeded_source' => ['youtube', 'vimeo'],
582 'embedpress_pro_youtube_display_controls!' => '0'
583 ]
584 ]
585 );
586 $this->add_control(
587 'embedpress_pro_youtube_display_video_annotations',
588 [
589 'label' => __('Video Annotations', 'embedpress'),
590 'type' => Controls_Manager::SWITCHER,
591 'label_block' => false,
592 'default' => 1,
593 'options' => [
594 '1' => __('Display', 'embedpress'),
595 '3' => __('Do Not Display', 'embedpress')
596 ],
597 'condition' => [
598 'embedpress_pro_embeded_source' => 'youtube',
599 'emberpress_custom_player!' => 'yes'
600 ],
601 ]
602 );
603 //--- YouTube Pro control starts ---
604 $this->add_control(
605 'embedpress_pro_youtube_progress_bar_color',
606 [
607 'label' => __('Progress Bar Color', 'embedpress'),
608 'type' => Controls_Manager::SELECT,
609 'label_block' => false,
610 'default' => 'red',
611 'options' => [
612 'red' => __('Red', 'embedpress'),
613 'white' => __('White', 'embedpress')
614 ],
615 'condition' => [
616 'embedpress_pro_embeded_source' => 'youtube',
617 'emberpress_custom_player!' => 'yes'
618 ],
619 ]
620 );
621 $this->add_control(
622 'embedpress_pro_youtube_force_closed_captions',
623 [
624 'label' => sprintf(__('Closed Captions %s', 'embedpress'), $this->pro_text),
625 'type' => Controls_Manager::SWITCHER,
626 'label_block' => false,
627 'return_value' => 'yes',
628 'default' => 'no',
629 'separator' => 'before',
630 'classes' => $this->pro_class,
631 'condition' => [
632 'embedpress_pro_embeded_source' => 'youtube',
633 'emberpress_custom_player!' => 'yes'
634 ],
635 ]
636 );
637 $this->add_control(
638 'embedpress_pro_youtube_modest_branding',
639 [
640 'label' => sprintf(__('Modest Branding %s', 'embedpress'), $this->pro_text),
641 'type' => Controls_Manager::SELECT,
642 'label_block' => false,
643 'default' => 1,
644 'options' => [
645 '0' => __('Display', 'embedpress'),
646 '1' => __('Do Not Display', 'embedpress')
647 ],
648 'condition' => [
649 'embedpress_pro_embeded_source' => 'youtube',
650 'embedpress_pro_youtube_display_controls!' => '0',
651 'embedpress_pro_youtube_progress_bar_color!' => 'white',
652 'embedpress_custom_player!' => 'yes',
653 ],
654 'classes' => $this->pro_class,
655 ]
656 );
657
658
659
660
661
662 do_action('extend_customplayer_controls', $this, '_', $this->pro_text, $this->pro_class);
663
664
665 $this->add_control(
666 'embepress_player_always_on_top',
667 [
668 'label' => sprintf(__('Sticky Video %s', 'embedpress'), $this->pro_text),
669 'description' => __('Watch video and seamlessly scroll through other content with a sleek pop-up window.', 'embedpress'),
670 'type' => Controls_Manager::SWITCHER,
671 'label_block' => false,
672 'return_value' => 'yes',
673 'classes' => $this->pro_class,
674 'default' => '',
675 'condition' => [
676 'emberpress_custom_player' => 'yes',
677 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'selfhosted_video']
678 ],
679 ]
680 );
681
682 $this->add_control(
683 'embedpress_pro_youtube_display_related_videos',
684 [
685 'label' => __('Related Videos', 'embedpress'),
686 'description' => __('Set it to "Yes" to display related videos from all channels. Otherwise, related videos will show from the same channel.', 'embedpress'),
687 'type' => Controls_Manager::SWITCHER,
688 'label_block' => false,
689 'return_value' => 'yes',
690 'default' => 'yes',
691 'condition' => $yt_condition,
692 ]
693 );
694
695
696
697 $this->add_control(
698 "embedpress_player_poster_thumbnail",
699 [
700 'label' => sprintf(__('Thumbnail %s', 'embedpress'), $this->pro_text),
701 'type' => Controls_Manager::MEDIA,
702 'dynamic' => [
703 'active' => true,
704 ],
705 'classes' => $this->pro_class,
706 'condition' => [
707 'emberpress_custom_player' => 'yes',
708 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'selfhosted_video']
709 ],
710 ]
711 );
712
713 $this->init_branding_controls('youtube');
714 }
715
716 public function init_youtube_channel_section()
717 {
718 $yt_condition = [
719 'embedpress_pro_embeded_source' => 'youtube',
720 ];
721 $this->start_controls_section(
722 'embedpress_yt_channel_section',
723 [
724 'label' => __('YouTube Channel', 'embedpress'),
725 'condition' => [
726 'embedpress_pro_embeded_source' => 'youtube',
727 'emberpress_custom_player!' => 'yes'
728 ],
729
730 ]
731 );
732
733 $this->add_control(
734 'important_note',
735 [
736 'type' => \Elementor\Controls_Manager::RAW_HTML,
737 'raw' => esc_html__('These options take effect only when a YouTube channel is embedded.', 'embedpress'),
738 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
739 ]
740 );
741
742 $this->add_control(
743 'ytChannelLayout',
744 [
745 'label' => __('Layout', 'embedpress'),
746 'type' => \Elementor\Controls_Manager::SELECT,
747 'label_block' => false,
748 'default' => 'gallery',
749 'options' => [
750 'gallery' => esc_html__('Gallery', 'embedpress'),
751 'list' => esc_html__('List', 'embedpress'),
752 'grid' => sprintf(esc_html__('Grid %s', 'embedpress'), $this->pro_label),
753 'carousel' => sprintf(esc_html__('Carousel %s', 'embedpress'), $this->pro_label),
754 ],
755 'conditions' => [
756 'terms' => [
757 [
758 'name' => 'embedpress_pro_embeded_source',
759 'operator' => '===',
760 'value' => 'youtube',
761 ],
762 ],
763 ]
764 ]
765 );
766
767
768 $this->add_control(
769 'pagesize',
770 [
771 'label' => __('Video Per Page', 'embedpress'),
772 'type' => Controls_Manager::NUMBER,
773 'label_block' => false,
774 'default' => 6,
775 'min' => 1,
776 'max' => 50,
777 'conditions' => [
778 'terms' => [
779 [
780 'name' => 'embedpress_pro_embeded_source',
781 'operator' => '===',
782 'value' => 'youtube',
783 ],
784 ],
785 ]
786 ]
787 );
788
789 $this->add_control(
790 'columns',
791 [
792 'label' => __('Column', 'embedpress'),
793 'type' => \Elementor\Controls_Manager::SELECT,
794 'label_block' => false,
795 'default' => '3',
796 'options' => [
797 '2' => esc_html__('2', 'embedpress'),
798 '3' => esc_html__('3', 'embedpress'),
799 '4' => esc_html__('4', 'embedpress'),
800 '6' => esc_html__('6', 'embedpress'),
801 'auto' => esc_html__('Auto', 'embedpress'),
802 ],
803 'conditions' => [
804 'terms' => [
805 [
806 'name' => 'embedpress_pro_embeded_source',
807 'operator' => '===',
808 'value' => 'youtube',
809 ],
810 [
811 'name' => 'ytChannelLayout',
812 'operator' => '!==',
813 'value' => 'list',
814 ],
815 [
816 'name' => 'ytChannelLayout',
817 'operator' => '!==',
818 'value' => 'carousel',
819 ],
820 ],
821 ]
822 ]
823 );
824 $this->add_control(
825 'gapbetweenvideos',
826 [
827 'label' => __('Gap Between Videos', 'embedpress'),
828 'label_block' => true,
829 'type' => \Elementor\Controls_Manager::SLIDER,
830 'size_units' => ['px', '%'],
831 'range' => [
832 'px' => [
833 'min' => 0,
834 'max' => 100,
835 'step' => 1,
836 ],
837 '%' => [
838 'min' => 0,
839 'max' => 100,
840 ],
841 ],
842 'default' => [
843 'unit' => 'px',
844 'size' => 30,
845 ],
846 'conditions' => [
847 'terms' => [
848 [
849 'name' => 'embedpress_pro_embeded_source',
850 'operator' => '===',
851 'value' => 'youtube',
852 ],
853 [
854 'name' => 'ytChannelLayout',
855 'operator' => '!==',
856 'value' => 'carousel',
857 ],
858 ],
859 ],
860 'selectors' => [
861 '{{WRAPPER}} .ep-youtube__content__block .youtube__content__body .content__wrap:not(.youtube-carousel)' => 'gap: {{SIZE}}{{UNIT}}!important;margin-top: {{SIZE}}{{UNIT}}!important;',
862 ],
863 ]
864 );
865
866 $this->add_control(
867 'pagination',
868 [
869 'label' => __('Pagination', 'embedpress'),
870 'type' => Controls_Manager::SWITCHER,
871 'label_block' => false,
872 'label_on' => esc_html__('Show', 'embedpress'),
873 'label_off' => esc_html__('Hide', 'embedpress'),
874 'return_value' => 'show',
875 'default' => 'show',
876 'condition' => [
877 'terms' => [
878 [
879 'name' => 'embedpress_pro_embeded_source',
880 'operator' => '===',
881 'value' => 'youtube',
882 ],
883 [
884 'name' => 'ytChannelLayout',
885 'operator' => '!==',
886 'value' => 'carousel',
887 ],
888 ],
889 ],
890 ]
891 );
892
893 $this->end_controls_section();
894 }
895 public function init_youtube_subscription_section()
896 {
897 $yt_condition = [
898 'embedpress_pro_embeded_source' => 'youtube',
899 ];
900 $this->start_controls_section(
901 'embedpress_yt_subscription_section',
902 [
903 'label' => __('YouTube Subscriber', 'embedpress'),
904 'condition' => $yt_condition,
905
906 ]
907 );
908
909
910 $this->add_control(
911 'yt_sub_channel',
912 [
913
914 'label' => sprintf(__('Channel ID %s', 'embedpress'), $this->pro_text),
915 'type' => Controls_Manager::TEXT,
916 'dynamic' => [
917 'active' => true,
918 ],
919 'placeholder' => __('Enter Channel ID', 'embedpress'),
920 'label_block' => true,
921 'condition' => $yt_condition,
922 'classes' => $this->pro_class,
923 ]
924 );
925 $this->add_control(
926 'yt_sub_text',
927 [
928
929 'label' => sprintf(__('Subscription Text %s', 'embedpress'), $this->pro_text),
930 'type' => Controls_Manager::TEXT,
931 'dynamic' => [
932 'active' => true,
933 ],
934 'placeholder' => __('Eg. Don\'t miss out! Subscribe', 'embedpress'),
935 'label_block' => true,
936 'condition' => $yt_condition,
937 'classes' => $this->pro_class,
938 ]
939 );
940
941
942 $this->add_control(
943 'yt_sub_layout',
944 [
945 'label' => sprintf(__('Layout %s', 'embedpress'), $this->pro_text),
946 'type' => Controls_Manager::SELECT,
947 'label_block' => false,
948 'default' => 'default',
949 'options' => [
950 'default' => __('Default', 'embedpress'),
951 'full' => __('Full', 'embedpress')
952 ],
953 'condition' => [
954 'embedpress_pro_embeded_source' => 'youtube',
955 ],
956 'classes' => $this->pro_class,
957 ]
958 );
959
960 $this->add_control(
961 'yt_sub_theme',
962 [
963 'label' => sprintf(__('Theme %s', 'embedpress'), $this->pro_text),
964 'type' => Controls_Manager::SELECT,
965 'label_block' => false,
966 'default' => 'default',
967 'options' => [
968 'default' => __('Default', 'embedpress'),
969 'dark' => __('Dark', 'embedpress')
970 ],
971 'condition' => [
972 'embedpress_pro_embeded_source' => 'youtube',
973 ],
974 'classes' => $this->pro_class,
975 ]
976 );
977
978 $this->add_control(
979 'yt_sub_count',
980 [
981 'label' => sprintf(__('Subscriber Count %s', 'embedpress'), $this->pro_text),
982 'type' => Controls_Manager::SWITCHER,
983 'label_block' => false,
984 'return_value' => 'yes',
985 'default' => 'yes',
986 'condition' => $yt_condition,
987 'classes' => $this->pro_class,
988 ]
989 );
990
991 $this->end_controls_section();
992 }
993
994 public function init_youtube_livechat_section()
995 {
996 $yt_condition = [
997 'embedpress_pro_embeded_source' => 'youtube',
998 ];
999 $this->start_controls_section(
1000 'embedpress_yt_livechat_section',
1001 [
1002 'label' => __('YouTube Live Chat', 'embedpress'),
1003 'condition' => $yt_condition,
1004
1005 ]
1006 );
1007
1008 $this->add_control(
1009 'yt_lc_show',
1010 [
1011 'label' => sprintf(__('Show YouTube Live Chat %s', 'embedpress'), $this->pro_text),
1012 'type' => Controls_Manager::SWITCHER,
1013 'label_block' => false,
1014 'return_value' => 'yes',
1015 'default' => '',
1016 'label_off' => __('Hide', 'embedpress'),
1017 'label_on' => __('Show', 'embedpress'),
1018 'condition' => $yt_condition,
1019 'classes' => $this->pro_class,
1020 ]
1021 );
1022
1023
1024 $this->end_controls_section();
1025 }
1026
1027 //End Youtube Controls
1028
1029 /**
1030 * Dailymotion Controls
1031 */
1032 public function init_dailymotion_control()
1033 {
1034 //@TODO; Kamal - migrate from 'embedpress_pro_dailymotion_logo' to 'embedpress_pro_dailymotion_ui_logo'
1035 $this->add_control(
1036 'embedpress_pro_dailymotion_ui_logo',
1037 [
1038 'label' => sprintf(__('Logo %s', 'embedpress'), $this->pro_text),
1039 'type' => Controls_Manager::SWITCHER,
1040 'label_block' => false,
1041 'return_value' => 'yes',
1042 'default' => 'yes',
1043 'label_off' => __('Hide', 'embedpress'),
1044 'label_on' => __('Show', 'embedpress'),
1045 'condition' => [
1046 'embedpress_pro_embeded_source' => 'dailymotion'
1047 ],
1048 'classes' => $this->pro_class,
1049 ]
1050 );
1051 $this->add_control(
1052 'embedpress_pro_dailymotion_autoplay',
1053 [
1054 'label' => __('Auto Play', 'embedpress'),
1055 'type' => Controls_Manager::SWITCHER,
1056 'label_block' => false,
1057 'return_value' => 'yes',
1058 'default' => 'no',
1059 'label_off' => __('Hide', 'embedpress'),
1060 'label_on' => __('Show', 'embedpress'),
1061 'condition' => [
1062 'embedpress_pro_embeded_source' => 'dailymotion'
1063 ]
1064 ]
1065 );
1066 $this->add_control(
1067 'embedpress_pro_dailymotion_play_on_mobile',
1068 [
1069 'label' => __('Play On Mobile', 'embedpress'),
1070 'type' => Controls_Manager::SWITCHER,
1071 'label_block' => false,
1072 'return_value' => 'yes',
1073 'default' => 'no',
1074 'label_off' => __('Hide', 'embedpress'),
1075 'label_on' => __('Show', 'embedpress'),
1076 'condition' => [
1077 'embedpress_pro_embeded_source' => 'dailymotion',
1078 'embedpress_pro_dailymotion_autoplay' => 'yes'
1079 ]
1080 ]
1081 );
1082 $this->add_control(
1083 'embedpress_pro_dailymotion_mute',
1084 [
1085 'label' => __('Mute', 'embedpress'),
1086 'type' => Controls_Manager::SWITCHER,
1087 'label_block' => false,
1088 'return_value' => 'yes',
1089 'default' => 'no',
1090 'label_off' => __('Hide', 'embedpress'),
1091 'label_on' => __('Show', 'embedpress'),
1092 'condition' => [
1093 'embedpress_pro_embeded_source' => 'dailymotion'
1094 ]
1095 ]
1096 );
1097 $this->add_control(
1098 'embedpress_pro_dailymotion_player_control',
1099 [
1100 'label' => __('Player Controls', 'embedpress'),
1101 'type' => Controls_Manager::SWITCHER,
1102 'label_block' => false,
1103 'return_value' => 'yes',
1104 'default' => 'yes',
1105 'label_off' => __('Hide', 'embedpress'),
1106 'label_on' => __('Show', 'embedpress'),
1107 'condition' => [
1108 'embedpress_pro_embeded_source' => 'dailymotion'
1109 ]
1110 ]
1111 );
1112 $this->add_control(
1113 'embedpress_pro_dailymotion_video_info',
1114 [
1115 'label' => __('Video Info', 'embedpress'),
1116 'type' => Controls_Manager::SWITCHER,
1117 'label_block' => false,
1118 'return_value' => 'yes',
1119 'default' => 'yes',
1120 'label_off' => __('Hide', 'embedpress'),
1121 'label_on' => __('Show', 'embedpress'),
1122 'condition' => [
1123 'embedpress_pro_embeded_source' => 'dailymotion'
1124 ]
1125 ]
1126 );
1127 $this->add_control(
1128 'embedpress_pro_dailymotion_control_color',
1129 [
1130 'label' => __('Control Color', 'embedpress'),
1131 'type' => Controls_Manager::COLOR,
1132 'label_block' => false,
1133 'default' => '#dd3333',
1134 'condition' => [
1135 'embedpress_pro_embeded_source' => 'dailymotion'
1136 ]
1137 ]
1138 );
1139 $this->init_branding_controls('dailymotion');
1140 }
1141 //End Dailymotion Controls
1142
1143 /**
1144 * Wistia Controls
1145 */
1146 public function init_wistia_controls()
1147 {
1148 $this->add_control(
1149 'embedpress_pro_wistia_auto_play',
1150 [
1151 'label' => __('Auto Play', 'embedpress'),
1152 'type' => Controls_Manager::SWITCHER,
1153 'label_block' => false,
1154 'return_value' => 'yes',
1155 'default' => 'no',
1156 'condition' => [
1157 'embedpress_pro_embeded_source' => 'wistia'
1158 ],
1159 ]
1160 );
1161
1162 $this->add_control(
1163 'embedpress_pro_wistia_color',
1164 [
1165 'label' => __('Scheme', 'embedpress'),
1166 'type' => Controls_Manager::COLOR,
1167 'label_block' => false,
1168 'default' => '#dd3333',
1169 'condition' => [
1170 'embedpress_pro_embeded_source' => 'wistia'
1171 ]
1172 ]
1173 );
1174
1175 $this->add_control(
1176 'embedpress_pro_wistia_player_options',
1177 [
1178 'label' => __('Player Options', 'embedpress'),
1179 'type' => Controls_Manager::HEADING,
1180 'separator' => 'before',
1181 'condition' => [
1182 'embedpress_pro_embeded_source' => 'wistia'
1183 ]
1184 ]
1185 );
1186
1187
1188
1189 $this->add_control(
1190 'embedpress_pro_wistia_fullscreen_button',
1191 [
1192 'label' => __('Fullscreen Button', 'embedpress'),
1193 'type' => Controls_Manager::SWITCHER,
1194 'label_block' => false,
1195 'return_value' => 'yes',
1196 'default' => 'no',
1197 'condition' => [
1198 'embedpress_pro_embeded_source' => 'wistia'
1199 ],
1200 ]
1201 );
1202
1203 $this->add_control(
1204 'embedpress_pro_wistia_small_play_button',
1205 [
1206 'label' => __('Small Play Button', 'embedpress'),
1207 'type' => Controls_Manager::SWITCHER,
1208 'label_block' => false,
1209 'return_value' => 'yes',
1210 'default' => 'no',
1211 'condition' => [
1212 'embedpress_pro_embeded_source' => 'wistia'
1213 ],
1214 ]
1215 );
1216
1217
1218
1219
1220 // $this->add_control(
1221 // 'embedpress_pro_wistia_resumable',
1222 // [
1223 // 'label' => __('Resumable', 'embedpress'),
1224 // 'type' => Controls_Manager::SWITCHER,
1225 // 'label_block' => false,
1226 // 'return_value' => 'yes',
1227 // 'default' => 'no',
1228 // 'condition' => [
1229 // 'embedpress_pro_embeded_source' => 'wistia'
1230 // ],
1231 // ]
1232 // );
1233
1234
1235 // $this->add_control(
1236 // 'embedpress_pro_wistia_focus',
1237 // [
1238 // 'label' => __('Focus', 'embedpress'),
1239 // 'type' => Controls_Manager::SWITCHER,
1240 // 'label_block' => false,
1241 // 'return_value' => 'yes',
1242 // 'default' => 'no',
1243 // 'condition' => [
1244 // 'embedpress_pro_embeded_source' => 'wistia'
1245 // ],
1246 // ]
1247 // );
1248
1249 // --- Wistia PRO Controls --
1250 $this->add_control(
1251 'embedpress_pro_wistia_captions',
1252 [
1253 'label' => sprintf(__('Captions %s', 'embedpress'), $this->pro_text),
1254 'type' => Controls_Manager::SWITCHER,
1255 'label_block' => false,
1256 'return_value' => 'yes',
1257 'default' => 'no',
1258 'condition' => [
1259 'embedpress_pro_embeded_source' => 'wistia'
1260 ],
1261 'classes' => $this->pro_class,
1262 ]
1263 );
1264
1265 $this->add_control(
1266 'embedpress_pro_wistia_captions_enabled_by_default',
1267 [
1268 'label' => sprintf(__('Caption Enabled by Default', 'embedpress'), $this->pro_text),
1269 'type' => Controls_Manager::SWITCHER,
1270 'label_block' => false,
1271 'return_value' => 'yes',
1272 'default' => 'no',
1273 'condition' => [
1274 'embedpress_pro_embeded_source' => 'wistia',
1275 'embedpress_pro_wistia_captions' => 'yes'
1276 ],
1277 'classes' => $this->pro_class,
1278 ]
1279 );
1280 $this->add_control(
1281 'embedpress_pro_wistia_playbar',
1282 [
1283 'label' => __('Playbar ', 'embedpress'),
1284 'type' => Controls_Manager::SWITCHER,
1285 'label_block' => false,
1286 'return_value' => 'yes',
1287 'default' => 'no',
1288 'condition' => [
1289 'embedpress_pro_embeded_source' => 'wistia'
1290 ],
1291 ]
1292 );
1293
1294 $this->add_control(
1295 'embedpress_pro_wistia_volume_control',
1296 [
1297 'label' => sprintf(__('Volume Control %s', 'embedpress'), $this->pro_text),
1298 'type' => Controls_Manager::SWITCHER,
1299 'label_block' => false,
1300 'return_value' => 'yes',
1301 'default' => 'yes',
1302 'condition' => [
1303 'embedpress_pro_embeded_source' => 'wistia'
1304 ],
1305 'classes' => $this->pro_class,
1306 ]
1307 );
1308
1309
1310 $this->add_control(
1311 'embedpress_pro_wistia_volume',
1312 [
1313 'label' => sprintf(__('Volume %s', 'embedpress'), $this->pro_text),
1314 'type' => Controls_Manager::SLIDER,
1315 'default' => [
1316 'size' => 100,
1317 ],
1318 'range' => [
1319 'px' => [
1320 'min' => 0,
1321 'max' => 100,
1322 ]
1323 ],
1324 'condition' => [
1325 'embedpress_pro_embeded_source' => 'wistia',
1326 'embedpress_pro_wistia_volume_control' => 'yes'
1327 ],
1328 'classes' => $this->pro_class,
1329 ]
1330 );
1331
1332 // $this->add_control(
1333 // 'embedpress_pro_wistia_rewind',
1334 // [
1335 // 'label' => __('Rewind', 'embedpress'),
1336 // 'type' => Controls_Manager::SWITCHER,
1337 // 'label_block' => false,
1338 // 'return_value' => 'yes',
1339 // 'default' => 'no',
1340 // 'condition' => [
1341 // 'embedpress_pro_embeded_source' => 'wistia'
1342 // ],
1343 // ]
1344 // );
1345
1346 // $this->add_control(
1347 // 'embedpress_pro_wistia_rewind_time',
1348 // [
1349 // 'label' => __('Rewind time', 'embedpress'),
1350 // 'type' => Controls_Manager::SLIDER,
1351 // 'default' => [
1352 // 'size' => 10,
1353 // ],
1354 // 'range' => [
1355 // 'px' => [
1356 // 'min' => 1,
1357 // 'max' => 100,
1358 // ]
1359 // ],
1360 // 'condition' => [
1361 // 'embedpress_pro_wistia_rewind' => 'yes',
1362 // 'embedpress_pro_embeded_source' => 'wistia'
1363 // ],
1364 // ]
1365 // );
1366 $this->init_branding_controls('wistia');
1367 }
1368 //End Wistia controls
1369
1370
1371
1372 /**
1373 * Twitch Controls
1374 */
1375 public function init_twitch_control()
1376 {
1377 $condition = [
1378 'embedpress_pro_embeded_source' => 'twitch'
1379 ];
1380 $this->add_control(
1381 'embedpress_pro_twitch_autoplay',
1382 [
1383 'label' => __('Autoplay', 'embedpress'),
1384 'type' => Controls_Manager::SWITCHER,
1385 'label_off' => __('No', 'embedpress'),
1386 'label_on' => __('Yes', 'embedpress'),
1387 'default' => 'yes',
1388 'condition' => $condition,
1389 ]
1390 );
1391 $this->add_control(
1392 'embedpress_pro_fs',
1393 [
1394 'label' => __('Allow Full Screen Video', 'embedpress'),
1395 'type' => Controls_Manager::SWITCHER,
1396 'label_off' => __('No', 'embedpress'),
1397 'label_on' => __('Yes', 'embedpress'),
1398 'default' => 'yes',
1399 'condition' => $condition,
1400 ]
1401 );
1402
1403 // -- Twitch PRO controls --
1404 $this->add_control(
1405 'embedpress_pro_twitch_chat',
1406 [
1407 'label' => sprintf(__('Show Chat %s', 'embedpress'), $this->pro_text),
1408 'type' => Controls_Manager::SWITCHER,
1409 'label_off' => __('Hide', 'embedpress'),
1410 'label_on' => __('Show', 'embedpress'),
1411 'condition' => $condition,
1412 'classes' => $this->pro_class,
1413
1414 ]
1415 );
1416 $this->add_control(
1417 'embedpress_pro_twitch_mute',
1418 [
1419 'label' => __('Mute on start', 'embedpress'),
1420 'type' => Controls_Manager::SWITCHER,
1421 'label_off' => __('Hide', 'embedpress'),
1422 'label_on' => __('Show', 'embedpress'),
1423 'condition' => $condition,
1424 ]
1425 );
1426 $this->add_control(
1427 'embedpress_pro_twitch_theme',
1428 [
1429 'label' => __('Theme', 'embedpress'),
1430 'type' => Controls_Manager::SELECT,
1431 'default' => 'dark',
1432 'options' => [
1433 'dark' => __('Dark', 'embedpress'),
1434 'light' => __('Light', 'embedpress'),
1435 ],
1436 'condition' => $condition,
1437 ]
1438 );
1439
1440 $this->init_branding_controls('twitch');
1441 }
1442 //End Twitch controls
1443
1444
1445 /**
1446 * SoundCloud Controls
1447 */
1448 public function init_soundcloud_controls()
1449 {
1450 $this->add_control(
1451 'embedpress_pro_soundcloud_visual',
1452 [
1453 'label' => __('Visual Player', 'embedpress'),
1454 'type' => Controls_Manager::SWITCHER,
1455 'label_block' => false,
1456 'return_value' => 'yes',
1457 'default' => 'no',
1458 'label_off' => __('Hide', 'embedpress'),
1459 'label_on' => __('Show', 'embedpress'),
1460 'condition' => [
1461 'embedpress_pro_embeded_source' => 'soundcloud'
1462 ],
1463 ]
1464 );
1465
1466 $this->add_control(
1467 'embedpress_pro_soundcloud_color',
1468 [
1469 'label' => __('Scheme', 'embedpress'),
1470 'type' => Controls_Manager::COLOR,
1471 'label_block' => false,
1472 'default' => '#FF5500',
1473 'condition' => [
1474 'embedpress_pro_embeded_source' => 'soundcloud'
1475 ]
1476 ]
1477 );
1478
1479 $this->add_control(
1480 'embedpress_pro_soundcloud_autoplay',
1481 [
1482 'label' => __('Auto Play', 'embedpress'),
1483 'type' => Controls_Manager::SWITCHER,
1484 'label_block' => false,
1485 'return_value' => 'yes',
1486 'default' => 'no',
1487 'label_off' => __('Hide', 'embedpress'),
1488 'label_on' => __('Show', 'embedpress'),
1489 'condition' => [
1490 'embedpress_pro_embeded_source' => 'soundcloud'
1491 ],
1492 ]
1493 );
1494
1495
1496
1497 $this->add_control(
1498 'embedpress_pro_soundcloud_share_button',
1499 [
1500 'label' => __('Share Button', 'embedpress'),
1501 'type' => Controls_Manager::SWITCHER,
1502 'label_block' => false,
1503 'return_value' => 'yes',
1504 'default' => 'yes',
1505 'label_off' => __('Hide', 'embedpress'),
1506 'label_on' => __('Show', 'embedpress'),
1507 'condition' => [
1508 'embedpress_pro_embeded_source' => 'soundcloud'
1509 ],
1510 ]
1511 );
1512
1513 $this->add_control(
1514 'embedpress_pro_soundcloud_comments',
1515 [
1516 'label' => __('Comments', 'embedpress'),
1517 'type' => Controls_Manager::SWITCHER,
1518 'label_block' => false,
1519 'return_value' => 'yes',
1520 'default' => 'yes',
1521 'label_off' => __('Hide', 'embedpress'),
1522 'label_on' => __('Show', 'embedpress'),
1523 'condition' => [
1524 'embedpress_pro_embeded_source' => 'soundcloud'
1525 ],
1526 ]
1527 );
1528
1529
1530
1531 $this->add_control(
1532 'embedpress_pro_soundcloud_artwork',
1533 [
1534 'label' => __('Artwork', 'embedpress'),
1535 'type' => Controls_Manager::SWITCHER,
1536 'label_block' => false,
1537 'return_value' => 'yes',
1538 'default' => 'yes',
1539 'label_off' => __('Hide', 'embedpress'),
1540 'label_on' => __('Show', 'embedpress'),
1541 'condition' => [
1542 'embedpress_pro_embeded_source' => 'soundcloud',
1543 'embedpress_pro_soundcloud_visual!' => 'yes'
1544 ]
1545 ]
1546 );
1547
1548 $this->add_control(
1549 'embedpress_pro_soundcloud_play_count',
1550 [
1551 'label' => __('Play Count', 'embedpress'),
1552 'type' => Controls_Manager::SWITCHER,
1553 'label_block' => false,
1554 'return_value' => 'yes',
1555 'default' => 'yes',
1556 'label_off' => __('Hide', 'embedpress'),
1557 'label_on' => __('Show', 'embedpress'),
1558 'condition' => [
1559 'embedpress_pro_embeded_source' => 'soundcloud',
1560 'embedpress_pro_soundcloud_visual!' => 'yes'
1561 ],
1562 ]
1563 );
1564
1565 $this->add_control(
1566 'embedpress_pro_soundcloud_user_name',
1567 [
1568 'label' => __('User Name', 'embedpress'),
1569 'type' => Controls_Manager::SWITCHER,
1570 'label_block' => false,
1571 'return_value' => 'yes',
1572 'default' => 'yes',
1573 'label_off' => __('Hide', 'embedpress'),
1574 'label_on' => __('Show', 'embedpress'),
1575 'condition' => [
1576 'embedpress_pro_embeded_source' => 'soundcloud'
1577 ],
1578 ]
1579 );
1580
1581 $this->add_control(
1582 'embedpress_pro_soundcloud_buy_button',
1583 [
1584 'label' => sprintf(__('Buy Button %s', 'embedpress'), $this->pro_text),
1585 'type' => Controls_Manager::SWITCHER,
1586 'label_block' => false,
1587 'return_value' => 'yes',
1588 'default' => 'yes',
1589 'label_off' => __('Hide', 'embedpress'),
1590 'label_on' => __('Show', 'embedpress'),
1591 'condition' => [
1592 'embedpress_pro_embeded_source' => 'soundcloud'
1593 ],
1594 'classes' => $this->pro_class,
1595 ]
1596 );
1597 $this->add_control(
1598 'embedpress_pro_soundcloud_download_button',
1599 [
1600 'label' => sprintf(__('Download Button %s', 'embedpress'), $this->pro_text),
1601 'type' => Controls_Manager::SWITCHER,
1602 'label_block' => false,
1603 'return_value' => 'yes',
1604 'default' => 'yes',
1605 'label_off' => __('Hide', 'embedpress'),
1606 'label_on' => __('Show', 'embedpress'),
1607 'condition' => [
1608 'embedpress_pro_embeded_source' => 'soundcloud'
1609 ],
1610 'classes' => $this->pro_class,
1611 ]
1612 );
1613 }
1614 //End SoundCloud controls
1615
1616 /**
1617 * Vimeo Controls
1618 */
1619 public function init_vimeo_controls()
1620 {
1621
1622
1623
1624 $this->add_control(
1625 'embedpress_pro_vimeo_color',
1626 [
1627 'label' => __('Scheme', 'embedpress'),
1628 'type' => Controls_Manager::COLOR,
1629 'label_block' => false,
1630 'default' => '#00adef',
1631 'condition' => [
1632 'emberpress_custom_player!' => 'yes',
1633 'embedpress_pro_embeded_source' => 'vimeo'
1634 ]
1635 ]
1636 );
1637
1638 $this->add_control(
1639 'embedpress_pro_vimeo_author_options',
1640 [
1641 'label' => __('Author Information', 'embedpress'),
1642 'type' => Controls_Manager::HEADING,
1643 'separator' => 'before',
1644 'condition' => [
1645 'embedpress_pro_embeded_source' => 'vimeo',
1646 'emberpress_custom_player!' => 'yes',
1647 ]
1648 ]
1649 );
1650
1651 $this->add_control(
1652 'embedpress_pro_vimeo_display_title',
1653 [
1654 'label' => __('Title', 'embedpress'),
1655 'type' => Controls_Manager::SWITCHER,
1656 'label_block' => false,
1657 'return_value' => 'yes',
1658 'default' => 'yes',
1659 'condition' => [
1660 'emberpress_custom_player!' => 'yes',
1661 'embedpress_pro_embeded_source' => 'vimeo'
1662 ]
1663 ]
1664 );
1665
1666 //----- Vimeo PRO controls
1667
1668 $this->add_control(
1669 'embedpress_pro_vimeo_display_author',
1670 [
1671 'label' => __('Author', 'embedpress'),
1672 'type' => Controls_Manager::SWITCHER,
1673 'label_block' => false,
1674 'return_value' => 'yes',
1675 'default' => 'yes',
1676 'condition' => [
1677 'emberpress_custom_player!' => 'yes',
1678 'embedpress_pro_embeded_source' => 'vimeo'
1679 ],
1680 ]
1681 );
1682
1683 $this->add_control(
1684 'embedpress_pro_vimeo_avatar',
1685 [
1686 'label' => __('Avatar', 'embedpress'),
1687 'type' => Controls_Manager::SWITCHER,
1688 'label_block' => false,
1689 'return_value' => 'yes',
1690 'default' => 'yes',
1691 'condition' => [
1692 'emberpress_custom_player!' => 'yes',
1693 'embedpress_pro_embeded_source' => 'vimeo'
1694 ],
1695 ]
1696 );
1697
1698 $this->add_control(
1699 'embedpress_pro_vimeo_loop',
1700 [
1701 'label' => sprintf(__('Loop %s', 'embedpress'), $this->pro_text),
1702 'type' => Controls_Manager::SWITCHER,
1703 'label_block' => false,
1704 'return_value' => 'yes',
1705 'default' => 'no',
1706 'condition' => [
1707 'emberpress_custom_player!' => 'yes',
1708 'embedpress_pro_embeded_source' => 'vimeo'
1709 ],
1710 'classes' => $this->pro_class,
1711 ]
1712 );
1713
1714 $this->init_branding_controls('vimeo');
1715 }
1716 //End Vimeo controls
1717
1718
1719 /**
1720 * Spotify Controls
1721 */
1722 public function init_spotify_controls()
1723 {
1724 $condition = [
1725 'embedpress_pro_embeded_source' => 'spotify'
1726 ];
1727
1728 $this->add_control(
1729 'spotify_theme',
1730 [
1731 'label' => __('Player Background', 'embedpress'),
1732 'description' => __('Dynamic option will use the most vibrant color from the album art.', 'embedpress'),
1733 'type' => Controls_Manager::SELECT,
1734 'label_block' => false,
1735 'default' => '1',
1736 'options' => [
1737 '1' => __('Dynamic', 'embedpress'),
1738 '0' => __('Black & White', 'embedpress')
1739 ],
1740 'condition' => $condition
1741 ]
1742 );
1743 }
1744 //End Spotify controls
1745
1746 /**
1747 * OpenSea Controls
1748 */
1749 public function init_opensea_control()
1750 {
1751 $condition = [
1752 'embedpress_pro_embeded_source' => 'opensea'
1753 ];
1754
1755 $this->add_control(
1756 'limit',
1757 [
1758 'type' => \Elementor\Controls_Manager::NUMBER,
1759 'label' => esc_html__('Limit', 'embedpress'),
1760 'placeholder' => '9',
1761 'min' => 1,
1762 'max' => 100,
1763 'step' => 1,
1764 'default' => 20,
1765 'condition' => [
1766 'embedpress_pro_embeded_nft_type' => ['collection'],
1767 'embedpress_pro_embeded_source!' => [
1768 'default',
1769 'youtube',
1770 'vimeo',
1771 'dailymotion',
1772 'wistia',
1773 'twitch',
1774 'soundcloud',
1775 'instafeed',
1776 'calendly',
1777 'selfhosted_video',
1778 'selfhosted_audio',
1779 'spreaker',
1780 'google_photos'
1781 ],
1782 ],
1783 ]
1784 );
1785
1786
1787 $this->add_control(
1788 'orderby',
1789 [
1790 'type' => \Elementor\Controls_Manager::SELECT,
1791 'label' => esc_html__('Order By', 'embedpress'),
1792 'options' => [
1793 'asc' => esc_html__('Oldest', 'embedpress'),
1794 'desc' => esc_html__('Newest', 'embedpress'),
1795 ],
1796 'default' => 'desc',
1797 'condition' => [
1798 'embedpress_pro_embeded_nft_type' => ['collection'],
1799 'embedpress_pro_embeded_source!' => [
1800 'default',
1801 'youtube',
1802 'vimeo',
1803 'dailymotion',
1804 'wistia',
1805 'twitch',
1806 'soundcloud',
1807 'instafeed',
1808 'calendly',
1809 'selfhosted_video',
1810 'selfhosted_audio',
1811 'spreaker',
1812 'google_photos'
1813
1814 ],
1815 ],
1816 ]
1817 );
1818 }
1819
1820 public function init_opensea_control_section()
1821 {
1822 $condition = [
1823 'embedpress_pro_embeded_source' => 'opensea',
1824 ];
1825
1826 $this->start_controls_section(
1827 'embedpress_opensea_control_section',
1828 [
1829 'label' => __('OpenSea Control Settings', 'embedpress'),
1830 'condition' => $condition,
1831 ]
1832 );
1833
1834 $this->add_control(
1835 'opense_important_note_single',
1836 [
1837 'type' => \Elementor\Controls_Manager::RAW_HTML,
1838 'raw' => esc_html__('These options take effect only when a Opensea Single Asset is embedded.', 'embedpress'),
1839 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
1840 'condition' => [
1841 'embedpress_pro_embeded_nft_type' => 'single'
1842 ],
1843
1844 ]
1845 );
1846 $this->add_control(
1847 'opense_important_note_collection',
1848 [
1849 'type' => \Elementor\Controls_Manager::RAW_HTML,
1850 'raw' => esc_html__('These options take effect only when a Opensea Collection is embedded.', 'embedpress'),
1851 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
1852 'condition' => [
1853 'embedpress_pro_embeded_nft_type' => 'collection'
1854 ],
1855 ]
1856 );
1857
1858 $this->add_control(
1859 'layout',
1860 [
1861 'label' => __('Layout', 'embedpress'),
1862 'type' => \Elementor\Controls_Manager::SELECT,
1863 'label_block' => false,
1864 'default' => 'ep-grid',
1865 'options' => [
1866 'ep-grid' => esc_html__('Grid', 'embedpress'),
1867 'ep-list' => esc_html__('List', 'embedpress'),
1868 ],
1869 'conditions' => [
1870 'terms' => [
1871 [
1872 'name' => 'embedpress_pro_embeded_nft_type',
1873 'operator' => '===',
1874 'value' => 'collection',
1875 ],
1876 ],
1877 ]
1878
1879 ]
1880 );
1881
1882
1883 $this->add_control(
1884 'preset',
1885 [
1886 'label' => __('Preset', 'embedpress'),
1887 'type' => \Elementor\Controls_Manager::SELECT,
1888 'label_block' => false,
1889 'default' => 'ep-preset-1',
1890 'options' => [
1891 'ep-preset-1' => esc_html__('Preset 1', 'embedpress'),
1892 'ep-preset-2' => esc_html__('Preset 2', 'embedpress'),
1893 ],
1894 'conditions' => [
1895 'terms' => [
1896 [
1897 'name' => 'embedpress_pro_embeded_nft_type',
1898 'operator' => '===',
1899 'value' => 'collection',
1900 'relation' => 'and'
1901 ],
1902 [
1903 'name' => 'layout',
1904 'operator' => '===',
1905 'value' => 'ep-grid',
1906 'relation' => 'and'
1907 ],
1908 ],
1909 ]
1910
1911 ]
1912 );
1913
1914 $this->add_control(
1915 'nftperrow',
1916 [
1917 'label' => __('Column', 'embedpress'),
1918 'type' => \Elementor\Controls_Manager::SELECT,
1919 'label_block' => false,
1920 'default' => '3',
1921 'options' => [
1922 '1' => esc_html__('1', 'embedpress'),
1923 '2' => esc_html__('2', 'embedpress'),
1924 '3' => esc_html__('3', 'embedpress'),
1925 '4' => esc_html__('4', 'embedpress'),
1926 '5' => esc_html__('5', 'embedpress'),
1927 '6' => esc_html__('6', 'embedpress'),
1928 'auto' => esc_html__('Auto', 'embedpress'),
1929 ],
1930 'condition' => [
1931 'embedpress_pro_embeded_nft_type' => ['collection']
1932 ],
1933
1934 ]
1935 );
1936
1937 $this->add_control(
1938 'gapbetweenitem',
1939 [
1940 'label' => esc_html__('Gap Between Item', 'embedpress'),
1941 'type' => \Elementor\Controls_Manager::SLIDER,
1942 'size_units' => ['px'],
1943 'range' => [
1944 'px' => [
1945 'min' => 1,
1946 'max' => 100,
1947 'step' => 1,
1948 ],
1949 ],
1950 'default' => [
1951 'unit' => 'px',
1952 'size' => 15,
1953 ],
1954 'condition' => [
1955 'embedpress_pro_embeded_nft_type' => ['collection']
1956 ],
1957 ]
1958 );
1959
1960 $this->add_control(
1961 'collectionname',
1962 [
1963 'label' => __('Collection Name', 'embedpress'),
1964 'type' => Controls_Manager::SWITCHER,
1965 'label_block' => false,
1966 'return_value' => 'yes',
1967 'label_off' => __('Hide', 'embedpress'),
1968 'label_on' => __('Show', 'embedpress'),
1969 'default' => 'yes',
1970 'condition' => [
1971 'embedpress_pro_embeded_nft_type' => 'single'
1972 ],
1973 ]
1974 );
1975 $this->add_control(
1976 'nftimage',
1977 [
1978 'label' => __('Thumbnail', 'embedpress'),
1979 'type' => Controls_Manager::SWITCHER,
1980 'label_block' => false,
1981 'return_value' => 'yes',
1982 'label_off' => __('Hide', 'embedpress'),
1983 'label_on' => __('Show', 'embedpress'),
1984 'default' => 'yes',
1985 'condition' => $condition,
1986 ]
1987 );
1988 $this->add_control(
1989 'nfttitle',
1990 [
1991 'label' => __('Title', 'embedpress'),
1992 'type' => Controls_Manager::SWITCHER,
1993 'label_block' => false,
1994 'return_value' => 'yes',
1995 'default' => '',
1996 'label_off' => __('Hide', 'embedpress'),
1997 'label_on' => __('Show', 'embedpress'),
1998 'default' => 'yes',
1999 'condition' => $condition,
2000 ]
2001 );
2002 $this->add_control(
2003 'nftcreator',
2004 [
2005 'label' => __('Creator', 'embedpress'),
2006 'type' => Controls_Manager::SWITCHER,
2007 'label_block' => false,
2008 'return_value' => 'yes',
2009 'default' => '',
2010 'label_off' => __('Hide', 'embedpress'),
2011 'label_on' => __('Show', 'embedpress'),
2012 'default' => 'yes',
2013 'condition' => $condition,
2014 ]
2015 );
2016
2017 $this->add_control(
2018 'prefix_nftcreator',
2019 [
2020 'label' => sprintf(__('Prefix %s', 'embedpress'), $this->pro_text),
2021 'type' => \Elementor\Controls_Manager::TEXT,
2022 'default' => esc_html__('Created By', 'embedpress'),
2023 'placeholder' => esc_html__('Created By', 'embedpress'),
2024 'classes' => $this->pro_class,
2025 'condition' => [
2026 'nftcreator' => 'yes',
2027 ]
2028 ]
2029 );
2030
2031 $this->add_control(
2032 'nftprice',
2033 [
2034 'label' => __('Current Price', 'embedpress'),
2035 'type' => Controls_Manager::SWITCHER,
2036 'label_block' => false,
2037 'return_value' => 'yes',
2038 'default' => '',
2039 'label_off' => __('Hide', 'embedpress'),
2040 'label_on' => __('Show', 'embedpress'),
2041 'default' => 'yes',
2042 'condition' => $condition,
2043 ]
2044 );
2045
2046 $this->add_control(
2047 'prefix_nftprice',
2048 [
2049 'label' => sprintf(__('Prefix %s', 'embedpress'), $this->pro_text),
2050 'type' => \Elementor\Controls_Manager::TEXT,
2051 'default' => esc_html__('Current Price', 'embedpress'),
2052 'placeholder' => esc_html__('Current Price', 'embedpress'),
2053 'classes' => $this->pro_class,
2054 'condition' => [
2055 'nftprice' => 'yes',
2056 ]
2057 ]
2058 );
2059
2060 $this->add_control(
2061 'nftlastsale',
2062 [
2063 'label' => __('Last Sale', 'embedpress'),
2064 'type' => Controls_Manager::SWITCHER,
2065 'label_block' => false,
2066 'return_value' => 'yes',
2067 'default' => '',
2068 'label_off' => __('Hide', 'embedpress'),
2069 'label_on' => __('Show', 'embedpress'),
2070 'default' => 'yes',
2071 'condition' => $condition,
2072 ]
2073 );
2074
2075 $this->add_control(
2076 'prefix_nftlastsale',
2077 [
2078 'label' => sprintf(__('Prefix %s', 'embedpress'), $this->pro_text),
2079 'type' => \Elementor\Controls_Manager::TEXT,
2080 'default' => esc_html__('Last Sale', 'embedpress'),
2081 'placeholder' => esc_html__('Last Sale', 'embedpress'),
2082 'classes' => $this->pro_class,
2083 'condition' => [
2084 'nftlastsale' => 'yes',
2085 ]
2086 ]
2087 );
2088
2089 $this->add_control(
2090 'nftbutton',
2091 [
2092 'label' => __('Button', 'embedpress'),
2093 'type' => Controls_Manager::SWITCHER,
2094 'label_block' => false,
2095 'return_value' => 'yes',
2096 'default' => '',
2097 'label_off' => __('Hide', 'embedpress'),
2098 'label_on' => __('Show', 'embedpress'),
2099 'default' => 'yes',
2100 'condition' => $condition,
2101 ]
2102 );
2103 $this->add_control(
2104 'label_nftbutton',
2105 [
2106 'label' => sprintf(__('Button Label %s', 'embedpress'), $this->pro_text),
2107 'type' => \Elementor\Controls_Manager::TEXT,
2108 'default' => esc_html__('See Details', 'embedpress'),
2109 'placeholder' => esc_html__('See Details', 'embedpress'),
2110 'classes' => $this->pro_class,
2111 'condition' => [
2112 'nftbutton' => 'yes',
2113 ]
2114 ]
2115 );
2116
2117 $this->add_control(
2118 'loadmore',
2119 [
2120 'label' => sprintf(__('Load More %s', 'embedpress'), $this->pro_text),
2121 'type' => Controls_Manager::SWITCHER,
2122 'label_block' => false,
2123 'return_value' => 'yes',
2124 'default' => '',
2125 'label_off' => __('Hide', 'embedpress'),
2126 'label_on' => __('Show', 'embedpress'),
2127 'default' => '',
2128 'classes' => $this->pro_class,
2129 'condition' => [
2130 'embedpress_pro_embeded_nft_type' => ['collection']
2131 ],
2132 ]
2133 );
2134 $this->add_control(
2135 'itemperpage',
2136 [
2137 'type' => \Elementor\Controls_Manager::NUMBER,
2138 'label' => esc_html__('Item Per Page', 'embedpress'),
2139 'placeholder' => '9',
2140 'min' => 1,
2141 'max' => 100,
2142 'step' => 1,
2143 'default' => 9,
2144 'condition' => [
2145 'loadmore' => 'yes'
2146 ],
2147 ]
2148 );
2149 $this->add_control(
2150 'loadmorelabel',
2151 [
2152 'type' => \Elementor\Controls_Manager::TEXT,
2153 'label' => esc_html__('Load More Label', 'embedpress'),
2154 'placeholder' => 'Load More',
2155 'default' => 'Load More',
2156 'condition' => [
2157 'loadmore' => 'yes'
2158 ],
2159 ]
2160 );
2161
2162 $this->add_control(
2163 'nftrank',
2164 [
2165 'label' => __('Rank', 'embedpress'),
2166 'type' => Controls_Manager::SWITCHER,
2167 'label_block' => false,
2168 'return_value' => 'yes',
2169 'label_off' => __('Hide', 'embedpress'),
2170 'label_on' => __('Show', 'embedpress'),
2171 'default' => 'yes',
2172 'condition' => [
2173 'embedpress_pro_embeded_nft_type' => 'single'
2174 ],
2175 ]
2176 );
2177 $this->add_control(
2178 'label_nftrank',
2179 [
2180 'label' => sprintf(__('Rank Label %s', 'embedpress'), $this->pro_text),
2181 'type' => \Elementor\Controls_Manager::TEXT,
2182 'default' => esc_html__('Rank', 'embedpress'),
2183 'placeholder' => esc_html__('Rank', 'embedpress'),
2184 'classes' => $this->pro_class,
2185 'condition' => [
2186 'nftrank' => 'yes',
2187 'embedpress_pro_embeded_nft_type!' => 'collection'
2188 ]
2189 ]
2190 );
2191
2192 $this->add_control(
2193 'nftdetails',
2194 [
2195 'label' => __('Details', 'embedpress'),
2196 'type' => Controls_Manager::SWITCHER,
2197 'label_block' => false,
2198 'return_value' => 'yes',
2199 'label_off' => __('Hide', 'embedpress'),
2200 'label_on' => __('Show', 'embedpress'),
2201 'default' => 'yes',
2202 'condition' => [
2203 'embedpress_pro_embeded_nft_type' => 'single'
2204 ],
2205 ]
2206 );
2207
2208 $this->add_control(
2209 'label_nftdetails',
2210 [
2211 'label' => sprintf(__('Details Label %s', 'embedpress'), $this->pro_text),
2212 'type' => \Elementor\Controls_Manager::TEXT,
2213 'default' => esc_html__('Details', 'embedpress'),
2214 'placeholder' => esc_html__('Details', 'embedpress'),
2215 'classes' => $this->pro_class,
2216 'condition' => [
2217 'nftdetails' => 'yes',
2218 'embedpress_pro_embeded_nft_type!' => 'collection'
2219 ]
2220 ]
2221 );
2222
2223 $this->end_controls_section();
2224 }
2225
2226 public function init_opensea_color_and_typography()
2227 {
2228 $condition = [
2229 'embedpress_pro_embeded_source' => 'opensea',
2230 ];
2231
2232 $this->start_controls_section(
2233 'embedpress_color_typography_control_section',
2234 [
2235 'label' => __('Color and Typography', 'embedpress'),
2236 'tab' => Controls_Manager::TAB_STYLE,
2237 'condition' => $condition,
2238 ]
2239 );
2240
2241 $this->add_control(
2242 'opense_color_important_note_single',
2243 [
2244 'type' => \Elementor\Controls_Manager::RAW_HTML,
2245 'raw' => esc_html__('These options take effect only when a Opensea Single Asset is embedded.', 'embedpress'),
2246 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
2247 'condition' => [
2248 'embedpress_pro_embeded_nft_type' => 'single'
2249 ],
2250
2251 ]
2252 );
2253 $this->add_control(
2254 'opense_color_important_note_collection',
2255 [
2256 'type' => \Elementor\Controls_Manager::RAW_HTML,
2257 'raw' => esc_html__('These options take effect only when a Opensea Collection is embedded.', 'embedpress'),
2258 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
2259 'condition' => [
2260 'embedpress_pro_embeded_nft_type' => 'collection'
2261 ],
2262 ]
2263 );
2264
2265
2266 $this->add_control(
2267 'item_heading',
2268 [
2269 'label' => esc_html__('Item', 'embedpress'),
2270 'type' => \Elementor\Controls_Manager::HEADING,
2271 'separator' => 'before',
2272 ]
2273 );
2274
2275 $this->add_control(
2276 'nft_item_background_color',
2277 [
2278 'label' => esc_html__('Background Color', 'embedpress'),
2279 'type' => \Elementor\Controls_Manager::COLOR,
2280 'selectors' => [
2281 '{{WRAPPER}} .ep_nft_content_wrap .ep_nft_item' => 'background-color: {{VALUE}}',
2282 ],
2283 ]
2284 );
2285
2286 $this->add_control(
2287 'collectionname_heading',
2288 [
2289 'label' => esc_html__('Collection Name', 'embedpress'),
2290 'type' => \Elementor\Controls_Manager::HEADING,
2291 'separator' => 'before',
2292 ]
2293 );
2294
2295 $this->add_control(
2296 'nft_collectionname_color',
2297 [
2298 'label' => esc_html__('Color', 'embedpress'),
2299 'type' => \Elementor\Controls_Manager::COLOR,
2300 'selectors' => [
2301 '{{WRAPPER}} .ep-nft-single-item-wraper a.CollectionLink--link' => 'color: {{VALUE}}',
2302 ],
2303 ]
2304 );
2305 $this->add_control(
2306 'nft_collectionname_hover_color',
2307 [
2308 'label' => esc_html__('Hove Color', 'embedpress'),
2309 'type' => \Elementor\Controls_Manager::COLOR,
2310 'selectors' => [
2311 '{{WRAPPER}} .ep-nft-single-item-wraper a.CollectionLink--link:hover' => 'color: {{VALUE}}',
2312 ],
2313 ]
2314 );
2315 $this->add_group_control(
2316 \Elementor\Group_Control_Typography::get_type(),
2317 [
2318 'name' => 'nft_collectionname_typography',
2319 'selector' => '{{WRAPPER}} .ep-nft-single-item-wraper a.CollectionLink--link',
2320 ]
2321 );
2322
2323 $this->add_control(
2324 'title_heading',
2325 [
2326 'label' => esc_html__('Title', 'embedpress'),
2327 'type' => \Elementor\Controls_Manager::HEADING,
2328 'separator' => 'before',
2329 ]
2330 );
2331
2332 $this->add_control(
2333 'nft_title_color',
2334 [
2335 'label' => esc_html__('Color', 'embedpress'),
2336 'type' => \Elementor\Controls_Manager::COLOR,
2337 'selectors' => [
2338 '{{WRAPPER}} .ep_nft_title' => 'color: {{VALUE}}',
2339 ],
2340 ]
2341 );
2342 $this->add_group_control(
2343 \Elementor\Group_Control_Typography::get_type(),
2344 [
2345 'name' => 'nft_title_typography',
2346 'selector' => '{{WRAPPER}} .ep_nft_title',
2347 ]
2348 );
2349
2350
2351 $this->add_control(
2352 'creator_heading',
2353 [
2354 'label' => esc_html__('Creator', 'embedpress'),
2355 'type' => \Elementor\Controls_Manager::HEADING,
2356 'separator' => 'before',
2357 ]
2358 );
2359
2360 $this->add_control(
2361 'nft_creator_color',
2362 [
2363 'label' => esc_html__('Color', 'embedpress'),
2364 'type' => \Elementor\Controls_Manager::COLOR,
2365 'selectors' => [
2366 '{{WRAPPER}} .ep_nft_creator span' => 'color: {{VALUE}}',
2367 ],
2368 ]
2369 );
2370 $this->add_group_control(
2371 \Elementor\Group_Control_Typography::get_type(),
2372 [
2373 'name' => 'nft_creator_typography',
2374 'selector' => '{{WRAPPER}} .ep_nft_creator span',
2375 ]
2376 );
2377
2378 $this->add_control(
2379 'nft_created_by_color',
2380 [
2381 'label' => esc_html__('Link Color', 'embedpress'),
2382 'type' => \Elementor\Controls_Manager::COLOR,
2383 'selectors' => [
2384 '{{WRAPPER}} .ep_nft_creator span a' => 'color: {{VALUE}}',
2385 ],
2386 ]
2387 );
2388 $this->add_group_control(
2389 \Elementor\Group_Control_Typography::get_type(),
2390 [
2391 'label' => esc_html__('Link Typography', 'embedpress'),
2392 'name' => 'nft_created_by_typography',
2393 'selector' => '{{WRAPPER}} .ep_nft_creator span a',
2394 ]
2395 );
2396
2397 $this->add_control(
2398 'price_heading',
2399 [
2400 'label' => esc_html__('Current Price', 'embedpress'),
2401 'type' => \Elementor\Controls_Manager::HEADING,
2402 'separator' => 'before',
2403 ]
2404 );
2405
2406 $this->add_control(
2407 'nft_price_color',
2408 [
2409 'label' => esc_html__('Color', 'embedpress'),
2410 'type' => \Elementor\Controls_Manager::COLOR,
2411 'selectors' => [
2412 '{{WRAPPER}} .ep_current_price span' => 'color: {{VALUE}}',
2413 ],
2414 ]
2415 );
2416
2417 $this->add_group_control(
2418 \Elementor\Group_Control_Typography::get_type(),
2419 [
2420 'name' => 'nft_price_typography',
2421 'selector' => '{{WRAPPER}} .ep_current_price span',
2422 ]
2423 );
2424 $this->add_control(
2425 'last_sale_heading',
2426 [
2427 'label' => esc_html__('Last Sale Price', 'embedpress'),
2428 'type' => \Elementor\Controls_Manager::HEADING,
2429 'separator' => 'before',
2430 ]
2431 );
2432
2433 $this->add_control(
2434 'nft_last_sale_color',
2435 [
2436 'label' => esc_html__('Color', 'embedpress'),
2437 'type' => \Elementor\Controls_Manager::COLOR,
2438 'selectors' => [
2439 '{{WRAPPER}} .ep_nft_last_sale span' => 'color: {{VALUE}}',
2440 ],
2441 ]
2442 );
2443 $this->add_group_control(
2444 \Elementor\Group_Control_Typography::get_type(),
2445 [
2446 'name' => 'nft_last_sale_typography',
2447 'selector' => '{{WRAPPER}} .ep_nft_last_sale span',
2448 ]
2449 );
2450 $this->add_control(
2451 'nftbutton_heading',
2452 [
2453 'label' => esc_html__('Button', 'embedpress'),
2454 'type' => \Elementor\Controls_Manager::HEADING,
2455 'separator' => 'before',
2456 ]
2457 );
2458
2459
2460 $this->add_control(
2461 'nftbutton_color',
2462 [
2463 'label' => esc_html__('Color', 'embedpress'),
2464 'type' => \Elementor\Controls_Manager::COLOR,
2465 'selectors' => [
2466 '{{WRAPPER}} .ep-nft-gallery-wrapper.ep-nft-gallery-r1a5mbx .ep_nft_button a' => 'color: {{VALUE}}',
2467 ],
2468 ]
2469 );
2470 $this->add_control(
2471 'nftbutton_bg_color',
2472 [
2473 'label' => esc_html__('Background Color', 'embedpress'),
2474 'type' => \Elementor\Controls_Manager::COLOR,
2475 'selectors' => [
2476 '{{WRAPPER}} .ep-nft-gallery-wrapper.ep-nft-gallery-r1a5mbx .ep_nft_button a' => 'background-color: {{VALUE}}',
2477 ],
2478 ]
2479 );
2480 $this->add_group_control(
2481 \Elementor\Group_Control_Typography::get_type(),
2482 [
2483 'name' => 'nftbutton_typography',
2484 'selector' => '{{WRAPPER}} .ep-nft-gallery-wrapper.ep-nft-gallery-r1a5mbx .ep_nft_button a',
2485 ]
2486 );
2487 $this->add_control(
2488 'nft_loadmore_style',
2489 [
2490 'label' => esc_html__('Load More', 'embedpress'),
2491 'type' => \Elementor\Controls_Manager::HEADING,
2492 'separator' => 'before',
2493 'condition' => [
2494 'loadmore' => 'yes',
2495 'embedpress_pro_embeded_nft_type' => 'collection'
2496 ]
2497 ]
2498 );
2499
2500 $this->add_control(
2501 'nft_loadmore_color',
2502 [
2503 'label' => esc_html__('Text Color', 'embedpress'),
2504 'type' => \Elementor\Controls_Manager::COLOR,
2505 'selectors' => [
2506 '{{WRAPPER}} .nft-loadmore' => 'color: {{VALUE}}!important;',
2507 '{{WRAPPER}} .nft-loadmore svg' => 'fill: {{VALUE}}!important;',
2508 ],
2509 'condition' => [
2510 'loadmore' => 'yes',
2511 'embedpress_pro_embeded_nft_type' => 'collection'
2512 ]
2513 ]
2514 );
2515 $this->add_group_control(
2516 \Elementor\Group_Control_Typography::get_type(),
2517 [
2518 'name' => 'nft_loadmore_typography',
2519 'selector' => '{{WRAPPER}} .nft-loadmore, {{WRAPPER}} .nft-loadmore svg',
2520 'condition' => [
2521 'loadmore' => 'yes',
2522 'embedpress_pro_embeded_nft_type' => 'collection'
2523 ]
2524 ]
2525 );
2526 $this->add_control(
2527 'nft_loadmore_bgcolor',
2528 [
2529 'label' => esc_html__('Background Color', 'embedpress'),
2530 'type' => \Elementor\Controls_Manager::COLOR,
2531 'selectors' => [
2532 '{{WRAPPER}} .nft-loadmore' => 'background-color: {{VALUE}}!important;',
2533 ],
2534 'condition' => [
2535 'loadmore' => 'yes',
2536 'embedpress_pro_embeded_nft_type' => 'collection'
2537 ]
2538 ]
2539 );
2540
2541 $this->add_control(
2542 'nftrank_heading',
2543 [
2544 'label' => esc_html__('Rank', 'embedpress'),
2545 'type' => \Elementor\Controls_Manager::HEADING,
2546 'separator' => 'before',
2547 'condition' => [
2548 'nftrank' => 'yes',
2549 'embedpress_pro_embeded_nft_type!' => 'collection'
2550 ]
2551 ]
2552 );
2553
2554 $this->add_control(
2555 'nftrank_label_color',
2556 [
2557 'label' => esc_html__('Label Color', 'embedpress'),
2558 'type' => \Elementor\Controls_Manager::COLOR,
2559 'selectors' => [
2560 '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper' => 'color: {{VALUE}}!important;',
2561 ],
2562 'condition' => [
2563 'nftrank' => 'yes',
2564 'embedpress_pro_embeded_nft_type!' => 'collection'
2565 ]
2566 ]
2567 );
2568 $this->add_group_control(
2569 \Elementor\Group_Control_Typography::get_type(),
2570 [
2571 'name' => 'nftrank_label_typography',
2572 'selector' => '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper ',
2573 'condition' => [
2574 'nftrank' => 'yes',
2575 'embedpress_pro_embeded_nft_type!' => 'collection'
2576 ]
2577 ]
2578 );
2579 $this->add_control(
2580 'nftrank_color',
2581 [
2582 'label' => esc_html__('Rank Color', 'embedpress'),
2583 'type' => \Elementor\Controls_Manager::COLOR,
2584 'selectors' => [
2585 '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper span.ep-nft-rank' => 'color: {{VALUE}}!important;',
2586 ],
2587 'condition' => [
2588 'nftrank' => 'yes',
2589 'embedpress_pro_embeded_nft_type!' => 'collection'
2590 ]
2591 ]
2592 );
2593 $this->add_control(
2594 'nftrank_border_color',
2595 [
2596 'label' => esc_html__('Border Color', 'embedpress'),
2597 'type' => \Elementor\Controls_Manager::COLOR,
2598 'selectors' => [
2599 '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper span.ep-nft-rank' => 'border-color: {{VALUE}}!important',
2600 ],
2601 'condition' => [
2602 'nftrank' => 'yes',
2603 'embedpress_pro_embeded_nft_type!' => 'collection'
2604 ]
2605 ]
2606 );
2607 $this->add_group_control(
2608 \Elementor\Group_Control_Typography::get_type(),
2609 [
2610 'name' => 'nftrank_typography',
2611 'selector' => '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper span.ep-nft-rank',
2612 'condition' => [
2613 'nftrank' => 'yes',
2614 'embedpress_pro_embeded_nft_type!' => 'collection'
2615 ]
2616 ]
2617 );
2618
2619
2620
2621 $this->add_control(
2622 'nftdetails_heading',
2623 [
2624 'label' => esc_html__('Details', 'embedpress'),
2625 'type' => \Elementor\Controls_Manager::HEADING,
2626 'separator' => 'before',
2627 'condition' => [
2628 'nftrank' => 'yes',
2629 'embedpress_pro_embeded_nft_type!' => 'collection'
2630 ]
2631 ]
2632 );
2633
2634 $this->add_control(
2635 'nftdetail_title_color',
2636 [
2637 'label' => esc_html__('Title Color', 'embedpress'),
2638 'type' => \Elementor\Controls_Manager::COLOR,
2639 'selectors' => [
2640 '{{WRAPPER}} .ep-title' => 'color: {{VALUE}}',
2641 ],
2642 'condition' => [
2643 'nftrank' => 'yes',
2644 'embedpress_pro_embeded_nft_type!' => 'collection'
2645 ]
2646 ]
2647 );
2648 $this->add_group_control(
2649 \Elementor\Group_Control_Typography::get_type(),
2650 [
2651 'label' => esc_html__('Title Typography', 'embedpress'),
2652 'name' => 'nftdetail_title_typography',
2653 'selector' => '{{WRAPPER}} .ep-title',
2654 'condition' => [
2655 'nftrank' => 'yes',
2656 'embedpress_pro_embeded_nft_type!' => 'collection'
2657 ]
2658 ]
2659 );
2660
2661 $this->add_control(
2662 'nftdetail_color',
2663 [
2664 'label' => esc_html__('Content Color', 'embedpress'),
2665 'type' => \Elementor\Controls_Manager::COLOR,
2666 'selectors' => [
2667 '{{WRAPPER}} .ep-asset-detail-item' => 'color: {{VALUE}}',
2668 ],
2669 'condition' => [
2670 'nftrank' => 'yes',
2671 'embedpress_pro_embeded_nft_type!' => 'collection'
2672 ]
2673 ]
2674 );
2675 $this->add_group_control(
2676 \Elementor\Group_Control_Typography::get_type(),
2677 [
2678 'label' => esc_html__('Content Typography', 'embedpress'),
2679 'name' => 'nftdetail_typography',
2680 'selector' => '{{WRAPPER}} .ep-asset-detail-item',
2681 'condition' => [
2682 'nftrank' => 'yes',
2683 'embedpress_pro_embeded_nft_type!' => 'collection'
2684 ]
2685 ]
2686 );
2687
2688 $this->add_control(
2689 'nftdetail_link_color',
2690 [
2691 'label' => esc_html__('Link Color', 'embedpress'),
2692 'type' => \Elementor\Controls_Manager::COLOR,
2693 'selectors' => [
2694 '{{WRAPPER}} .ep-asset-detail-item a' => 'color: {{VALUE}}',
2695 ],
2696 'condition' => [
2697 'nftrank' => 'yes',
2698 'embedpress_pro_embeded_nft_type!' => 'collection'
2699 ]
2700 ]
2701 );
2702 $this->add_group_control(
2703 \Elementor\Group_Control_Typography::get_type(),
2704 [
2705 'name' => 'nftdetail_link_typography',
2706 'selector' => '{{WRAPPER}} .ep-asset-detail-item a, .ep-asset-detail-item',
2707 'condition' => [
2708 'nftrank' => 'yes',
2709 'embedpress_pro_embeded_nft_type!' => 'collection'
2710 ]
2711 ]
2712 );
2713
2714
2715 $this->end_controls_section();
2716 }
2717
2718 //End OpenSea controls
2719
2720
2721
2722 /**
2723 * Instagram Feed Controls
2724 */
2725 public function init_instafeed_control(){
2726 $condition = [
2727 'embedpress_pro_embeded_source' => 'instafeed'
2728 ];
2729 $disableAi = [
2730 'active' => false,
2731 ];
2732
2733 $this->add_control(
2734 'instaLayout',
2735 [
2736 'type' => \Elementor\Controls_Manager::SELECT,
2737 'label' => esc_html__( 'Layout', 'embedpress' ),
2738 'options' => [
2739 'insta-grid' => esc_html__( 'Grid', 'embedpress' ),
2740 'insta-masonry' => sprintf(__('Masonry%s', 'embedpress'), $this->pro_label),
2741 'insta-carousel' => sprintf(__('Carousel%s', 'embedpress'), $this->pro_label),
2742 'insta-justify' => sprintf(__('Justify%s', 'embedpress'), $this->pro_label),
2743 ],
2744 'default' => 'insta-grid',
2745 'condition' => $condition,
2746 ]
2747 );
2748
2749 if ( !apply_filters('embedpress/is_allow_rander', false) ) {
2750 $this->add_control(
2751 'embedpress_insta_layout__pro_enable_warning',
2752 [
2753 'label' => sprintf( '<a style="color: red" target="_blank" href="https://wpdeveloper.com/in/upgrade-embedpress">%s</a>',
2754 esc_html__( 'Only Available in Pro Version!', 'essential-addons-for-elementor-lite' ) ),
2755 'type' => Controls_Manager::RAW_HTML,
2756 'condition' => [
2757 'instaLayout' => [ 'insta-masonry', 'insta-carousel' ],
2758 ],
2759 ]
2760 );
2761 }
2762
2763 $this->add_control(
2764 'instafeedColumns',
2765 [
2766 'label' => __('Column', 'embedpress'),
2767 'type' => \Elementor\Controls_Manager::SELECT,
2768 'label_block' => false,
2769 'default' => '3',
2770 'options' => [
2771 '2' => esc_html__('2', 'embedpress'),
2772 '3' => esc_html__('3', 'embedpress'),
2773 '4' => esc_html__('4', 'embedpress'),
2774 '6' => esc_html__('6', 'embedpress'),
2775 'auto' => esc_html__('Auto', 'embedpress'),
2776 ],
2777 'condition' => [
2778 'instaLayout' => ['insta-grid', 'insta-masonry'],
2779 'embedpress_pro_embeded_source' => 'instafeed'
2780 ],
2781 ]
2782 );
2783
2784 $this->add_control(
2785 'instafeedColumnsGap',
2786 [
2787 'label' => esc_html__( 'Column Gap', 'embedpress' ),
2788 'type' => \Elementor\Controls_Manager::NUMBER,
2789 'min' => 0,
2790 'max' => 100,
2791 'step' => 1,
2792 'default' => 5,
2793 'condition' => [
2794 'instaLayout' => [ 'insta-masonry', 'insta-grid' ],
2795 ],
2796 ]
2797 );
2798
2799 $this->add_control(
2800 'embedpress_instafeed_slide_show',
2801 [
2802 'type' => \Elementor\Controls_Manager::SELECT,
2803 'label' => esc_html__( 'Slides to Show', 'embedpress' ),
2804 'options' => [
2805 '1' => esc_html__( '1', 'embedpress' ),
2806 '2' => esc_html__( '2', 'embedpress' ),
2807 '3' => esc_html__( '3', 'embedpress' ),
2808 '4' => esc_html__( '4', 'embedpress' ),
2809 '5' => esc_html__( '5', 'embedpress' ),
2810 '6' => esc_html__( '6', 'embedpress' ),
2811 '7' => esc_html__( '7', 'embedpress' ),
2812 '8' => esc_html__( '8', 'embedpress' ),
2813 '9' => esc_html__( '9', 'embedpress' ),
2814 '10' => esc_html__( '10', 'embedpress' ),
2815 ],
2816 'default' => '5',
2817 'condition' => [
2818 'embedpress_pro_embeded_source' => 'instafeed',
2819 'instaLayout' => 'insta-carousel'
2820 ],
2821 ]
2822 );
2823
2824 $this->add_control(
2825 'embedpress_carousel_autoplay',
2826 [
2827 'label' => __('Auto Play', 'embedpress'),
2828 'type' => Controls_Manager::SWITCHER,
2829 'label_block' => false,
2830 'return_value' => 'yes',
2831 'default' => '',
2832 'condition' => [
2833 'embedpress_pro_embeded_source' => 'instafeed',
2834 'instaLayout' => 'insta-carousel'
2835 ],
2836 ]
2837 );
2838 $this->add_control(
2839 'embedpress_carousel_autoplay_speed',
2840 [
2841 'label' => esc_html__( 'Autoplay Speed(ms)', 'embedpress' ),
2842 'type' => \Elementor\Controls_Manager::NUMBER,
2843 'min' => 0,
2844 'step' => 1,
2845 'default' => 0,
2846 'condition' => [
2847 'embedpress_pro_embeded_source' => 'instafeed',
2848 'instaLayout' => 'insta-carousel'
2849 ],
2850 ]
2851 );
2852 $this->add_control(
2853 'embedpress_carousel_transition_speed',
2854 [
2855 'label' => esc_html__( 'Transition Speed(ms)', 'embedpress' ),
2856 'type' => \Elementor\Controls_Manager::NUMBER,
2857 'min' => 0,
2858 'step' => 1,
2859 'default' => 0,
2860 'condition' => [
2861 'embedpress_pro_embeded_source' => 'instafeed',
2862 'instaLayout' => 'insta-carousel'
2863 ],
2864 ]
2865 );
2866 $this->add_control(
2867 'embedpress_carousel_loop',
2868 [
2869 'label' => __('Loop', 'embedpress'),
2870 'type' => Controls_Manager::SWITCHER,
2871 'label_block' => false,
2872 'return_value' => 'yes',
2873 'default' => 'yes',
2874 'condition' => [
2875 'embedpress_pro_embeded_source' => 'instafeed',
2876 'instaLayout' => 'insta-carousel'
2877 ],
2878 ]
2879 );
2880
2881 $this->add_control(
2882 'embedpress_carousel_arrows',
2883 [
2884 'label' => __('Arrows', 'embedpress'),
2885 'type' => Controls_Manager::SWITCHER,
2886 'label_block' => false,
2887 'return_value' => 'yes',
2888 'default' => 'yes',
2889 'condition' => [
2890 'embedpress_pro_embeded_source' => 'instafeed',
2891 'instaLayout' => 'insta-carousel'
2892 ],
2893 ]
2894 );
2895
2896
2897 $this->add_control(
2898 'embedpress_carousel_spacing',
2899 [
2900 'label' => esc_html__( 'Spacing', 'embedpress' ),
2901 'type' => \Elementor\Controls_Manager::NUMBER,
2902 'min' => 0,
2903 'max' => 100,
2904 'step' => 1,
2905 'default' => 0,
2906 'condition' => [
2907 'embedpress_pro_embeded_source' => 'instafeed',
2908 'instaLayout' => 'insta-carousel'
2909 ],
2910 ]
2911 );
2912
2913 $this->add_control(
2914 'instafeedPostsPerPage',
2915 [
2916 'label' => esc_html__( 'Posts Per Page', 'embedpress' ),
2917 'type' => \Elementor\Controls_Manager::NUMBER,
2918 'min' => 1,
2919 'max' => 100,
2920 'step' => 12,
2921 'default' => 12,
2922 'condition' => [
2923 'embedpress_pro_embeded_source' => 'instafeed',
2924 ],
2925 ]
2926 );
2927
2928 $this->add_control(
2929 'instafeedTab',
2930 [
2931 'label' => sprintf(__('Feed Tab %s', 'embedpress'), $this->pro_text),
2932 'type' => Controls_Manager::SWITCHER,
2933 'classes' => $this->pro_class,
2934 'label_block' => false,
2935 'return_value' => 'yes',
2936 'default' => 'yes',
2937 'condition' => $condition,
2938 ]
2939 );
2940
2941 $this->add_control(
2942 'instafeedLikesCount',
2943 [
2944 'label' => sprintf(__('Like Count %s', 'embedpress'), $this->pro_text),
2945 'type' => Controls_Manager::SWITCHER,
2946 'classes' => $this->pro_class,
2947 'label_block' => false,
2948 'return_value' => 'true',
2949 'default' => 'true',
2950 'conditions' => [
2951 'relation' => 'or',
2952 'terms' => [
2953 [
2954 'name' => 'instafeedFeedType',
2955 'operator' => '===',
2956 'value' => 'hashtag_type',
2957 ],
2958 [
2959 'relation' => 'and',
2960 'terms' => [
2961 [
2962 'name' => 'instafeedAccountType',
2963 'operator' => '===',
2964 'value' => 'business',
2965 ],
2966 [
2967 'name' => 'embedpress_pro_embeded_source',
2968 'operator' => '===',
2969 'value' => 'instafeed',
2970 ],
2971 ],
2972 ],
2973 ],
2974 ],
2975 ]
2976 );
2977
2978 $this->add_control(
2979 'instafeedCommentsCount',
2980 [
2981 'label' => sprintf(__('Comments Count %s', 'embedpress'), $this->pro_text),
2982 'type' => Controls_Manager::SWITCHER,
2983 'classes' => $this->pro_class,
2984 'label_block' => false,
2985 'return_value' => 'true',
2986 'default' => 'true',
2987
2988 'conditions' => [
2989 'relation' => 'or',
2990 'terms' => [
2991 [
2992 'name' => 'instafeedFeedType',
2993 'operator' => '===',
2994 'value' => 'hashtag_type',
2995 ],
2996 [
2997 'relation' => 'and',
2998 'terms' => [
2999 [
3000 'name' => 'instafeedAccountType',
3001 'operator' => '===',
3002 'value' => 'business',
3003 ],
3004 [
3005 'name' => 'embedpress_pro_embeded_source',
3006 'operator' => '===',
3007 'value' => 'instafeed',
3008 ],
3009 ],
3010 ],
3011 ],
3012 ],
3013
3014 ]
3015 );
3016
3017
3018 $this->add_control(
3019 'instafeedPopup',
3020 [
3021 'label' => __('Popup', 'embedpress'),
3022 'type' => Controls_Manager::SWITCHER,
3023 'label_block' => false,
3024 'return_value' => 'yes',
3025 'default' => 'yes',
3026 'condition' => $condition,
3027 ]
3028 );
3029
3030 $this->add_control(
3031 'instafeedPopupFollowBtn',
3032 [
3033 'label' => __('Popup Follow Button', 'embedpress'),
3034 'type' => Controls_Manager::SWITCHER,
3035 'label_block' => false,
3036 'return_value' => 'yes',
3037 'default' => 'yes',
3038 'condition' => [
3039 'embedpress_pro_embeded_source' => 'instafeed',
3040 'instafeedPopup' => 'yes'
3041 ],
3042 ]
3043 );
3044
3045 $this->add_control(
3046 'instafeedPopupFollowBtnLabel',
3047 [
3048 'type' => \Elementor\Controls_Manager::TEXT,
3049 'label' => esc_html__('Follow Button Label', 'embedpress'),
3050 'placeholder' => 'Follow',
3051 'default' => 'Follow',
3052 'separator' => 'after',
3053 'condition' => [
3054 'instafeedPopupFollowBtn' => 'yes',
3055 'instafeedPopup' => 'yes',
3056 'embedpress_pro_embeded_source' => 'instafeed'
3057 ],
3058 'ai' => $disableAi
3059 ]
3060 );
3061
3062 $this->add_control(
3063 'instafeedLoadmore',
3064 [
3065 'label' => __('Load More', 'embedpress'),
3066 'type' => Controls_Manager::SWITCHER,
3067 'label_block' => false,
3068 'return_value' => 'yes',
3069 'default' => 'yes',
3070 'condition' => [
3071 'embedpress_pro_embeded_source' => 'instafeed',
3072 'instaLayout!' => 'insta-carousel'
3073 ],
3074 ]
3075 );
3076 $this->add_control(
3077 'instafeedLoadmoreLabel',
3078 [
3079 'type' => \Elementor\Controls_Manager::TEXT,
3080 'label' => esc_html__('Load More Button Label', 'embedpress'),
3081 'placeholder' => 'Load More',
3082 'default' => 'Load More',
3083 'condition' => [
3084 'embedpress_pro_embeded_source' => 'instafeed',
3085 'instafeedLoadmore' => 'yes',
3086 'instaLayout!' => 'insta-carousel'
3087 ],
3088 'ai' => $disableAi
3089 ]
3090 );
3091
3092 }
3093
3094 public function init_instafeed_control_section()
3095 {
3096 $condition = [
3097 'embedpress_pro_embeded_source' => 'instafeed'
3098 ];
3099 $disableAi = [
3100 'active' => false,
3101 ];
3102
3103 $this->start_controls_section(
3104 'embedpress_instafeed_profile_section',
3105 [
3106 'label' => __('Instagram Profile Settings', 'embedpress'),
3107 'condition' => [
3108 'embedpress_pro_embeded_source' => 'instafeed'
3109 ],
3110 ]
3111 );
3112
3113
3114 $this->add_control(
3115 'instafeedProfileImage',
3116 [
3117 'label' => __('Profile Image', 'embedpress'),
3118 'type' => Controls_Manager::SWITCHER,
3119 'label_block' => false,
3120 'return_value' => 'yes',
3121 'default' => 'yes',
3122 'condition' => [
3123 'embedpress_pro_embeded_source' => 'instafeed'
3124 ],
3125 ]
3126 );
3127
3128 $this->add_control(
3129 "instafeedProfileImageUrl",
3130 [
3131 'label' => sprintf(__('Image %s', 'embedpress'), $this->pro_text),
3132 'type' => Controls_Manager::MEDIA,
3133 'classes' => $this->pro_class,
3134 'dynamic' => [
3135 'active' => false,
3136 ],
3137 'condition' => [
3138 'instafeedProfileImage' => 'yes',
3139 'embedpress_pro_embeded_source' => 'instafeed'
3140 ],
3141 'ai' => $disableAi
3142 ]
3143 );
3144
3145
3146 $this->add_control(
3147 'instafeedFollowBtn',
3148 [
3149 'label' => __('Follow Button', 'embedpress'),
3150 'type' => Controls_Manager::SWITCHER,
3151 'label_block' => false,
3152 'return_value' => 'yes',
3153 'default' => 'yes',
3154 'condition' => $condition,
3155 ]
3156 );
3157
3158 $this->add_control(
3159 'instafeedFollowBtnLabel',
3160 [
3161 'label' => sprintf(__('Button Label %s', 'embedpress'), $this->pro_text),
3162 'type' => Controls_Manager::TEXT,
3163 'classes' => $this->pro_class,
3164 'placeholder' => __('Follow', 'embedpress'),
3165 'default' => 'Follow',
3166 'separator' => 'after',
3167 'label_block' => false,
3168 'condition' => [
3169 'instafeedFollowBtn' => 'yes',
3170 'embedpress_pro_embeded_source' => 'instafeed'
3171 ],
3172 'ai' => $disableAi
3173 ]
3174 );
3175
3176 $this->add_control(
3177 'instafeedPostsCount',
3178 [
3179 'label' => __('Posts Count', 'embedpress'),
3180 'type' => Controls_Manager::SWITCHER,
3181 'label_block' => false,
3182 'return_value' => 'yes',
3183 'default' => 'yes',
3184 'condition' => [
3185 'embedpress_pro_embeded_source' => 'instafeed',
3186 'instafeedFeedType!' => 'hashtag_type'
3187 ],
3188 ]
3189 );
3190 $this->add_control(
3191 'instafeedPostsCountText',
3192 [
3193 'label' => __('Count Text', 'embedpress'),
3194 'type' => Controls_Manager::TEXT,
3195 'placeholder' => __('[count] posts', 'embedpress'),
3196 'default' => '[count] posts',
3197 'label_block' => false,
3198 'separator' => 'after',
3199 'condition' => [
3200 'instafeedPostsCount' => 'yes',
3201 'instafeedFeedType!' => 'hashtag_type',
3202 'embedpress_pro_embeded_source' => 'instafeed',
3203 ],
3204 'ai' => $disableAi
3205 ]
3206 );
3207 $this->add_control(
3208 'instafeedFollowersCount',
3209 [
3210 'label' => __('Followers Count', 'embedpress'),
3211 'type' => Controls_Manager::SWITCHER,
3212 'label_block' => false,
3213 'return_value' => 'yes',
3214 'default' => 'yes',
3215 'condition' => [
3216 'instafeedAccountType!' => 'personal',
3217 'instafeedFeedType!' => 'hashtag_type',
3218 'embedpress_pro_embeded_source' => 'instafeed',
3219 ],
3220 ]
3221 );
3222 $this->add_control(
3223 'instafeedFollowersCountText',
3224 [
3225 'label' => __('Count Text', 'embedpress'),
3226 'type' => Controls_Manager::TEXT,
3227 'placeholder' => __('[count] followers', 'embedpress'),
3228 'default' => '[count] followers',
3229 'label_block' => false,
3230 'separator' => 'after',
3231 'condition' => [
3232 'instafeedAccountType!' => 'personal',
3233 'instafeedFollowersCount' => 'yes',
3234 'instafeedFeedType!' => 'hashtag_type',
3235 'embedpress_pro_embeded_source' => 'instafeed'
3236 ],
3237 'ai' => $disableAi
3238 ]
3239 );
3240
3241 $this->add_control(
3242 'instafeedAccName',
3243 [
3244 'label' => __('Account Name', 'embedpress'),
3245 'type' => Controls_Manager::SWITCHER,
3246 'label_block' => false,
3247 'return_value' => 'yes',
3248 'default' => 'yes',
3249 'condition' => [
3250 'instafeedAccountType!' => 'personal',
3251 'instafeedFeedType!' => 'hashtag_type',
3252 'embedpress_pro_embeded_source' => 'instafeed'
3253 ],
3254 ]
3255 );
3256 $this->end_controls_section();
3257
3258 $this->start_controls_section(
3259 'embedpress_instafeed_control_section',
3260 [
3261 'label' => __('Instagram Feed Settings', 'embedpress'),
3262 'condition' => [
3263 'embedpress_pro_embeded_source' => 'instafeed'
3264 ],
3265 ]
3266 );
3267
3268 $this->init_instafeed_control();
3269
3270 $this->end_controls_section();
3271
3272
3273
3274 }
3275
3276
3277 //End Feed Controls
3278
3279
3280 /**
3281 * Calendly Controls
3282 */
3283 public function init_calendly_control_section()
3284 {
3285
3286 $condition = [
3287 'embedpress_pro_embeded_source' => 'calendly',
3288 ];
3289
3290 $this->start_controls_section(
3291 'embedpress_calendly_control_section',
3292 [
3293 'label' => __('Calendly Controls', 'embedpress'),
3294 'condition' => $condition,
3295 ]
3296 );
3297 $this->add_control(
3298 'cEmbedType',
3299 [
3300 'label' => __('Embed Type', 'embedpress'),
3301 'type' => \Elementor\Controls_Manager::SELECT,
3302 'default' => 'inline',
3303 'options' => [
3304 'inline' => __('Inline', 'embedpress'),
3305 'popup_button' => __('Popup Button', 'embedpress'),
3306 ],
3307 'condition' => $condition
3308 ]
3309 );
3310 $this->add_control(
3311 'popupControlsHeadding',
3312 [
3313 'label' => esc_html__('Popup Button Settings', 'embedpress'),
3314 'type' => \Elementor\Controls_Manager::HEADING,
3315 'separator' => 'before',
3316 'condition' => [
3317 'embedpress_pro_embeded_source' => 'calendly',
3318 'cEmbedType' => 'popup_button'
3319 ]
3320 ]
3321 );
3322 $this->add_control(
3323 'cPopupButtonText',
3324 [
3325 'label' => __('Button Text', 'embedpress'),
3326 'type' => \Elementor\Controls_Manager::TEXT,
3327 'label_block' => true,
3328 'default' => 'Schedule time with me',
3329 'condition' => [
3330 'embedpress_pro_embeded_source' => 'calendly',
3331 'cEmbedType' => 'popup_button'
3332 ],
3333 'ai' => [
3334 'active' => false,
3335 ],
3336 ]
3337 );
3338
3339
3340 $this->add_control(
3341 'cPopupButtonTextColor',
3342 [
3343 'label' => __('Text Color', 'embedpress'),
3344 'type' => \Elementor\Controls_Manager::COLOR,
3345 'default' => '#ffffff',
3346 'condition' => [
3347 'embedpress_pro_embeded_source' => 'calendly',
3348 'cEmbedType' => 'popup_button'
3349 ]
3350 ]
3351 );
3352 $this->add_control(
3353 'cPopupButtonBGColor',
3354 [
3355 'label' => __('Background Color', 'embedpress'),
3356 'type' => \Elementor\Controls_Manager::COLOR,
3357 'default' => '#0000FF',
3358 'condition' => [
3359 'embedpress_pro_embeded_source' => 'calendly',
3360 'cEmbedType' => 'popup_button'
3361 ]
3362 ]
3363 );
3364
3365 $this->add_control(
3366 'calendlyControlsHeadding',
3367 [
3368 'label' => esc_html__('Calender Settings', 'embedpress'),
3369 'type' => \Elementor\Controls_Manager::HEADING,
3370 'separator' => 'before',
3371 ]
3372 );
3373
3374 $this->add_control(
3375 'calendlyData',
3376 [
3377 'label' => sprintf(__('Calendly Data %s', 'embedpress'), $this->pro_text),
3378 'type' => \Elementor\Controls_Manager::SWITCHER,
3379 'default' => '',
3380 'classes' => $this->pro_class,
3381 'condition' => $condition
3382 ]
3383 );
3384
3385 $this->add_control(
3386 'calendlyDataLink',
3387 [
3388 'type' => \Elementor\Controls_Manager::RAW_HTML,
3389 'raw' => '<div style="display: flex; align-items: center;gap:5px;"><span style="font-size:18px" class="eicon-editor-external-link"></span><a href="/wp-admin/admin.php?page=embedpress&page_type=calendly" target="_blank" >View Calendly Data</a></div>',
3390 'condition' => [
3391 'calendlyData' => 'yes'
3392 ]
3393
3394 ]
3395 );
3396
3397 $this->add_control(
3398 'hideCookieBanner',
3399 [
3400 'label' => __('Hide Cookie Banner', 'embedpress'),
3401 'type' => \Elementor\Controls_Manager::SWITCHER,
3402 'default' => '',
3403 'condition' => $condition
3404 ]
3405 );
3406 $this->add_control(
3407 'hideEventTypeDetails',
3408 [
3409 'label' => __('Hide Event Type Details', 'embedpress'),
3410 'type' => \Elementor\Controls_Manager::SWITCHER,
3411 'default' => '',
3412 'condition' => $condition
3413 ]
3414 );
3415
3416 $this->add_control(
3417 'cBackgroundColor',
3418 [
3419 'label' => __('Background Color', 'embedpress'),
3420 'type' => \Elementor\Controls_Manager::COLOR,
3421 'default' => '',
3422 'condition' => $condition
3423 ]
3424 );
3425
3426 $this->add_control(
3427 'cTextColor',
3428 [
3429 'label' => __('Text Color', 'embedpress'),
3430 'type' => \Elementor\Controls_Manager::COLOR,
3431 'default' => '',
3432 'condition' => $condition
3433 ]
3434 );
3435
3436 $this->add_control(
3437 'cButtonLinkColor',
3438 [
3439 'label' => __('Button & Link Color', 'embedpress'),
3440 'type' => \Elementor\Controls_Manager::COLOR,
3441 'default' => '',
3442 'condition' => $condition
3443 ]
3444 );
3445
3446 $this->end_controls_section();
3447 }
3448
3449 //End calendly controlS
3450
3451 /**
3452 * Start Spreaker Controls
3453 */
3454 public function init_spreaker_control_section()
3455 {
3456
3457 $condition = [
3458 'embedpress_pro_embeded_source' => 'spreaker',
3459 ];
3460
3461 $this->start_controls_section(
3462 'embedpress_spreaker_control_section',
3463 [
3464 'label' => __('Spreaker Controls', 'embedpress'),
3465 'condition' => $condition,
3466 ]
3467 );
3468
3469 $this->add_control(
3470 'theme',
3471 [
3472 'label' => __('Theme', 'embedpress'),
3473 'type' => \Elementor\Controls_Manager::SELECT,
3474 'default' => 'light',
3475 'options' => [
3476 'light' => __('Light', 'embedpress'),
3477 'dark' => __('Dark', 'embedpress'),
3478 ],
3479 ]
3480 );
3481
3482 $this->add_control(
3483 'color',
3484 [
3485 'label' => __('Main Color', 'embedpress'),
3486 'type' => \Elementor\Controls_Manager::COLOR,
3487 ]
3488 );
3489
3490 $this->add_control(
3491 "coverImageUrl",
3492 [
3493 'label' => sprintf(__('Cover Image %s', 'embedpress'), $this->pro_text),
3494 'type' => Controls_Manager::MEDIA,
3495 'dynamic' => [
3496 'active' => true,
3497 ],
3498 'classes' => $this->pro_class,
3499
3500 ]
3501 );
3502
3503
3504
3505 $this->add_control(
3506 'hideDownload',
3507 [
3508 'label' => sprintf(__('Disable Download %s', 'embedpress'), $this->pro_text),
3509 'type' => \Elementor\Controls_Manager::SWITCHER,
3510 'label_on' => __('Yes', 'embedpress'),
3511 'label_off' => __('No', 'embedpress'),
3512 'return_value' => 'yes',
3513 'default' => 'no',
3514 'classes' => $this->pro_class,
3515 ]
3516 );
3517
3518 $this->add_control(
3519 'playlist',
3520 [
3521 'label' => __('Enable Playlist', 'embedpress'),
3522 'type' => \Elementor\Controls_Manager::SWITCHER,
3523 'label_on' => __('Yes', 'embedpress'),
3524 'label_off' => __('No', 'embedpress'),
3525 'return_value' => 'yes',
3526 'default' => 'yes',
3527 'description' => __('This option is for podcast playlists and doesn’t affect individual episodes.', 'embedpress'),
3528 ]
3529 );
3530
3531
3532 $this->add_control(
3533 'playlistContinuous',
3534 [
3535 'label' => sprintf(__('Continuous Playlist %s', 'embedpress'), $this->pro_text),
3536 'type' => \Elementor\Controls_Manager::SWITCHER,
3537 'label_on' => __('Yes', 'embedpress'),
3538 'label_off' => __('No', 'embedpress'),
3539 'return_value' => 'yes',
3540 'default' => 'no',
3541 'classes' => $this->pro_class,
3542 'condition' => [
3543 'playlist' => 'yes',
3544 ],
3545 ]
3546 );
3547
3548 $this->add_control(
3549 'playlistLoop',
3550 [
3551 'label' => __('Loop Playlist', 'embedpress'),
3552 'type' => \Elementor\Controls_Manager::SWITCHER,
3553 'label_on' => __('Yes', 'embedpress'),
3554 'label_off' => __('No', 'embedpress'),
3555 'return_value' => 'yes',
3556 'default' => 'yes',
3557 'condition' => [
3558 'playlist' => 'yes',
3559 'playlistContinuous' => 'yes',
3560 ],
3561 ]
3562 );
3563
3564 $this->add_control(
3565 'playlistAutoupdate',
3566 [
3567 'label' => __('Playlist Autoupdate', 'embedpress'),
3568 'type' => \Elementor\Controls_Manager::SWITCHER,
3569 'label_on' => __('Yes', 'embedpress'),
3570 'label_off' => __('No', 'embedpress'),
3571 'return_value' => 'yes',
3572 'default' => 'yes',
3573 'condition' => [
3574 'playlist' => 'yes',
3575 ],
3576 ]
3577 );
3578 $this->add_control(
3579 'hidePlaylistDescriptions',
3580 [
3581 'label' => __('Hide Playlist Descriptions', 'embedpress'),
3582 'type' => \Elementor\Controls_Manager::SWITCHER,
3583 'label_on' => __('Yes', 'embedpress'),
3584 'label_off' => __('No', 'embedpress'),
3585 'return_value' => 'yes',
3586 'default' => 'no',
3587 'condition' => [
3588 'playlist' => 'yes',
3589 ],
3590 ]
3591 );
3592
3593 $this->add_control(
3594 'hidePlaylistImages',
3595 [
3596 'label' => __('Hide Playlist Images', 'embedpress'),
3597 'type' => \Elementor\Controls_Manager::SWITCHER,
3598 'label_on' => __('Yes', 'embedpress'),
3599 'label_off' => __('No', 'embedpress'),
3600 'return_value' => 'yes',
3601 'default' => 'no',
3602 'condition' => [
3603 'playlist' => 'yes',
3604 ],
3605 ]
3606 );
3607
3608 $this->add_control(
3609 'episodeImagePosition',
3610 [
3611 'label' => __('Episode Image Position', 'embedpress'),
3612 'type' => \Elementor\Controls_Manager::SELECT,
3613 'default' => 'right',
3614 'options' => [
3615 'right' => __('Right', 'embedpress'),
3616 'left' => __('Left', 'embedpress'),
3617 ],
3618 'label_block' => true,
3619 ]
3620 );
3621
3622
3623 $this->add_control(
3624 'showChaptersImage',
3625 [
3626 'label' => __('Show Chapters Images', 'embedpress'),
3627 'type' => \Elementor\Controls_Manager::SWITCHER,
3628 'label_on' => __('Yes', 'embedpress'),
3629 'label_off' => __('No', 'embedpress'),
3630 'return_value' => 'yes',
3631 'default' => 'yes',
3632 'description' => __('Only applies if the podcast includes chapter images.', 'embedpress'),
3633 ]
3634 );
3635
3636 $this->add_control(
3637 'hideLikes',
3638 [
3639 'label' => __('Hide Likes', 'embedpress'),
3640 'type' => \Elementor\Controls_Manager::SWITCHER,
3641 'label_on' => __('Yes', 'embedpress'),
3642 'label_off' => __('No', 'embedpress'),
3643 'return_value' => 'yes',
3644 'default' => 'no',
3645 ]
3646 );
3647
3648 $this->add_control(
3649 'hideComments',
3650 [
3651 'label' => __('Hide Comments', 'embedpress'),
3652 'type' => \Elementor\Controls_Manager::SWITCHER,
3653 'label_on' => __('Yes', 'embedpress'),
3654 'label_off' => __('No', 'embedpress'),
3655 'return_value' => 'yes',
3656 'default' => 'no',
3657 ]
3658 );
3659
3660 $this->add_control(
3661 'hideSharing',
3662 [
3663 'label' => __('Hide Sharing', 'embedpress'),
3664 'type' => \Elementor\Controls_Manager::SWITCHER,
3665 'label_on' => __('Yes', 'embedpress'),
3666 'label_off' => __('No', 'embedpress'),
3667 'return_value' => 'yes',
3668 'default' => 'no',
3669 ]
3670 );
3671
3672 $this->add_control(
3673 'hideLogo',
3674 [
3675 'label' => __('Hide Logo', 'embedpress'),
3676 'type' => \Elementor\Controls_Manager::SWITCHER,
3677 'label_on' => __('Yes', 'embedpress'),
3678 'label_off' => __('No', 'embedpress'),
3679 'return_value' => 'yes',
3680 'default' => 'no',
3681 'description' => __('Hide the Spreaker logo and branding in the player. Requires Broadcaster plan or higher.', 'embedpress'),
3682 ]
3683 );
3684
3685 $this->add_control(
3686 'hideEpisodeDescription',
3687 [
3688 'label' => __('Hide Episode Description', 'embedpress'),
3689 'type' => \Elementor\Controls_Manager::SWITCHER,
3690 'label_on' => __('Yes', 'embedpress'),
3691 'label_off' => __('No', 'embedpress'),
3692 'return_value' => 'yes',
3693 'default' => 'no',
3694 ]
3695 );
3696
3697
3698 $this->end_controls_section();
3699 }
3700
3701 public function init_google_photos_control_setion()
3702 {
3703 $condition = [
3704 'embedpress_pro_embeded_source' => 'google_photos',
3705 ];
3706
3707 $this->start_controls_section(
3708 'google_photos_controls_section',
3709 [
3710 'label' => __('Google Photos Controls', 'embedpress'),
3711 'condition' => $condition,
3712 ]
3713 );
3714
3715
3716
3717 // $this->pro_text
3718 // Mode Selection
3719 $this->add_control(
3720 'mode',
3721 [
3722 'label' => __('Album Mode', 'embedpress'),
3723 'type' => \Elementor\Controls_Manager::SELECT,
3724 'options' => [
3725 'carousel' => __('Carousel', 'embedpress'),
3726 'gallery-player' => __('Gallery Player', 'embedpress'),
3727 'gallery-grid' => __('Grid', 'embedpress') . ' ' . __($this->pro_text , 'embedpress'),
3728 'gallery-masonary' => __('Masonry', 'embedpress') . ' ' . __($this->pro_text, 'embedpress'),
3729 'gallery-justify' => __('Justify', 'embedpress') . ' ' . __($this->pro_text, 'embedpress'),
3730 ],
3731 'default' => 'carousel',
3732 ]
3733 );
3734
3735 if ( !apply_filters('embedpress/is_allow_rander', false) ) {
3736 $this->add_control(
3737 'embedpress_google_photos__pro_enable_warning_1',
3738 [
3739 'label' => sprintf( '<a style="color: red" target="_blank" href="https://wpdeveloper.com/in/upgrade-embedpress">%s</a>',
3740 esc_html__( 'Only Available in Pro Version!', 'essential-addons-for-elementor-lite' ) ),
3741 'type' => Controls_Manager::RAW_HTML,
3742 'condition' => [
3743 'mode' => ['gallery-grid', 'gallery-masonary', 'gallery-justify'],
3744 ],
3745 ]
3746 );
3747 }
3748
3749
3750 // Player Autoplay, Delay, and Repeat
3751 $this->add_control(
3752 'playerAutoplay',
3753 [
3754 'label' => __('Autoplay', 'embedpress'),
3755 'type' => \Elementor\Controls_Manager::SWITCHER,
3756 'label_on' => __('Yes', 'embedpress'),
3757 'label_off' => __('No', 'embedpress'),
3758 'default' => 'no',
3759 'condition' => [
3760 'mode' => 'gallery-player',
3761 ],
3762 ]
3763 );
3764
3765 $this->add_control(
3766 'delay',
3767 [
3768 'label' => __('Delay (seconds)', 'embedpress'),
3769 'type' => \Elementor\Controls_Manager::NUMBER,
3770 'min' => 1,
3771 'max' => 60,
3772 'default' => 5,
3773 'condition' => [
3774 'mode' => 'gallery-player',
3775 ],
3776 ]
3777 );
3778
3779 $this->add_control(
3780 'repeat',
3781 [
3782 'label' => __('Repeat', 'embedpress'),
3783 'type' => \Elementor\Controls_Manager::SWITCHER,
3784 'label_on' => __('Yes', 'embedpress'),
3785 'label_off' => __('No', 'embedpress'),
3786 'default' => 'no',
3787 'condition' => [
3788 'mode' => 'gallery-player',
3789 ],
3790 ]
3791 );
3792
3793 // Toggles for Media Items
3794 // $this->add_control(
3795 // 'mediaitemsAspectRatio',
3796 // [
3797 // 'label' => __('Keep Aspect Ratio', 'embedpress'),
3798 // 'type' => \Elementor\Controls_Manager::SWITCHER,
3799 // 'default' => 'yes',
3800 // ]
3801 // );
3802
3803 // $this->add_control(
3804 // 'mediaitemsEnlarge',
3805 // [
3806 // 'label' => __('Enlarge', 'embedpress'),
3807 // 'type' => \Elementor\Controls_Manager::SWITCHER,
3808 // 'default' => 'no',
3809 // ]
3810 // );
3811
3812 // $this->add_control(
3813 // 'mediaitemsStretch',
3814 // [
3815 // 'label' => __('Stretch', 'embedpress'),
3816 // 'type' => \Elementor\Controls_Manager::SWITCHER,
3817 // 'default' => 'no',
3818 // ]
3819 // );
3820
3821 // $this->add_control(
3822 // 'mediaitemsCover',
3823 // [
3824 // 'label' => __('Cover', 'embedpress'),
3825 // 'type' => \Elementor\Controls_Manager::SWITCHER,
3826 // 'default' => 'no',
3827 // ]
3828 // );
3829
3830 // Background Color
3831 $this->add_control(
3832 'backgroundColor',
3833 [
3834 'label' => __('Background Color', 'embedpress'),
3835 'type' => \Elementor\Controls_Manager::COLOR,
3836 'default' => '#000000',
3837 ]
3838 );
3839
3840 // Expiration
3841 $this->add_control(
3842 'expiration',
3843 [
3844 'label' => __('Sync after (minutes)', 'embedpress'),
3845 'type' => \Elementor\Controls_Manager::NUMBER,
3846 'min' => 0,
3847 'max' => 1440,
3848 'default' => 60,
3849 ]
3850 );
3851
3852 $this->end_controls_section();
3853 }
3854
3855
3856 /**
3857 * End Spreaker Controls
3858 */
3859
3860
3861 public function init_style_controls()
3862 {
3863 $this->start_controls_section(
3864 'embedpress_style_section',
3865 [
3866 'label' => __('General', 'embedpress'),
3867 'tab' => Controls_Manager::TAB_STYLE,
3868 'condition' => [
3869 'embedpress_pro_embeded_source!' => 'opensea',
3870 ]
3871
3872 ]
3873 );
3874 $this->add_responsive_control(
3875 'width',
3876 [
3877 'label' => __('Width', 'embedpress'),
3878 'type' => Controls_Manager::SLIDER,
3879 'size_units' => ['px'],
3880 'range' => [
3881 'px' => [
3882 'min' => 0,
3883 'max' => 1500,
3884 'step' => 1,
3885 ],
3886 ],
3887 'devices' => ['desktop', 'tablet', 'mobile'],
3888 'default' => [
3889 'size' => !empty($value = intval(Helper::get_options_value('enableEmbedResizeWidth'))) ? $value : 600,
3890 'unit' => 'px',
3891 ],
3892 'desktop_default' => [
3893 'size' => 600,
3894 'unit' => 'px',
3895 ],
3896 'tablet_default' => [
3897 'size' => 600,
3898 'unit' => 'px',
3899 ],
3900 'mobile_default' => [
3901 'size' => 600,
3902 'unit' => 'px',
3903 ],
3904 'selectors' => [
3905 '{{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive>iframe,{{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive, {{WRAPPER}} .sponsored-youtube-video > iframe,
3906 {{WRAPPER}} .plyr--video,
3907 {{WRAPPER}} .ose-giphy img,
3908 {{WRAPPER}} .jx-gallery-player-widget' => 'width: {{size}}{{UNIT}}!important; max-width: 100%!important;',
3909 ],
3910 ]
3911 );
3912
3913 $this->add_responsive_control(
3914 'height',
3915 [
3916 'label' => __('Height', 'embedpress'),
3917 'type' => Controls_Manager::SLIDER,
3918 'size_units' => ['px', '%'],
3919 'range' => [
3920 'px' => [
3921 'min' => 0,
3922 'max' => 1500,
3923 'step' => 1,
3924 ],
3925 ],
3926 'devices' => ['desktop', 'tablet', 'mobile'],
3927 'desktop_default' => [
3928 'size' => 400,
3929 'unit' => 'px',
3930 ],
3931 'default' => [
3932 'size' => !empty($value = intval(Helper::get_options_value('enableEmbedResizeHeight'))) ? $value : 600,
3933 'unit' => 'px',
3934 ],
3935 'tablet_default' => [
3936 'size' => 400,
3937 'unit' => 'px',
3938 ],
3939 'mobile_default' => [
3940 'size' => 400,
3941 'unit' => 'px',
3942 ],
3943 'selectors' => [
3944 '{{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive iframe, {{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive,{{WRAPPER}} .sponsored-youtube-video > iframe,
3945 {{WRAPPER}} .plyr--video,
3946 {{WRAPPER}} .ose-giphy img,
3947 {{WRAPPER}} .jx-gallery-player-widget' => 'height: {{size}}{{UNIT}}!important;max-height: 100%!important',
3948 ],
3949 'conditions' => [
3950 'relation' => 'or',
3951 'terms' => [
3952 [
3953 'relation' => 'and',
3954 'terms' => [
3955 [
3956 'name' => 'embedpress_pro_embeded_source',
3957 'operator' => '===',
3958 'value' => 'google_photos',
3959 ],
3960 [
3961 'relation' => 'or',
3962 'terms' => [
3963 [
3964 'name' => 'mode',
3965 'operator' => '==',
3966 'value' => 'carousel',
3967 ],
3968 [
3969 'name' => 'mode',
3970 'operator' => '==',
3971 'value' => 'gallery-player',
3972 ],
3973 ],
3974 ]
3975
3976 ],
3977 ],
3978 [
3979 'name' => 'embedpress_pro_embeded_source',
3980 'operator' => 'in',
3981 'value' => ['default', 'youtube', 'vimeo', 'twitch', 'soundcloud', 'dailymotion', 'wistia', 'calendly', 'opensea', 'spreaker', 'selfhosted_video', 'selfhosted_audio'],
3982 ],
3983
3984 ],
3985
3986 ],
3987 ]
3988 );
3989
3990 $this->add_control(
3991 'width_height_important_note',
3992 [
3993 'type' => \Elementor\Controls_Manager::RAW_HTML,
3994 'raw' => esc_html__('Note: The maximum width and height are set to 100%.', 'embedpress'),
3995 'content_classes' => 'elementor-panel-alert elementor-panel-warning-info',
3996 ]
3997 );
3998 $this->add_responsive_control(
3999 'margin',
4000 [
4001 'label' => __('Margin', 'embedpress'),
4002 'type' => Controls_Manager::DIMENSIONS,
4003 'size_units' => ['px', '%', 'em'],
4004 'selectors' => [
4005 '{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4006 ],
4007 ]
4008 );
4009 $this->add_responsive_control(
4010 'padding',
4011 [
4012 'label' => __('Padding', 'embedpress'),
4013 'type' => Controls_Manager::DIMENSIONS,
4014 'size_units' => ['px', '%', 'em'],
4015 'selectors' => [
4016 '{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4017 ],
4018 ]
4019 );
4020 $this->add_responsive_control(
4021 'align',
4022 [
4023 'label' => esc_html__('Alignment', 'embedpress'),
4024 'type' => Controls_Manager::CHOOSE,
4025 'options' => [
4026 'left' => [
4027 'title' => esc_html__('Left', 'embedpress'),
4028 'icon' => 'eicon-text-align-left',
4029 ],
4030 'center' => [
4031 'title' => esc_html__('Center', 'embedpress'),
4032 'icon' => 'eicon-text-align-center',
4033 ],
4034 'right' => [
4035 'title' => esc_html__('Right', 'embedpress'),
4036 'icon' => 'eicon-text-align-right',
4037 ],
4038 ],
4039 'prefix_class' => 'elementor%s-align-',
4040 'default' => '',
4041 ]
4042 );
4043 $this->end_controls_section();
4044 }
4045
4046 public function render_plain_content()
4047 {
4048 $args = "";
4049 $settings = $this->get_settings_for_display();
4050
4051 $_settings = $this->convert_settings($settings);
4052 foreach ($_settings as $key => $value) {
4053 $args .= "$key='" . esc_attr($value) . "' ";
4054 }
4055
4056 $args = trim($args);
4057 $embed_code = sprintf("[embedpress %s]%s[/embedpress]", $args, esc_url($settings['embedpress_embeded_link']));
4058 echo $embed_code;
4059 }
4060
4061
4062 public function get_custom_player_options($settings)
4063 {
4064
4065 $_player_options = '';
4066
4067 if (!empty($settings['emberpress_custom_player'])) {
4068
4069 $player_preset = !empty($settings['custom_payer_preset']) ? sanitize_text_field($settings['custom_payer_preset']) : 'preset-default';
4070
4071 $player_color = !empty($settings['embedpress_player_color']) ? sanitize_hex_color($settings['embedpress_player_color']) : '';
4072
4073 $poster_thumbnail = !empty($settings['embedpress_player_poster_thumbnail']['url']) ? esc_url($settings['embedpress_player_poster_thumbnail']['url']) : '';
4074
4075
4076 $is_self_hosted = Helper::check_media_format($settings['embedpress_embeded_link']);
4077
4078
4079 $player_pip = !empty($settings['embepress_player_always_on_top']) ? true : false;
4080 $player_restart = !empty($settings['embepress_player_restart']) ? true : false;
4081 $player_rewind = !empty($settings['embepress_player_rewind']) ? true : false;
4082 $player_fastForward = !empty($settings['embepress_player_fast_forward']) ? true : false;
4083 $player_tooltip = !empty($settings['embepress_player_tooltip']) ? true : false;
4084 $player_hide_controls = !empty($settings['embepress_player_hide_controls']) ? true : false;
4085 $player_download = !empty($settings['embepress_player_download']) ? true : false;
4086 $player_fullscreen = !empty($settings['embedpress_pro_youtube_enable_fullscreen_button']) ? true : false;
4087
4088 $playerOptions = [
4089 'rewind' => $player_rewind,
4090 'restart' => $player_restart,
4091 'pip' => $player_pip,
4092 'poster_thumbnail' => $poster_thumbnail,
4093 'player_color' => $player_color,
4094 'player_preset' => $player_preset,
4095 'fast_forward' => $player_fastForward,
4096 'player_tooltip' => $player_tooltip,
4097 'hide_controls' => $player_hide_controls,
4098 'download' => $player_download,
4099 'fullscreen' => $player_fullscreen,
4100 ];
4101
4102
4103 //Youtube options
4104 if (!empty($settings['embedpress_pro_video_start_time'])) {
4105 $playerOptions['start'] = $settings['embedpress_pro_video_start_time'];
4106 }
4107 if (!empty($settings['embedpress_pro_youtube_end_time'])) {
4108 $playerOptions['end'] = $settings['embedpress_pro_youtube_end_time'];
4109 }
4110 if (!empty($settings['embedpress_pro_youtube_display_related_videos'])) {
4111 $playerOptions['rel'] = true;
4112 } else {
4113 $playerOptions['rel'] = false;
4114 }
4115
4116 //vimeo options
4117 if (!empty($settings['embedpress_pro_video_start_time'])) {
4118 $playerOptions['t'] = $settings['embedpress_pro_video_start_time'];
4119 }
4120 if (!empty($settings['embedpress_pro_vimeo_auto_play'])) {
4121 $playerOptions['vautoplay'] = true;
4122 } else {
4123 $playerOptions['vautoplay'] = false;
4124 }
4125 if (!empty($settings['embedpress_pro_vimeo_autopause'])) {
4126 $playerOptions['autopause'] = true;
4127 } else {
4128 $playerOptions['autopause'] = false;
4129 }
4130
4131 if (!empty($settings['embedpress_pro_vimeo_dnt'])) {
4132 $playerOptions['dnt'] = true;
4133 } else {
4134 $playerOptions['dnt'] = false;
4135 }
4136
4137 if (!empty($is_self_hosted['selhosted'])) {
4138 $playerOptions['self_hosted'] = $is_self_hosted['selhosted'];
4139 $playerOptions['hosted_format'] = $is_self_hosted['format'];
4140 }
4141
4142 $playerOptionsString = json_encode($playerOptions);
4143 $_player_options = 'data-options=' . htmlentities($playerOptionsString, ENT_QUOTES);
4144
4145 }
4146
4147 return $_player_options;
4148 }
4149
4150 public function get_instafeed_carousel_options($settings)
4151 {
4152 $_carousel_options = '';
4153
4154 if(!empty($settings['instaLayout']) && $settings['instaLayout'] === 'insta-carousel'){
4155 $_carousel_id = 'data-carouselid=' . esc_attr($this->get_id()) . '';
4156
4157 $layout = $settings['instaLayout'];
4158 $embedpress_instafeed_slide_show = !empty($settings['embedpress_instafeed_slide_show']) ? $settings['embedpress_instafeed_slide_show'] : 5;
4159 $embedpress_carousel_autoplay = !empty($settings['embedpress_carousel_autoplay']) ? $settings['embedpress_carousel_autoplay'] : 0;
4160 $embedpress_carousel_autoplay_speed = !empty($settings['embedpress_carousel_autoplay_speed']) ? $settings['embedpress_carousel_autoplay_speed'] : 3000;
4161 $embedpress_carousel_transition_speed = !empty($settings['embedpress_carousel_transition_speed']) ? $settings['embedpress_carousel_transition_speed'] : 1000;
4162 $embedpress_carousel_loop = !empty($settings['embedpress_carousel_loop']) ? $settings['embedpress_carousel_loop'] : 0;
4163 $embedpress_carousel_arrows = !empty($settings['embedpress_carousel_arrows']) ? $settings['embedpress_carousel_arrows'] : 0;
4164 $spacing = !empty($settings['embedpress_carousel_spacing']) ? $settings['embedpress_carousel_spacing'] : 0;
4165
4166 // print_r($settings);
4167
4168 $carousel_options = [
4169 'layout' => $layout,
4170 'slideshow' => $embedpress_instafeed_slide_show,
4171 'autoplay' => $embedpress_carousel_autoplay,
4172 'autoplayspeed' => $embedpress_carousel_autoplay_speed,
4173 'transitionspeed' => $embedpress_carousel_transition_speed,
4174 'loop' => $embedpress_carousel_loop,
4175 'arrows' => $embedpress_carousel_arrows,
4176 'spacing' => $spacing
4177 ];
4178
4179 $carousel_options_string = json_encode($carousel_options);
4180 $_carousel_options = 'data-carousel-options='. htmlentities($carousel_options_string, ENT_QUOTES) .'';
4181 }
4182 return $_carousel_options;
4183 }
4184
4185 public function get_instafeed_layout($settings){
4186 $insta_layout = '';
4187 if($settings['embedpress_pro_embeded_source'] == 'instafeed'){
4188 $insta_layout = ' '. $settings['instaLayout'];
4189 }
4190
4191 return $insta_layout;
4192 }
4193
4194 protected function convert_settings($settings)
4195 {
4196 $_settings = [];
4197 foreach ($settings as $key => $value) {
4198 if (empty($value)) {
4199 $_settings[$key] = 'false';
4200 } else if (!empty($value['size'])) {
4201 $_settings[$key] = $value['size'];
4202 } else if (!empty($value['url'])) {
4203 $_settings[$key] = $value['url'];
4204 } else if (\is_scalar($value)) {
4205 $_settings[$key] = $value;
4206 }
4207 }
4208
4209 return $_settings;
4210 }
4211
4212 public function validUserAccountUrl($url){
4213 $pattern = '/^(?:https?:\/\/)?(?:www\.)?instagram\.com\/(?:[a-zA-Z0-9_\.]+\/?)$/';
4214 return (bool) preg_match($pattern, $url);
4215 }
4216
4217 function validInstagramTagUrl($url) {
4218 $pattern = '/^(?:https?:\/\/)?(?:www\.)?instagram\.com\/explore\/tags\/[a-zA-Z0-9_\-]+\/?$/';
4219 return (bool) preg_match($pattern, $url);
4220 }
4221
4222 protected function render()
4223 {
4224 $settings = $this->get_settings_for_display();
4225 Helper::get_enable_settings_data_for_scripts($settings);
4226
4227 add_filter('embedpress_should_modify_spotify', '__return_false');
4228 $embed_link = isset($settings['embedpress_embeded_link']) ? $settings['embedpress_embeded_link'] : '';
4229
4230 if(!apply_filters('embedpress/is_allow_rander', false) && ($settings['mode'] === 'gallery-grid' || $settings['mode'] === 'gallery-masonary' || $settings['mode'] === 'gallery-justify')){
4231 echo '<div class="pro__alert__wrap" style="display: block;">
4232 <div class="pro__alert__card">
4233 <h2>Opps...</h2>
4234 <p>You need to upgrade to the <a style="font-weight: bold; color: #5B4E96; text-decoration: underline" href="https://wpdeveloper.com/in/upgrade-embedpress" target="_blank">Premium</a> Version to use this feature</p>
4235 </div>
4236 </div>';
4237 return '';
4238 }
4239
4240 if($settings['instafeedFeedType'] === 'mixed_type' || $settings['instafeedFeedType'] === 'tagged_type'){
4241 echo 'Comming Soon.';
4242 return '';
4243 }
4244
4245 if($settings['instafeedFeedType'] === 'hashtag_type' && !$this->validInstagramTagUrl($embed_link)){
4246 echo 'Please add valid hashtag link url';
4247 return '';
4248 }
4249
4250 if($settings['instafeedFeedType'] === 'user_account_type' && !$this->validUserAccountUrl($embed_link)){
4251 echo 'Please add valid user account link url';
4252 return '';
4253 }
4254
4255 if(!apply_filters('embedpress/is_allow_rander', false) && ($settings['instaLayout'] === 'insta-masonry' || $settings['instaLayout'] === 'insta-carousel' || $settings['instafeedFeedType'] === 'hashtag_type')){
4256 echo '<div class="pro__alert__wrap" style="display: block;">
4257 <div class="pro__alert__card">
4258 <h2>Opps...</h2>
4259 <p>You need to upgrade to the <a style="font-weight: bold; color: #5B4E96; text-decoration: underline" href="https://wpdeveloper.com/in/upgrade-embedpress" target="_blank">Premium</a> Version to use this feature</p>
4260 </div>
4261 </div>';
4262 return '';
4263 }
4264
4265 if(!apply_filters('embedpress/is_allow_rander', false) && ($settings['ytChannelLayout'] === 'carousel' || $settings['ytChannelLayout'] === 'grid')){
4266 echo '<div class="pro__alert__wrap" style="display: block;">
4267 <div class="pro__alert__card">
4268 <h2>Opps...</h2>
4269 <p>You need to upgrade to the <a style="font-weight: bold; color: #5B4E96; text-decoration: underline" href="https://wpdeveloper.com/in/upgrade-embedpress" target="_blank">Premium</a> Version to use this feature</p>
4270 </div>
4271 </div>';
4272 return '';
4273 }
4274
4275 if($settings['instafeedFeedType'] === 'mixed_type' || $settings['instafeedFeedType'] === 'tagged_type'){
4276 echo 'Comming Soon.';
4277 return '';
4278 }
4279
4280 if($settings['instafeedFeedType'] === 'hashtag_type' && !$this->validInstagramTagUrl($embed_link)){
4281 echo 'Please add valid hashtag link url';
4282 return '';
4283 }
4284
4285 if($settings['instafeedFeedType'] === 'user_account_type' && !$this->validUserAccountUrl($embed_link)){
4286 echo 'Please add valid user account link url';
4287 return '';
4288 }
4289
4290 $is_editor_view = Plugin::$instance->editor->is_edit_mode();
4291 $link = $settings['embedpress_embeded_link'];
4292 $is_apple_podcast = (strpos($link, 'podcasts.apple.com') !== false);
4293
4294 // conditionaly convert settings data
4295 $_settings = [];
4296 $source = isset($settings['embedpress_pro_embeded_source']) ? esc_attr($settings['embedpress_pro_embeded_source']) : 'default';
4297 $embed_link = isset($settings['embedpress_embeded_link']) ? esc_url($settings['embedpress_embeded_link']) : '';
4298 $pass_hash_key = isset($settings['embedpress_lock_content_password']) ? md5($settings['embedpress_lock_content_password']) : '';
4299
4300
4301
4302 Helper::get_source_data(md5($this->get_id()) . '_eb_elementor', esc_url($embed_link), 'elementor_source_data', 'elementor_temp_source_data');
4303
4304 if (!(($source === 'default' || !empty($source[0]) && $source[0] === 'default') && strpos($embed_link, 'opensea.io') !== false)) {
4305 $_settings = $this->convert_settings($settings);
4306 }
4307
4308 if (strpos($embed_link, 'opensea.io') !== false) {
4309 $source = 'opensea';
4310 }
4311
4312 $_settings = Helper::removeQuote($_settings);
4313
4314
4315 $embed_content = Shortcode::parseContent($settings['embedpress_embeded_link'], true, $_settings);
4316 $embed_content = $this->onAfterEmbedSpotify($embed_content, $settings);
4317 $embed = apply_filters('embedpress_elementor_embed', $embed_content, $settings);
4318 $content = is_object($embed) ? $embed->embed : $embed;
4319
4320
4321
4322 $embed_settings = [];
4323 $embed_settings['customThumbnail'] = !empty($settings['embedpress_content_share_custom_thumbnail']['url']) ? esc_url($settings['embedpress_content_share_custom_thumbnail']['url']) : '';
4324
4325 $embed_settings['customTitle'] = !empty($settings['embedpress_content_title']) ? sanitize_text_field($settings['embedpress_content_title']) : Helper::get_file_title($embed_link);
4326
4327 $embed_settings['customDescription'] = !empty($settings['embedpress_content_descripiton']) ? sanitize_text_field($settings['embedpress_content_descripiton']) : Helper::get_file_title($embed_link);
4328
4329 $embed_settings['sharePosition'] = !empty($settings['embedpress_content_share_position']) ? sanitize_text_field($settings['embedpress_content_share_position']) : 'right';
4330
4331 $embed_settings['lockHeading'] = !empty($settings['embedpress_lock_content_heading']) ? sanitize_text_field($settings['embedpress_lock_content_heading']) : '';
4332
4333 $embed_settings['lockSubHeading'] = !empty($settings['embedpress_lock_content_sub_heading']) ? sanitize_text_field($settings['embedpress_lock_content_sub_heading']) : '';
4334
4335 $embed_settings['passwordPlaceholder'] = !empty($settings['embedpress_password_placeholder']) ? sanitize_text_field($settings['embedpress_password_placeholder']) : '';
4336
4337 $embed_settings['submitButtonText'] = !empty($settings['embedpress_submit_button_text']) ? sanitize_text_field($settings['embedpress_submit_button_text']) : '';
4338
4339 $embed_settings['submitUnlockingText'] = !empty($settings['embedpress_submit_Unlocking_text']) ? sanitize_text_field($settings['embedpress_submit_Unlocking_text']) : '';
4340
4341 $embed_settings['lockErrorMessage'] = !empty($settings['embedpress_lock_content_error_message']) ? sanitize_text_field($settings['embedpress_lock_content_error_message']) : '';
4342
4343 $embed_settings['enableFooterMessage'] = !empty($settings['embedpress_enable_footer_message']) ? sanitize_text_field($settings['embedpress_enable_footer_message']) : '';
4344
4345 $embed_settings['footerMessage'] = !empty($settings['embedpress_lock_content_footer_message']) ? sanitize_text_field($settings['embedpress_lock_content_footer_message']) : '';
4346
4347 $embed_settings['userRole'] = !empty($settings['embedpress_select_roles']) ? $settings['embedpress_select_roles'] : [];
4348
4349 $embed_settings['protectionMessage'] = !empty($settings['embedpress_protection_message']) ? $settings['embedpress_protection_message'] : '';
4350
4351
4352 $client_id = $this->get_id();
4353 $hash_pass = hash('sha256', wp_salt(32) . md5($settings['embedpress_lock_content_password'] ? sanitize_text_field($settings['embedpress_lock_content_password']) : ''));
4354
4355 $password_correct = isset($_COOKIE['password_correct_' . $client_id]) ? sanitize_text_field($_COOKIE['password_correct_' . $client_id]) : '';
4356
4357 $ispagination = 'flex';
4358
4359 if ($settings['pagination'] != 'show') {
4360 $ispagination = 'none';
4361 }
4362
4363 $calVal = '';
4364
4365 if (!empty($settings['columns']) && is_numeric($settings['columns']) && (int) $settings['columns'] > 0) {
4366 $columns = (int) $settings['columns'];
4367 $gap_size = isset($settings['gapbetweenvideos']['size']) ? absint($settings['gapbetweenvideos']['size']) : 0;
4368 $calVal = 'calc(' . (100 / $columns) . '% - ' . $gap_size . 'px)';
4369 } else {
4370 $calVal = 'auto';
4371 }
4372
4373
4374 $content_share_class = '';
4375 $share_position_class = '';
4376 $share_position = isset($settings['embedpress_content_share_position']) ? esc_attr($settings['embedpress_content_share_position']) : 'right';
4377
4378 if (!empty($settings['embedpress_content_share'])) {
4379 $content_share_class = 'ep-content-share-enabled';
4380 $share_position_class = 'ep-share-position-' . $share_position;
4381 }
4382
4383 $content_protection_class = 'ep-content-protection-enabled';
4384 if (empty($settings['embedpress_lock_content']) || empty($settings['embedpress_lock_content_password']) || $hash_pass === $password_correct) {
4385 $content_protection_class = 'ep-content-protection-disabled';
4386 }
4387
4388 $data_playerid = '';
4389 if (!empty($settings['embedpress_custom_player'])) {
4390 $data_playerid = 'data-playerid="' . esc_attr($this->get_id()) . '"';
4391 // $data_playerid = 'data-playerid='.esc_attr($this->get_id());
4392 }
4393
4394 $data_carouselid = '';
4395 if (!empty($settings['instaLayout']) && $settings['instaLayout'] === 'insta-carousel') {
4396 $data_carouselid = 'data-carouselid="' . esc_attr($this->get_id()) . '"';
4397 }
4398
4399 $cEmbedType = !empty($settings['cEmbedType']) ? sanitize_text_field($settings['cEmbedType']) : '';
4400
4401 $adsAtts = '';
4402
4403 if (!empty($settings['adManager'])) {
4404 $ad = base64_encode(json_encode($settings)); // Using WordPress JSON encoding function
4405 $adsAtts = 'data-sponsored-id="' . esc_attr($client_id) . '" data-sponsored-attrs="' . esc_attr($ad) . '" class="sponsored-mask"';
4406 }
4407
4408 $data_player_id = '';
4409
4410 if (!empty($settings['emberpress_custom_player']) && $settings['emberpress_custom_player'] === 'yes') {
4411 $data_player_id = "data-playerid='" . esc_attr($this->get_id()) . "'";
4412 }
4413
4414 $hosted_format = '';
4415 if (!empty($settings['emberpress_custom_player'])) {
4416 $self_hosted = Helper::check_media_format($settings['embedpress_embeded_link']);
4417 $hosted_format = isset($self_hosted['format']) ? $self_hosted['format'] : '';
4418 }
4419
4420 $autoPause = '';
4421 if(!empty($settings['embedpress_audio_video_auto_pause'])){
4422 $autoPause = ' enabled-auto-pause';
4423 }
4424
4425 ?>
4426
4427 <div class="embedpress-elements-wrapper <?php echo !empty($settings['embedpress_elementor_aspect_ratio']) ? 'embedpress-fit-aspect-ratio' : '';
4428 echo esc_attr($cEmbedType); ?>" id="ep-elements-id-<?php echo esc_attr($this->get_id()); ?>">
4429
4430 <?php if(!apply_filters('embedpress/is_allow_rander', false) && $is_editor_view && $is_apple_podcast) : ?>
4431
4432 <p><?php esc_html_e('You need EmbedPress Pro to Embed Apple Podcast. Note. This message is only visible to you.', 'embedpress'); ?></p>
4433 <?php else: ?>
4434 <div id="ep-elementor-content-<?php echo esc_attr($client_id) ?>"
4435 class="ep-elementor-content
4436 <?php
4437 if (!empty($settings['embedpress_content_share'])) :
4438 echo esc_attr('position-' . $settings['embedpress_content_share_position'] . '-wraper');
4439 endif;
4440 ?>
4441 <?php echo esc_attr($content_share_class . ' ' . $share_position_class . ' ' . $content_protection_class); ?>
4442 <?php echo esc_attr('source-' . $source); ?>
4443 <?php echo esc_attr($autoPause); ?>">
4444
4445 <div id="<?php echo esc_attr($this->get_id()); ?>"
4446 class="ep-embed-content-wrapper
4447 <?php echo isset($settings['custom_player_preset']) ? esc_attr($settings['custom_player_preset']) : ''; ?>
4448 <?php echo esc_attr($this->get_instafeed_layout($settings)); ?>
4449 <?php echo esc_attr('ep-google-photos-'.$settings['mode']); ?>
4450 <?php echo esc_attr($hosted_format); ?>"
4451 <?php echo $data_playerid; ?>
4452 <?php echo $data_carouselid; ?>
4453 <?php echo $this->get_custom_player_options($settings); ?>
4454 <?php echo $this->get_instafeed_carousel_options($settings); ?>>
4455
4456 <div id="ep-elementor-content-<?php echo esc_attr($client_id) ?>"
4457 class="ep-elementor-content
4458 <?php
4459 if (!empty($settings['embedpress_content_share'])) :
4460 echo esc_attr('position-' . $settings['embedpress_content_share_position'] . '-wraper');
4461 endif;
4462 ?>
4463 <?php echo esc_attr($content_share_class . ' ' . $share_position_class . ' ' . $content_protection_class); ?>
4464 <?php echo esc_attr('source-' . $source); ?>">
4465
4466 <div <?php echo $adsAtts; ?>>
4467 <div id="<?php echo esc_attr($this->get_id()); ?>"
4468 class="ep-embed-content-wraper
4469 <?php echo esc_attr($settings['custom_payer_preset']); ?>"
4470 <?php echo $data_player_id; ?>
4471 <?php echo $this->get_custom_player_options($settings); ?>>
4472
4473 <?php
4474 $content_id = $client_id;
4475 if (
4476 (empty($settings['embedpress_lock_content']) || ($settings['embedpress_protection_type'] == 'password' && empty($settings['embedpress_lock_content_password'])) || $settings['embedpress_lock_content'] == 'no') ||
4477 ($settings['embedpress_protection_type'] == 'password' && !empty(Helper::is_password_correct($client_id)) && ($hash_pass === $password_correct) ) ||
4478 !apply_filters('embedpress/is_allow_rander', false) ||
4479 ($settings['embedpress_protection_type'] == 'user-role' && Helper::has_allowed_roles($embed_settings['userRole']))
4480 ) {
4481 if (!empty($settings['embedpress_content_share'])) {
4482 $content .= Helper::embed_content_share($content_id, $embed_settings);
4483 }
4484
4485 echo $content;
4486 } else {
4487 if (!empty($settings['embedpress_content_share'])) {
4488 $content .= Helper::embed_content_share($content_id, $embed_settings);
4489 }
4490
4491 if ($settings['embedpress_protection_type'] == 'password') {
4492 do_action('embedpress/display_password_form', $client_id, $content, $pass_hash_key, $embed_settings);
4493
4494 } else {
4495 do_action('embedpress/content_protection_content', $client_id, $embed_settings['protectionMessage'], $embed_settings['userRole']);
4496 }
4497 }
4498 ?>
4499 </div>
4500
4501 <?php
4502 if (!empty($settings['adManager']) && (!empty(Helper::is_password_correct($client_id)) && ($hash_pass === $password_correct) )) {
4503 $content = apply_filters('embedpress/generate_ad_template', $content, $client_id, $settings, 'elementor');
4504 }
4505 ?>
4506 </div>
4507 </div>
4508 </div>
4509 </div>
4510
4511 <?php endif;?>
4512
4513 </div>
4514
4515
4516 <?php if ($settings['embedpress_pro_embeded_source'] === 'youtube') : ?>
4517 <style>
4518 #ep-elements-id-<?php echo esc_html($this->get_id()); ?>.ep-youtube__content__block .youtube__content__body .content__wrap {
4519 grid-template-columns: repeat(auto-fit, minmax(<?php echo esc_html($calVal); ?>, 1fr)) !important;
4520 }
4521
4522 #ep-elements-id-<?php echo esc_html($this->get_id()); ?>.ep-youtube__content__pagination {
4523 display: <?php echo esc_html($ispagination); ?> !important;
4524 }
4525 </style>
4526 <?php endif; ?>
4527
4528 <?php
4529 }
4530 public function onAfterEmbedSpotify($embed, $setting)
4531 {
4532 if (!isset($embed->provider_name) || strtolower($embed->provider_name) !== 'spotify' || !isset($embed->embed)) {
4533 return $embed;
4534 }
4535 $match = array();
4536 preg_match('/src=\"(.+?)\"/', $embed->embed, $match);
4537 if (empty($match)) {
4538 return $embed;
4539 }
4540 $url_full = $match[1];
4541 $modified_url = str_replace('playlist-v2', 'playlist', $url_full);
4542 if (isset($setting['spotify_theme'])) {
4543 if (strpos($modified_url, '?') !== false) {
4544 $modified_url .= '&theme=' . sanitize_text_field($setting['spotify_theme']);
4545 } else {
4546 $modified_url .= '?theme=' . sanitize_text_field($setting['spotify_theme']);
4547 }
4548 }
4549 $embed->embed = str_replace($url_full, $modified_url, $embed->embed);
4550 return $embed;
4551 }
4552 }
4553