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