PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents / 4.4.8
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents v4.4.8
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 6 months ago Embedpress_Pdf.php 6 months ago
Embedpress_Elementor.php
4892 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
3725 // Player Autoplay, Delay, and Repeat
3726 $this->add_control(
3727 'playerAutoplay',
3728 [
3729 'label' => __('Autoplay', 'embedpress'),
3730 'type' => \Elementor\Controls_Manager::SWITCHER,
3731 'label_on' => __('Yes', 'embedpress'),
3732 'label_off' => __('No', 'embedpress'),
3733 'default' => 'no',
3734 'condition' => [
3735 'mode' => 'gallery-player',
3736 ],
3737 ]
3738 );
3739
3740 $this->add_control(
3741 'delay',
3742 [
3743 'label' => __('Delay (seconds)', 'embedpress'),
3744 'type' => \Elementor\Controls_Manager::NUMBER,
3745 'min' => 1,
3746 'max' => 60,
3747 'default' => 5,
3748 'condition' => [
3749 'mode' => 'gallery-player',
3750 ],
3751 ]
3752 );
3753
3754 $this->add_control(
3755 'repeat',
3756 [
3757 'label' => __('Repeat', 'embedpress'),
3758 'type' => \Elementor\Controls_Manager::SWITCHER,
3759 'label_on' => __('Yes', 'embedpress'),
3760 'label_off' => __('No', 'embedpress'),
3761 'default' => 'no',
3762 'condition' => [
3763 'mode' => 'gallery-player',
3764 ],
3765 ]
3766 );
3767
3768 // Toggles for Media Items
3769 // $this->add_control(
3770 // 'mediaitemsAspectRatio',
3771 // [
3772 // 'label' => __('Keep Aspect Ratio', 'embedpress'),
3773 // 'type' => \Elementor\Controls_Manager::SWITCHER,
3774 // 'default' => 'yes',
3775 // ]
3776 // );
3777
3778 // $this->add_control(
3779 // 'mediaitemsEnlarge',
3780 // [
3781 // 'label' => __('Enlarge', 'embedpress'),
3782 // 'type' => \Elementor\Controls_Manager::SWITCHER,
3783 // 'default' => 'no',
3784 // ]
3785 // );
3786
3787 // $this->add_control(
3788 // 'mediaitemsStretch',
3789 // [
3790 // 'label' => __('Stretch', 'embedpress'),
3791 // 'type' => \Elementor\Controls_Manager::SWITCHER,
3792 // 'default' => 'no',
3793 // ]
3794 // );
3795
3796 // $this->add_control(
3797 // 'mediaitemsCover',
3798 // [
3799 // 'label' => __('Cover', 'embedpress'),
3800 // 'type' => \Elementor\Controls_Manager::SWITCHER,
3801 // 'default' => 'no',
3802 // ]
3803 // );
3804
3805 // Background Color
3806 $this->add_control(
3807 'backgroundColor',
3808 [
3809 'label' => __('Background Color', 'embedpress'),
3810 'type' => \Elementor\Controls_Manager::COLOR,
3811 'default' => '#000000',
3812 ]
3813 );
3814
3815 // Expiration
3816 $this->add_control(
3817 'expiration',
3818 [
3819 'label' => __('Sync after (minutes)', 'embedpress'),
3820 'type' => \Elementor\Controls_Manager::NUMBER,
3821 'min' => 0,
3822 'max' => 1440,
3823 'default' => 60,
3824 ]
3825 );
3826
3827 // Photos Link
3828 $this->add_control(
3829 'photos_link',
3830 [
3831 'label' => __('Enable Visit Google Photos Link', 'embedpress'),
3832 'type' => \Elementor\Controls_Manager::SWITCHER,
3833 'label_on' => __('Yes', 'embedpress'),
3834 'label_off' => __('No', 'embedpress'),
3835 'default' => 'yes',
3836 'description' => __('Enable an external link icon to visit the original Google Photos album', 'embedpress'),
3837 'condition' => [
3838 'mode' => ['carousel', 'gallery-player'],
3839 ],
3840 ]
3841 );
3842
3843 $this->end_controls_section();
3844 }
3845
3846 /**
3847 * Meetup Controls
3848 */
3849 public function init_meetup_control_section()
3850 {
3851 $condition = [
3852 'embedpress_pro_embeded_source' => 'meetup',
3853 ];
3854
3855 $this->start_controls_section(
3856 'meetup_controls_section',
3857 [
3858 'label' => __('Meetup Settings', 'embedpress'),
3859 'condition' => $condition,
3860 ]
3861 );
3862
3863 $this->add_control(
3864 'meetup_rss_feed_note',
3865 [
3866 'type' => \Elementor\Controls_Manager::RAW_HTML,
3867 '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'),
3868 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
3869 ]
3870 );
3871
3872 $this->add_control(
3873 'meetup_orderby',
3874 [
3875 'label' => __('Order By', 'embedpress'),
3876 'type' => Controls_Manager::SELECT,
3877 'options' => [
3878 'date' => __('Date', 'embedpress'),
3879 'title' => __('Title', 'embedpress'),
3880 'attendees' => __('Attendees', 'embedpress'),
3881 ],
3882 'default' => 'date',
3883 'description' => __('Choose how to sort the events (RSS feeds only)', 'embedpress'),
3884 ]
3885 );
3886
3887 $this->add_control(
3888 'meetup_order',
3889 [
3890 'label' => __('Order', 'embedpress'),
3891 'type' => Controls_Manager::SELECT,
3892 'options' => [
3893 'ASC' => __('Ascending', 'embedpress'),
3894 'DESC' => __('Descending', 'embedpress'),
3895 ],
3896 'default' => 'ASC',
3897 'description' => __('Sort direction (RSS feeds only)', 'embedpress'),
3898 ]
3899 );
3900
3901 $this->add_control(
3902 'meetup_per_page',
3903 [
3904 'label' => __('Events Per Page', 'embedpress'),
3905 'type' => Controls_Manager::NUMBER,
3906 'min' => 1,
3907 'max' => 50,
3908 'default' => 10,
3909 'description' => __('Number of events to show per page (RSS feeds only)', 'embedpress'),
3910 ]
3911 );
3912
3913 $this->add_control(
3914 'meetup_enable_pagination',
3915 [
3916 'label' => __('Enable Load More', 'embedpress'),
3917 'type' => Controls_Manager::SWITCHER,
3918 'label_on' => __('Yes', 'embedpress'),
3919 'label_off' => __('No', 'embedpress'),
3920 'default' => 'yes',
3921 'description' => __('Show a "Load More" button to load additional events (RSS feeds only)', 'embedpress'),
3922 ]
3923 );
3924
3925 $this->add_control(
3926 'meetup_timezone',
3927 [
3928 'label' => __('Timezone', 'embedpress'),
3929 'type' => Controls_Manager::SELECT,
3930 'options' => [
3931 'visitor_timezone' => __('Visitor Timezone (Auto-detect)', 'embedpress'),
3932 'wp_timezone' => __('WordPress Site Timezone', 'embedpress'),
3933 'UTC' => __('UTC', 'embedpress'),
3934 'America/New_York' => __('America/New_York (EST/EDT)', 'embedpress'),
3935 'America/Chicago' => __('America/Chicago (CST/CDT)', 'embedpress'),
3936 'America/Denver' => __('America/Denver (MST/MDT)', 'embedpress'),
3937 'America/Los_Angeles' => __('America/Los_Angeles (PST/PDT)', 'embedpress'),
3938 'Europe/London' => __('Europe/London (GMT/BST)', 'embedpress'),
3939 'Europe/Paris' => __('Europe/Paris (CET/CEST)', 'embedpress'),
3940 'Asia/Tokyo' => __('Asia/Tokyo (JST)', 'embedpress'),
3941 'Australia/Sydney' => __('Australia/Sydney (AEST/AEDT)', 'embedpress'),
3942 ],
3943 'default' => 'visitor_timezone',
3944 'description' => __('Select timezone for displaying event dates and times. Visitor timezone will auto-detect based on their browser.', 'embedpress'),
3945 ]
3946 );
3947
3948 $this->add_control(
3949 'meetup_date_format',
3950 [
3951 'label' => __('Date Format', 'embedpress'),
3952 'type' => Controls_Manager::SELECT,
3953 'options' => [
3954 'wp_date_format' => __('WordPress Date Format', 'embedpress'),
3955 'm/d/Y' => __('MM/DD/YYYY', 'embedpress'),
3956 'd/m/Y' => __('DD/MM/YYYY', 'embedpress'),
3957 'Y-m-d' => __('YYYY-MM-DD', 'embedpress'),
3958 'F j, Y' => __('Month DD, YYYY', 'embedpress'),
3959 'j F Y' => __('DD Month YYYY', 'embedpress'),
3960 ],
3961 'default' => 'wp_date_format',
3962 'description' => __('Select date format for event dates', 'embedpress'),
3963 ]
3964 );
3965
3966 $this->add_control(
3967 'meetup_time_format',
3968 [
3969 'label' => __('Time Format', 'embedpress'),
3970 'type' => Controls_Manager::SELECT,
3971 'options' => [
3972 'wp_time_format' => __('WordPress Time Format', 'embedpress'),
3973 'g:i A' => __('12-hour (h:mm AM/PM)', 'embedpress'),
3974 'H:i' => __('24-hour (HH:mm)', 'embedpress'),
3975 ],
3976 'default' => 'wp_time_format',
3977 'description' => __('Select time format for event times', 'embedpress'),
3978 ]
3979 );
3980
3981 $this->end_controls_section();
3982 }
3983
3984 /**
3985 * End Spreaker Controls
3986 */
3987
3988 /**
3989 * Performance Settings Section
3990 */
3991 public function init_performance_controls()
3992 {
3993 // Get global lazy load setting
3994 $g_settings = get_option(EMBEDPRESS_PLG_NAME, []);
3995 $lazy_load_default = isset($g_settings['g_lazyload']) && $g_settings['g_lazyload'] == 1 ? 'yes' : '';
3996
3997 $this->start_controls_section(
3998 'embedpress_performance_section',
3999 [
4000 'label' => __('Performance', 'embedpress'),
4001 ]
4002 );
4003
4004 $this->add_control(
4005 'enable_lazy_load',
4006 [
4007 'label' => sprintf(__('Enable Lazy Loading %s', 'embedpress'), $this->pro_text),
4008 'type' => \Elementor\Controls_Manager::SWITCHER,
4009 'label_on' => __('Yes', 'embedpress'),
4010 'label_off' => __('No', 'embedpress'),
4011 'return_value' => 'yes',
4012 'default' => $lazy_load_default,
4013 'description' => __('Load iframe only when it enters the viewport for better performance', 'embedpress'),
4014 'classes' => $this->pro_class,
4015 ]
4016 );
4017
4018 $this->end_controls_section();
4019 }
4020
4021 public function init_style_controls()
4022 {
4023 $this->start_controls_section(
4024 'embedpress_style_section',
4025 [
4026 'label' => __('General', 'embedpress'),
4027 'tab' => Controls_Manager::TAB_STYLE,
4028 'condition' => [
4029 'embedpress_pro_embeded_source!' => 'opensea',
4030 ]
4031
4032 ]
4033 );
4034 $this->add_responsive_control(
4035 'width',
4036 [
4037 'label' => __('Width', 'embedpress'),
4038 'type' => Controls_Manager::SLIDER,
4039 'size_units' => ['px'],
4040 'range' => [
4041 'px' => [
4042 'min' => 0,
4043 'max' => 1500,
4044 'step' => 1,
4045 ],
4046 ],
4047 'devices' => ['desktop', 'tablet', 'mobile'],
4048 'default' => [
4049 'size' => !empty($value = intval(Helper::get_options_value('enableEmbedResizeWidth'))) ? $value : 600,
4050 'unit' => 'px',
4051 ],
4052 'desktop_default' => [
4053 'size' => 600,
4054 'unit' => 'px',
4055 ],
4056 'tablet_default' => [
4057 'size' => 600,
4058 'unit' => 'px',
4059 ],
4060 'mobile_default' => [
4061 'size' => 600,
4062 'unit' => 'px',
4063 ],
4064 'selectors' => [
4065 '{{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive>iframe,{{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive, {{WRAPPER}} .sponsored-youtube-video > iframe,
4066 {{WRAPPER}} .plyr--video:not(.plyr--fullscreen-fallback),
4067 {{WRAPPER}} .ose-giphy img,
4068 {{WRAPPER}} .embera-embed-responsive-provider-gettyimages,
4069 {{WRAPPER}} .embera-embed-responsive-provider-gettyimages iframe,
4070 {{WRAPPER}} .getty,
4071 {{WRAPPER}} .jx-gallery-player-widget' => 'width: {{size}}{{UNIT}}!important; max-width: 100%!important;',
4072 ],
4073 ]
4074 );
4075
4076 $this->add_responsive_control(
4077 'height',
4078 [
4079 'label' => __('Height', 'embedpress'),
4080 'type' => Controls_Manager::SLIDER,
4081 'size_units' => ['px', '%'],
4082 'range' => [
4083 'px' => [
4084 'min' => 0,
4085 'max' => 1500,
4086 'step' => 1,
4087 ],
4088 ],
4089 'devices' => ['desktop', 'tablet', 'mobile'],
4090 'desktop_default' => [
4091 'size' => 400,
4092 'unit' => 'px',
4093 ],
4094 'default' => [
4095 'size' => !empty($value = intval(Helper::get_options_value('enableEmbedResizeHeight'))) ? $value : 600,
4096 'unit' => 'px',
4097 ],
4098 'tablet_default' => [
4099 'size' => 400,
4100 'unit' => 'px',
4101 ],
4102 'mobile_default' => [
4103 'size' => 400,
4104 'unit' => 'px',
4105 ],
4106 'selectors' => [
4107 '{{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive iframe, {{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive,{{WRAPPER}} .sponsored-youtube-video > iframe,
4108 {{WRAPPER}} .plyr--video:not(.plyr--fullscreen-fallback),
4109 {{WRAPPER}} .ose-giphy img,
4110 {{WRAPPER}} .embera-embed-responsive-provider-gettyimages,
4111 {{WRAPPER}} .embera-embed-responsive-provider-gettyimages iframe,
4112 {{WRAPPER}} .getty,
4113 {{WRAPPER}} .jx-gallery-player-widget' => 'height: {{size}}{{UNIT}}!important;max-height: 100%!important',
4114 '{{WRAPPER}} .ep-youtube-channel .ose-youtube' => 'height: 100%!important;max-height: 100%!important',
4115 ],
4116 'conditions' => [
4117 'relation' => 'or',
4118 'terms' => [
4119 [
4120 'relation' => 'and',
4121 'terms' => [
4122 [
4123 'name' => 'embedpress_pro_embeded_source',
4124 'operator' => '===',
4125 'value' => 'google_photos',
4126 ],
4127 [
4128 'relation' => 'or',
4129 'terms' => [
4130 [
4131 'name' => 'mode',
4132 'operator' => '==',
4133 'value' => 'carousel',
4134 ],
4135 [
4136 'name' => 'mode',
4137 'operator' => '==',
4138 'value' => 'gallery-player',
4139 ],
4140 ],
4141 ]
4142
4143 ],
4144 ],
4145 [
4146 'name' => 'embedpress_pro_embeded_source',
4147 'operator' => 'in',
4148 'value' => ['default', 'youtube', 'vimeo', 'twitch', 'soundcloud', 'dailymotion', 'wistia', 'calendly', 'opensea', 'spreaker', 'selfhosted_video', 'selfhosted_audio'],
4149 ],
4150
4151 ],
4152
4153 ],
4154 ]
4155 );
4156
4157 $this->add_control(
4158 'width_height_important_note',
4159 [
4160 'type' => \Elementor\Controls_Manager::RAW_HTML,
4161 'raw' => esc_html__('Note: The maximum width and height are set to 100%.', 'embedpress'),
4162 'content_classes' => 'elementor-panel-alert elementor-panel-warning-info',
4163 ]
4164 );
4165 $this->add_responsive_control(
4166 'margin',
4167 [
4168 'label' => __('Margin', 'embedpress'),
4169 'type' => Controls_Manager::DIMENSIONS,
4170 'size_units' => ['px', '%', 'em'],
4171 'selectors' => [
4172 '{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4173 ],
4174 ]
4175 );
4176 $this->add_responsive_control(
4177 'padding',
4178 [
4179 'label' => __('Padding', 'embedpress'),
4180 'type' => Controls_Manager::DIMENSIONS,
4181 'size_units' => ['px', '%', 'em'],
4182 'selectors' => [
4183 '{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4184 ],
4185 ]
4186 );
4187 $this->add_responsive_control(
4188 'align',
4189 [
4190 'label' => esc_html__('Alignment', 'embedpress'),
4191 'type' => Controls_Manager::CHOOSE,
4192 'options' => [
4193 'left' => [
4194 'title' => esc_html__('Left', 'embedpress'),
4195 'icon' => 'eicon-text-align-left',
4196 ],
4197 'center' => [
4198 'title' => esc_html__('Center', 'embedpress'),
4199 'icon' => 'eicon-text-align-center',
4200 ],
4201 'right' => [
4202 'title' => esc_html__('Right', 'embedpress'),
4203 'icon' => 'eicon-text-align-right',
4204 ],
4205 ],
4206 'prefix_class' => 'elementor%s-align-',
4207 'default' => '',
4208 ]
4209 );
4210 $this->end_controls_section();
4211 }
4212
4213 public function render_plain_content()
4214 {
4215 $args = "";
4216 $settings = $this->get_settings_for_display();
4217
4218 $_settings = $this->convert_settings($settings);
4219 foreach ($_settings as $key => $value) {
4220 $args .= "$key='" . esc_attr($value) . "' ";
4221 }
4222
4223 $args = trim($args);
4224 $embed_code = sprintf("[embedpress %s]%s[/embedpress]", $args, esc_url($settings['embedpress_embeded_link']));
4225 echo $embed_code;
4226 }
4227
4228
4229 public function get_custom_player_options($settings)
4230 {
4231
4232 $_player_options = '';
4233
4234 if (!empty($settings['emberpress_custom_player'])) {
4235
4236 $player_preset = !empty($settings['custom_payer_preset']) ? sanitize_text_field($settings['custom_payer_preset']) : 'preset-default';
4237
4238 $player_color = !empty($settings['embedpress_player_color']) ? sanitize_hex_color($settings['embedpress_player_color']) : '';
4239
4240 $poster_thumbnail = !empty($settings['embedpress_player_poster_thumbnail']['url']) ? esc_url($settings['embedpress_player_poster_thumbnail']['url']) : '';
4241
4242
4243 $is_self_hosted = Helper::check_media_format($settings['embedpress_embeded_link']);
4244
4245
4246 $player_pip = !empty($settings['embepress_player_always_on_top']) ? true : false;
4247 $player_restart = !empty($settings['embepress_player_restart']) ? true : false;
4248 $player_rewind = !empty($settings['embepress_player_rewind']) ? true : false;
4249 $player_fastForward = !empty($settings['embepress_player_fast_forward']) ? true : false;
4250 $player_tooltip = !empty($settings['embepress_player_tooltip']) ? true : false;
4251 $player_hide_controls = !empty($settings['embepress_player_hide_controls']) ? true : false;
4252 $player_download = !empty($settings['embepress_player_download']) ? true : false;
4253 $player_fullscreen = !empty($settings['embedpress_pro_youtube_enable_fullscreen_button']) ? true : false;
4254
4255 $playerOptions = [
4256 'rewind' => $player_rewind,
4257 'restart' => $player_restart,
4258 'pip' => $player_pip,
4259 'poster_thumbnail' => $poster_thumbnail,
4260 'player_color' => $player_color,
4261 'player_preset' => $player_preset,
4262 'fast_forward' => $player_fastForward,
4263 'player_tooltip' => $player_tooltip,
4264 'hide_controls' => $player_hide_controls,
4265 'download' => $player_download,
4266 'fullscreen' => $player_fullscreen,
4267 ];
4268
4269
4270 //Youtube options
4271 if (!empty($settings['embedpress_pro_video_start_time'])) {
4272 $playerOptions['start'] = $settings['embedpress_pro_video_start_time'];
4273 }
4274 if (!empty($settings['embedpress_pro_youtube_end_time'])) {
4275 $playerOptions['end'] = $settings['embedpress_pro_youtube_end_time'];
4276 }
4277 if (!empty($settings['embedpress_pro_youtube_display_related_videos'])) {
4278 $playerOptions['rel'] = true;
4279 } else {
4280 $playerOptions['rel'] = false;
4281 }
4282
4283 //vimeo options
4284 if (!empty($settings['embedpress_pro_video_start_time'])) {
4285 $playerOptions['t'] = $settings['embedpress_pro_video_start_time'];
4286 }
4287 if (!empty($settings['embedpress_pro_vimeo_auto_play'])) {
4288 $playerOptions['vautoplay'] = true;
4289 } else {
4290 $playerOptions['vautoplay'] = false;
4291 }
4292 if (!empty($settings['embedpress_pro_vimeo_autopause'])) {
4293 $playerOptions['autopause'] = true;
4294 } else {
4295 $playerOptions['autopause'] = false;
4296 }
4297
4298 if (!empty($settings['embedpress_pro_vimeo_dnt'])) {
4299 $playerOptions['dnt'] = true;
4300 } else {
4301 $playerOptions['dnt'] = false;
4302 }
4303
4304 if (!empty($is_self_hosted['selhosted'])) {
4305 $playerOptions['self_hosted'] = $is_self_hosted['selhosted'];
4306 $playerOptions['hosted_format'] = $is_self_hosted['format'];
4307 }
4308
4309 $playerOptionsString = json_encode($playerOptions);
4310 $_player_options = 'data-options=' . htmlentities($playerOptionsString, ENT_QUOTES);
4311
4312 }
4313
4314 return $_player_options;
4315 }
4316
4317 public function get_instafeed_carousel_options($settings)
4318 {
4319 $_carousel_options = '';
4320
4321 if(!empty($settings['instaLayout']) && $settings['instaLayout'] === 'insta-carousel'){
4322 $_carousel_id = 'data-carouselid=' . esc_attr($this->get_id()) . '';
4323
4324 $layout = $settings['instaLayout'];
4325 $embedpress_instafeed_slide_show = !empty($settings['embedpress_instafeed_slide_show']) ? $settings['embedpress_instafeed_slide_show'] : 5;
4326 $embedpress_carousel_autoplay = !empty($settings['embedpress_carousel_autoplay']) ? $settings['embedpress_carousel_autoplay'] : 0;
4327 $embedpress_carousel_autoplay_speed = !empty($settings['embedpress_carousel_autoplay_speed']) ? $settings['embedpress_carousel_autoplay_speed'] : 3000;
4328 $embedpress_carousel_transition_speed = !empty($settings['embedpress_carousel_transition_speed']) ? $settings['embedpress_carousel_transition_speed'] : 1000;
4329 $embedpress_carousel_loop = !empty($settings['embedpress_carousel_loop']) ? $settings['embedpress_carousel_loop'] : 0;
4330 $embedpress_carousel_arrows = !empty($settings['embedpress_carousel_arrows']) ? $settings['embedpress_carousel_arrows'] : 0;
4331 $spacing = !empty($settings['embedpress_carousel_spacing']) ? $settings['embedpress_carousel_spacing'] : 0;
4332
4333 // print_r($settings);
4334
4335 $carousel_options = [
4336 'layout' => $layout,
4337 'slideshow' => $embedpress_instafeed_slide_show,
4338 'autoplay' => $embedpress_carousel_autoplay,
4339 'autoplayspeed' => $embedpress_carousel_autoplay_speed,
4340 'transitionspeed' => $embedpress_carousel_transition_speed,
4341 'loop' => $embedpress_carousel_loop,
4342 'arrows' => $embedpress_carousel_arrows,
4343 'spacing' => $spacing
4344 ];
4345
4346 $carousel_options_string = json_encode($carousel_options);
4347 $_carousel_options = 'data-carousel-options='. htmlentities($carousel_options_string, ENT_QUOTES) .'';
4348 }
4349 return $_carousel_options;
4350 }
4351
4352 public function get_instafeed_layout($settings){
4353 $insta_layout = '';
4354 if($settings['embedpress_pro_embeded_source'] == 'instafeed'){
4355 $insta_layout = ' '. $settings['instaLayout'];
4356 }
4357
4358 return $insta_layout;
4359 }
4360
4361 protected function convert_settings($settings)
4362 {
4363 $_settings = [];
4364 foreach ($settings as $key => $value) {
4365 if (empty($value)) {
4366 $_settings[$key] = 'false';
4367 } else if (!empty($value['size'])) {
4368 $_settings[$key] = $value['size'];
4369 } else if (!empty($value['url'])) {
4370 $_settings[$key] = $value['url'];
4371 } else if (\is_scalar($value)) {
4372 $_settings[$key] = $value;
4373 }
4374 }
4375
4376 return $_settings;
4377 }
4378
4379 public function validUserAccountUrl($url){
4380 $pattern = '/^(?:https?:\/\/)?(?:www\.)?instagram\.com\/(?:[a-zA-Z0-9_\.]+\/?)$/';
4381 return (bool) preg_match($pattern, $url);
4382 }
4383
4384 function validInstagramTagUrl($url) {
4385 $pattern = '/^(?:https?:\/\/)?(?:www\.)?instagram\.com\/explore\/tags\/[a-zA-Z0-9_\-]+\/?$/';
4386 return (bool) preg_match($pattern, $url);
4387 }
4388
4389 protected function render()
4390 {
4391 $settings = $this->get_settings_for_display();
4392 Helper::get_enable_settings_data_for_scripts($settings);
4393
4394 add_filter('embedpress_should_modify_spotify', '__return_false');
4395 $embed_link = isset($settings['embedpress_embeded_link']) ? $settings['embedpress_embeded_link'] : '';
4396
4397 if(!apply_filters('embedpress/is_allow_rander', false) && ($settings['mode'] === 'gallery-grid' || $settings['mode'] === 'gallery-masonary' || $settings['mode'] === 'gallery-justify')){
4398 echo '<div class="pro__alert__wrap" style="display: block;">
4399 <div class="pro__alert__card">
4400 <h2>Opps...</h2>
4401 <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>
4402 </div>
4403 </div>';
4404 return '';
4405 }
4406
4407 if($settings['instafeedFeedType'] === 'mixed_type' || $settings['instafeedFeedType'] === 'tagged_type'){
4408 echo 'Comming Soon.';
4409 return '';
4410 }
4411
4412 if($settings['instafeedFeedType'] === 'hashtag_type' && !$this->validInstagramTagUrl($embed_link)){
4413 echo 'Please add valid hashtag link url';
4414 return '';
4415 }
4416
4417 if($settings['instafeedFeedType'] === 'user_account_type' && !$this->validUserAccountUrl($embed_link)){
4418 echo 'Please add valid user account link url';
4419 return '';
4420 }
4421
4422 if(!apply_filters('embedpress/is_allow_rander', false) && ($settings['instaLayout'] === 'insta-masonry' || $settings['instaLayout'] === 'insta-carousel' || $settings['instafeedFeedType'] === 'hashtag_type')){
4423 echo '<div class="pro__alert__wrap" style="display: block;">
4424 <div class="pro__alert__card">
4425 <h2>Opps...</h2>
4426 <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>
4427 </div>
4428 </div>';
4429 return '';
4430 }
4431
4432 if(!apply_filters('embedpress/is_allow_rander', false) && ($settings['ytChannelLayout'] === 'carousel' || $settings['ytChannelLayout'] === 'grid')){
4433 echo '<div class="pro__alert__wrap" style="display: block;">
4434 <div class="pro__alert__card">
4435 <h2>Opps...</h2>
4436 <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>
4437 </div>
4438 </div>';
4439 return '';
4440 }
4441
4442 if($settings['instafeedFeedType'] === 'mixed_type' || $settings['instafeedFeedType'] === 'tagged_type'){
4443 echo 'Comming Soon.';
4444 return '';
4445 }
4446
4447 if($settings['instafeedFeedType'] === 'hashtag_type' && !$this->validInstagramTagUrl($embed_link)){
4448 echo 'Please add valid hashtag link url';
4449 return '';
4450 }
4451
4452 if($settings['instafeedFeedType'] === 'user_account_type' && !$this->validUserAccountUrl($embed_link)){
4453 echo 'Please add valid user account link url';
4454 return '';
4455 }
4456
4457 $is_editor_view = Plugin::$instance->editor->is_edit_mode();
4458 $link = $settings['embedpress_embeded_link'];
4459 $is_apple_podcast = (strpos($link, 'podcasts.apple.com') !== false);
4460
4461 // conditionaly convert settings data
4462 $_settings = [];
4463 $source = isset($settings['embedpress_pro_embeded_source']) ? esc_attr($settings['embedpress_pro_embeded_source']) : 'default';
4464 $embed_link = isset($settings['embedpress_embeded_link']) ? esc_url($settings['embedpress_embeded_link']) : '';
4465 $pass_hash_key = isset($settings['embedpress_lock_content_password']) ? md5($settings['embedpress_lock_content_password']) : '';
4466
4467
4468
4469 Helper::get_source_data(md5($this->get_id()) . '_eb_elementor', esc_url($embed_link), 'elementor_source_data', 'elementor_temp_source_data');
4470
4471 if (!(($source === 'default' || !empty($source[0]) && $source[0] === 'default') && strpos($embed_link, 'opensea.io') !== false)) {
4472 $_settings = $this->convert_settings($settings);
4473 }
4474
4475 if (strpos($embed_link, 'opensea.io') !== false) {
4476 $source = 'opensea';
4477 }
4478
4479 $_settings = Helper::removeQuote($_settings);
4480
4481 // Map Meetup-specific settings to shortcode attributes
4482 if (strpos($embed_link, 'meetup.com') !== false) {
4483 if (isset($settings['meetup_orderby'])) {
4484 $_settings['orderby'] = $settings['meetup_orderby'];
4485 }
4486 if (isset($settings['meetup_order'])) {
4487 $_settings['order'] = $settings['meetup_order'];
4488 }
4489 if (isset($settings['meetup_per_page'])) {
4490 $_settings['per_page'] = $settings['meetup_per_page'];
4491 }
4492 if (isset($settings['meetup_enable_pagination'])) {
4493 $_settings['enable_pagination'] = ($settings['meetup_enable_pagination'] === 'yes');
4494 }
4495 if (isset($settings['meetup_timezone'])) {
4496 $_settings['timezone'] = $settings['meetup_timezone'];
4497 }
4498 if (isset($settings['meetup_date_format'])) {
4499 $_settings['date_format'] = $settings['meetup_date_format'];
4500 }
4501 if (isset($settings['meetup_time_format'])) {
4502 $_settings['time_format'] = $settings['meetup_time_format'];
4503 }
4504 }
4505
4506 $embed_content = Shortcode::parseContent($settings['embedpress_embeded_link'], true, $_settings);
4507 $embed_content = $this->onAfterEmbedSpotify($embed_content, $settings);
4508 $embed = apply_filters('embedpress_elementor_embed', $embed_content, $settings);
4509 $content = is_object($embed) ? $embed->embed : $embed;
4510
4511 // Track Elementor widget usage for analytics
4512 $this->track_elementor_usage($settings, $content);
4513
4514
4515
4516 $embed_settings = [];
4517 $embed_settings['customThumbnail'] = !empty($settings['embedpress_content_share_custom_thumbnail']['url']) ? esc_url($settings['embedpress_content_share_custom_thumbnail']['url']) : '';
4518
4519 $embed_settings['customTitle'] = !empty($settings['embedpress_content_title']) ? sanitize_text_field($settings['embedpress_content_title']) : Helper::get_file_title($embed_link);
4520
4521 $embed_settings['customDescription'] = !empty($settings['embedpress_content_descripiton']) ? sanitize_text_field($settings['embedpress_content_descripiton']) : Helper::get_file_title($embed_link);
4522
4523 $embed_settings['sharePosition'] = !empty($settings['embedpress_content_share_position']) ? sanitize_text_field($settings['embedpress_content_share_position']) : 'right';
4524
4525 // Add social share platform settings
4526 $embed_settings['shareFacebook'] = !empty($settings['embedpress_share_facebook']) ? true : false;
4527 $embed_settings['shareTwitter'] = !empty($settings['embedpress_share_twitter']) ? true : false;
4528 $embed_settings['sharePinterest'] = !empty($settings['embedpress_share_pinterest']) ? true : false;
4529 $embed_settings['shareLinkedin'] = !empty($settings['embedpress_share_linkedin']) ? true : false;
4530
4531 $embed_settings['lockHeading'] = !empty($settings['embedpress_lock_content_heading']) ? sanitize_text_field($settings['embedpress_lock_content_heading']) : '';
4532
4533 $embed_settings['lockSubHeading'] = !empty($settings['embedpress_lock_content_sub_heading']) ? sanitize_text_field($settings['embedpress_lock_content_sub_heading']) : '';
4534
4535 $embed_settings['passwordPlaceholder'] = !empty($settings['embedpress_password_placeholder']) ? sanitize_text_field($settings['embedpress_password_placeholder']) : '';
4536
4537 $embed_settings['submitButtonText'] = !empty($settings['embedpress_submit_button_text']) ? sanitize_text_field($settings['embedpress_submit_button_text']) : '';
4538
4539 $embed_settings['submitUnlockingText'] = !empty($settings['embedpress_submit_Unlocking_text']) ? sanitize_text_field($settings['embedpress_submit_Unlocking_text']) : '';
4540
4541 $embed_settings['lockErrorMessage'] = !empty($settings['embedpress_lock_content_error_message']) ? sanitize_text_field($settings['embedpress_lock_content_error_message']) : '';
4542
4543 $embed_settings['enableFooterMessage'] = !empty($settings['embedpress_enable_footer_message']) ? sanitize_text_field($settings['embedpress_enable_footer_message']) : '';
4544
4545 $embed_settings['footerMessage'] = !empty($settings['embedpress_lock_content_footer_message']) ? sanitize_text_field($settings['embedpress_lock_content_footer_message']) : '';
4546
4547 $embed_settings['userRole'] = !empty($settings['embedpress_select_roles']) ? $settings['embedpress_select_roles'] : [];
4548
4549 $embed_settings['protectionMessage'] = !empty($settings['embedpress_protection_message']) ? $settings['embedpress_protection_message'] : '';
4550
4551
4552 $client_id = $this->get_id();
4553 $hash_pass = hash('sha256', wp_salt(32) . md5($settings['embedpress_lock_content_password'] ? sanitize_text_field($settings['embedpress_lock_content_password']) : ''));
4554
4555 $password_correct = isset($_COOKIE['password_correct_' . $client_id]) ? sanitize_text_field($_COOKIE['password_correct_' . $client_id]) : '';
4556
4557 $ispagination = 'flex';
4558
4559 if ($settings['pagination'] != 'show') {
4560 $ispagination = 'none';
4561 }
4562
4563 $calVal = '';
4564
4565 if (!empty($settings['columns']) && is_numeric($settings['columns']) && (int) $settings['columns'] > 0) {
4566 $columns = (int) $settings['columns'];
4567 $gap_size = isset($settings['gapbetweenvideos']['size']) ? absint($settings['gapbetweenvideos']['size']) : 0;
4568 $calVal = 'calc(' . (100 / $columns) . '% - ' . $gap_size . 'px)';
4569 } else {
4570 $calVal = 'auto';
4571 }
4572
4573
4574 $content_share_class = '';
4575 $share_position_class = '';
4576 $share_position = isset($settings['embedpress_content_share_position']) ? esc_attr($settings['embedpress_content_share_position']) : 'right';
4577
4578 if (!empty($settings['embedpress_content_share'])) {
4579 $content_share_class = 'ep-content-share-enabled';
4580 $share_position_class = 'ep-share-position-' . $share_position;
4581 }
4582
4583 $content_protection_class = 'ep-content-protection-enabled';
4584 if (empty($settings['embedpress_lock_content']) || empty($settings['embedpress_lock_content_password']) || $hash_pass === $password_correct) {
4585 $content_protection_class = 'ep-content-protection-disabled';
4586 }
4587
4588 $data_playerid = '';
4589 if (!empty($settings['embedpress_custom_player'])) {
4590 $data_playerid = 'data-playerid="' . esc_attr($this->get_id()) . '"';
4591 // $data_playerid = 'data-playerid='.esc_attr($this->get_id());
4592 }
4593
4594 $data_carouselid = '';
4595 if (!empty($settings['instaLayout']) && $settings['instaLayout'] === 'insta-carousel') {
4596 $data_carouselid = 'data-carouselid="' . esc_attr($this->get_id()) . '"';
4597 }
4598
4599 $cEmbedType = !empty($settings['cEmbedType']) ? sanitize_text_field($settings['cEmbedType']) : '';
4600
4601 $adsAtts = '';
4602
4603 if (!empty($settings['adManager'])) {
4604 $ad = base64_encode(json_encode($settings)); // Using WordPress JSON encoding function
4605 $adsAtts = 'data-sponsored-id="' . esc_attr($client_id) . '" data-sponsored-attrs="' . esc_attr($ad) . '" class="sponsored-mask"';
4606 }
4607
4608 $data_player_id = '';
4609
4610 if (!empty($settings['emberpress_custom_player']) && $settings['emberpress_custom_player'] === 'yes') {
4611 $data_player_id = "data-playerid='" . esc_attr($this->get_id()) . "'";
4612 }
4613
4614 $hosted_format = '';
4615 if (!empty($settings['emberpress_custom_player'])) {
4616 $self_hosted = Helper::check_media_format($settings['embedpress_embeded_link']);
4617 $hosted_format = isset($self_hosted['format']) ? $self_hosted['format'] : '';
4618 }
4619
4620 $autoPause = '';
4621 if(!empty($settings['embedpress_audio_video_auto_pause'])){
4622 $autoPause = ' enabled-auto-pause';
4623 }
4624
4625 $youtube_channel_classes = Helper::is_youtube_channel($settings['embedpress_embeded_link']) ? 'ep-youtube-channel' : '';
4626
4627 ?>
4628
4629 <div class="embedpress-elements-wrapper <?php echo esc_attr($youtube_channel_classes); ?> <?php echo !empty($settings['embedpress_elementor_aspect_ratio']) ? 'embedpress-fit-aspect-ratio' : '';
4630 echo esc_attr($cEmbedType); ?>" id="ep-elements-id-<?php echo esc_attr($this->get_id()); ?>">
4631
4632 <?php if(!apply_filters('embedpress/is_allow_rander', false) && $is_editor_view && $is_apple_podcast) : ?>
4633
4634 <p><?php esc_html_e('You need EmbedPress Pro to Embed Apple Podcast. Note. This message is only visible to you.', 'embedpress'); ?></p>
4635 <?php else: ?>
4636 <div id="ep-elementor-content-<?php echo esc_attr($client_id) ?>"
4637 class="ep-elementor-content
4638 <?php
4639 if (!empty($settings['embedpress_content_share'])) :
4640 echo esc_attr('position-' . $settings['embedpress_content_share_position'] . '-wraper');
4641 endif;
4642 ?>
4643 <?php echo esc_attr($content_share_class . ' ' . $share_position_class . ' ' . $content_protection_class); ?>
4644 <?php echo esc_attr('source-' . $source); ?>
4645 <?php echo esc_attr($autoPause); ?>">
4646
4647 <div id="<?php echo esc_attr($this->get_id()); ?>"
4648 class="ep-embed-content-wrapper
4649 <?php echo isset($settings['custom_player_preset']) ? esc_attr($settings['custom_player_preset']) : ''; ?>
4650 <?php echo esc_attr($this->get_instafeed_layout($settings)); ?>
4651 <?php echo esc_attr('ep-google-photos-'.$settings['mode']); ?>
4652 <?php echo esc_attr($hosted_format); ?>"
4653 <?php echo $data_playerid; ?>
4654 <?php echo $data_carouselid; ?>
4655 <?php echo $this->get_custom_player_options($settings); ?>
4656 <?php echo $this->get_instafeed_carousel_options($settings); ?>>
4657
4658 <div id="ep-elementor-content-<?php echo esc_attr($client_id) ?>"
4659 class="ep-elementor-content
4660 <?php
4661 if (!empty($settings['embedpress_content_share'])) :
4662 echo esc_attr('position-' . $settings['embedpress_content_share_position'] . '-wraper');
4663 endif;
4664 ?>
4665 <?php echo esc_attr($content_share_class . ' ' . $share_position_class . ' ' . $content_protection_class); ?>
4666 <?php echo esc_attr('source-' . $source); ?>">
4667
4668 <div <?php echo $adsAtts; ?>>
4669 <div id="<?php echo esc_attr($this->get_id()); ?>"
4670 class="ep-embed-content-wraper
4671 <?php echo esc_attr($settings['custom_payer_preset']); ?>"
4672 <?php echo $data_player_id; ?>
4673 <?php echo $this->get_custom_player_options($settings); ?>>
4674
4675 <?php
4676 $content_id = $client_id;
4677 if (
4678 (empty($settings['embedpress_lock_content']) || ($settings['embedpress_protection_type'] == 'password' && empty($settings['embedpress_lock_content_password'])) || $settings['embedpress_lock_content'] == 'no') ||
4679 ($settings['embedpress_protection_type'] == 'password' && !empty(Helper::is_password_correct($client_id)) && ($hash_pass === $password_correct) ) ||
4680 !apply_filters('embedpress/is_allow_rander', false) ||
4681 ($settings['embedpress_protection_type'] == 'user-role' && Helper::has_allowed_roles($embed_settings['userRole']))
4682 ) {
4683 if (!empty($settings['embedpress_content_share'])) {
4684 $content .= Helper::embed_content_share($content_id, $embed_settings);
4685 }
4686
4687 // Apply lazy loading if enabled (but not when custom player is active or in editor mode)
4688 $custom_player_enabled = !empty($settings['emberpress_custom_player']) && $settings['emberpress_custom_player'] === 'yes';
4689 if (!empty($settings['enable_lazy_load']) && $settings['enable_lazy_load'] === 'yes' && !$custom_player_enabled && !$is_editor_view) {
4690 $content = preg_replace_callback(
4691 '/<iframe([^>]*)src=["\']([^"\']+)["\']([^>]*)>/i',
4692 function($matches) {
4693 $before = $matches[1];
4694 $src = $matches[2];
4695 $after = $matches[3];
4696
4697 // Extract style attribute if exists
4698 $style = '';
4699 if (preg_match('/style=["\']([^"\']+)["\']/i', $before . $after, $style_match)) {
4700 $style = $style_match[1];
4701 }
4702
4703 return sprintf(
4704 '<div class="ep-lazy-iframe-placeholder" data-ep-lazy-src="%s" data-ep-iframe-style="%s" %s %s style="%s"></div>',
4705 esc_attr($src),
4706 esc_attr($style),
4707 $before,
4708 $after,
4709 esc_attr($style)
4710 );
4711 },
4712 $content
4713 );
4714 }
4715
4716 echo $content;
4717 } else {
4718 if (!empty($settings['embedpress_content_share'])) {
4719 $content .= Helper::embed_content_share($content_id, $embed_settings);
4720 }
4721
4722 // Apply lazy loading if enabled (but not when custom player is active or in editor mode)
4723 $custom_player_enabled = !empty($settings['emberpress_custom_player']) && $settings['emberpress_custom_player'] === 'yes';
4724 if (!empty($settings['enable_lazy_load']) && $settings['enable_lazy_load'] === 'yes' && !$custom_player_enabled && !$is_editor_view) {
4725 $content = preg_replace_callback(
4726 '/<iframe([^>]*)src=["\']([^"\']+)["\']([^>]*)>/i',
4727 function($matches) {
4728 $before = $matches[1];
4729 $src = $matches[2];
4730 $after = $matches[3];
4731
4732 // Extract style attribute if exists
4733 $style = '';
4734 if (preg_match('/style=["\']([^"\']+)["\']/i', $before . $after, $style_match)) {
4735 $style = $style_match[1];
4736 }
4737
4738 return sprintf(
4739 '<div class="ep-lazy-iframe-placeholder" data-ep-lazy-src="%s" data-ep-iframe-style="%s" %s %s style="%s"></div>',
4740 esc_attr($src),
4741 esc_attr($style),
4742 $before,
4743 $after,
4744 esc_attr($style)
4745 );
4746 },
4747 $content
4748 );
4749 }
4750
4751 if ($settings['embedpress_protection_type'] == 'password') {
4752 do_action('embedpress/display_password_form', $client_id, $content, $pass_hash_key, $embed_settings);
4753
4754 } else {
4755 do_action('embedpress/content_protection_content', $client_id, $embed_settings['protectionMessage'], $embed_settings['userRole']);
4756 }
4757 }
4758 ?>
4759 </div>
4760
4761 <?php
4762 $isAdEnabled = !empty($settings['adManager']);
4763 $isContentUnlocked = empty($settings['embedpress_lock_content']);
4764 $isPasswordCorrect = Helper::is_password_correct($client_id) && ($hash_pass === $password_correct);
4765
4766 if ($isAdEnabled && ($isContentUnlocked || $isPasswordCorrect)) {
4767 $content = apply_filters('embedpress/generate_ad_template', $content, $client_id, $settings, 'elementor');
4768 }
4769 ?>
4770
4771 </div>
4772 </div>
4773 </div>
4774 </div>
4775
4776 <?php endif;?>
4777
4778 </div>
4779
4780
4781 <?php if ($settings['embedpress_pro_embeded_source'] === 'youtube') : ?>
4782 <style>
4783 #ep-elements-id-<?php echo esc_html($this->get_id()); ?>.ep-youtube__content__block .youtube__content__body .content__wrap {
4784 grid-template-columns: repeat(auto-fit, minmax(<?php echo esc_html($calVal); ?>, 1fr)) !important;
4785 }
4786
4787 #ep-elements-id-<?php echo esc_html($this->get_id()); ?>.ep-youtube__content__pagination {
4788 display: <?php echo esc_html($ispagination); ?> !important;
4789 }
4790 </style>
4791 <?php endif; ?>
4792
4793 <?php
4794 }
4795 public function onAfterEmbedSpotify($embed, $setting)
4796 {
4797 if (!isset($embed->provider_name) || strtolower($embed->provider_name) !== 'spotify' || !isset($embed->embed)) {
4798 return $embed;
4799 }
4800 $match = array();
4801 preg_match('/src=\"(.+?)\"/', $embed->embed, $match);
4802 if (empty($match)) {
4803 return $embed;
4804 }
4805 $url_full = $match[1];
4806 $modified_url = str_replace('playlist-v2', 'playlist', $url_full);
4807 if (isset($setting['spotify_theme'])) {
4808 if (strpos($modified_url, '?') !== false) {
4809 $modified_url .= '&theme=' . sanitize_text_field($setting['spotify_theme']);
4810 } else {
4811 $modified_url .= '?theme=' . sanitize_text_field($setting['spotify_theme']);
4812 }
4813 }
4814 $embed->embed = str_replace($url_full, $modified_url, $embed->embed);
4815 return $embed;
4816 }
4817
4818 /**
4819 * Track Elementor widget usage for analytics
4820 *
4821 * @param array $settings
4822 * @param string $content
4823 * @return void
4824 */
4825 protected function track_elementor_usage($settings, &$content)
4826 {
4827 // Only track if analytics is enabled and we have the necessary classes
4828 if (class_exists('EmbedPress\Includes\Classes\Analytics\Analytics_Manager')) {
4829 $url = isset($settings['embedpress_embeded_link']) ? $settings['embedpress_embeded_link'] : '';
4830
4831 if (empty($url)) {
4832 return;
4833 }
4834
4835 $content_id = md5($url . 'elementor');
4836 $provider_name = $this->get_provider_from_url($url);
4837
4838 $tracking_data = [
4839 'embed_type' => $provider_name,
4840 'embed_url' => $url,
4841 'post_id' => get_the_ID(),
4842 'page_url' => get_permalink(),
4843 'title' => get_the_title()
4844 ];
4845
4846 // Add data attribute for frontend tracking
4847 $content = str_replace(
4848 'class="ep-embed-content-wraper',
4849 'data-embedpress-content="' . esc_attr($content_id) . '" data-embed-type="' . esc_attr($provider_name) . '" class="ep-embed-content-wraper',
4850 $content
4851 );
4852
4853 // Track content creation
4854 do_action('embedpress_content_embedded', $content_id, 'elementor', $tracking_data);
4855 }
4856 }
4857
4858 /**
4859 * Get provider name from URL
4860 *
4861 * @param string $url
4862 * @return string
4863 */
4864 protected function get_provider_from_url($url)
4865 {
4866 $providers = [
4867 'youtube.com' => 'YouTube',
4868 'youtu.be' => 'YouTube',
4869 'vimeo.com' => 'Vimeo',
4870 'twitter.com' => 'Twitter',
4871 'instagram.com' => 'Instagram',
4872 'facebook.com' => 'Facebook',
4873 'tiktok.com' => 'TikTok',
4874 'spotify.com' => 'Spotify',
4875 'soundcloud.com' => 'SoundCloud',
4876 'twitch.tv' => 'Twitch',
4877 'docs.google.com' => 'Google Docs',
4878 'drive.google.com' => 'Google Drive',
4879 'calendly.com' => 'Calendly',
4880 'wistia.com' => 'Wistia'
4881 ];
4882
4883 foreach ($providers as $domain => $provider) {
4884 if (strpos($url, $domain) !== false) {
4885 return $provider;
4886 }
4887 }
4888
4889 return 'Unknown';
4890 }
4891 }
4892