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