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