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