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