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