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