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