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