PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents / 4.5.4
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents v4.5.4
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 1 month ago Embedpress_Elementor.php 2 months ago Embedpress_Pdf.php 1 month ago Embedpress_Pdf_Gallery.php 2 months ago
Embedpress_Elementor.php
5700 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 $this->start_controls_section(
1376 'embedpress_yt_channel_section',
1377 [
1378 'label' => __('YouTube Channel', 'embedpress'),
1379 'condition' => [
1380 'embedpress_pro_embeded_source' => 'youtube',
1381 'emberpress_custom_player!' => 'yes'
1382 ],
1383
1384 ]
1385 );
1386
1387 $this->add_control(
1388 'important_note',
1389 [
1390 'type' => \Elementor\Controls_Manager::RAW_HTML,
1391 'raw' => esc_html__('These options take effect only when a YouTube channel is embedded.', 'embedpress'),
1392 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
1393 ]
1394 );
1395
1396 $this->add_control(
1397 'ytChannelLayout',
1398 [
1399 'label' => __('Layout', 'embedpress'),
1400 'type' => \Elementor\Controls_Manager::SELECT,
1401 'label_block' => false,
1402 'default' => 'gallery',
1403 'options' => [
1404 'gallery' => esc_html__('Gallery', 'embedpress'),
1405 'list' => esc_html__('List', 'embedpress'),
1406 'grid' => sprintf(esc_html__('Grid %s', 'embedpress'), $this->pro_label),
1407 'carousel' => sprintf(esc_html__('Carousel %s', 'embedpress'), $this->pro_label),
1408 ],
1409 'conditions' => [
1410 'terms' => [
1411 [
1412 'name' => 'embedpress_pro_embeded_source',
1413 'operator' => '===',
1414 'value' => 'youtube',
1415 ],
1416 ],
1417 ]
1418 ]
1419 );
1420
1421
1422 $this->add_control(
1423 'pagesize',
1424 [
1425 'label' => __('Video Per Page', 'embedpress'),
1426 'type' => Controls_Manager::NUMBER,
1427 'label_block' => false,
1428 'default' => 6,
1429 'min' => 1,
1430 'max' => 50,
1431 'conditions' => [
1432 'terms' => [
1433 [
1434 'name' => 'embedpress_pro_embeded_source',
1435 'operator' => '===',
1436 'value' => 'youtube',
1437 ],
1438 ],
1439 ]
1440 ]
1441 );
1442
1443 $this->add_control(
1444 'columns',
1445 [
1446 'label' => __('Column', 'embedpress'),
1447 'type' => \Elementor\Controls_Manager::SELECT,
1448 'label_block' => false,
1449 'default' => '3',
1450 'options' => [
1451 '2' => esc_html__('2', 'embedpress'),
1452 '3' => esc_html__('3', 'embedpress'),
1453 '4' => esc_html__('4', 'embedpress'),
1454 '6' => esc_html__('6', 'embedpress'),
1455 'auto' => esc_html__('Auto', 'embedpress'),
1456 ],
1457 'conditions' => [
1458 'terms' => [
1459 [
1460 'name' => 'embedpress_pro_embeded_source',
1461 'operator' => '===',
1462 'value' => 'youtube',
1463 ],
1464 [
1465 'name' => 'ytChannelLayout',
1466 'operator' => '!==',
1467 'value' => 'list',
1468 ],
1469 [
1470 'name' => 'ytChannelLayout',
1471 'operator' => '!==',
1472 'value' => 'carousel',
1473 ],
1474 ],
1475 ]
1476 ]
1477 );
1478 $this->add_control(
1479 'gapbetweenvideos',
1480 [
1481 'label' => __('Gap Between Videos', 'embedpress'),
1482 'label_block' => true,
1483 'type' => \Elementor\Controls_Manager::SLIDER,
1484 'size_units' => ['px', '%'],
1485 'range' => [
1486 'px' => [
1487 'min' => 0,
1488 'max' => 100,
1489 'step' => 1,
1490 ],
1491 '%' => [
1492 'min' => 0,
1493 'max' => 100,
1494 ],
1495 ],
1496 'default' => [
1497 'unit' => 'px',
1498 'size' => 30,
1499 ],
1500 'conditions' => [
1501 'terms' => [
1502 [
1503 'name' => 'embedpress_pro_embeded_source',
1504 'operator' => '===',
1505 'value' => 'youtube',
1506 ],
1507 [
1508 'name' => 'ytChannelLayout',
1509 'operator' => '!==',
1510 'value' => 'carousel',
1511 ],
1512 ],
1513 ],
1514 'selectors' => [
1515 '{{WRAPPER}} .ep-youtube__content__block .youtube__content__body .content__wrap:not(.youtube-carousel)' => 'gap: {{SIZE}}{{UNIT}}!important;margin-top: {{SIZE}}{{UNIT}}!important;',
1516 ],
1517 ]
1518 );
1519
1520 $this->add_control(
1521 'pagination',
1522 [
1523 'label' => __('Pagination', 'embedpress'),
1524 'type' => Controls_Manager::SWITCHER,
1525 'label_block' => false,
1526 'label_on' => esc_html__('Show', 'embedpress'),
1527 'label_off' => esc_html__('Hide', 'embedpress'),
1528 'return_value' => 'show',
1529 'default' => 'show',
1530 'condition' => [
1531 'terms' => [
1532 [
1533 'name' => 'embedpress_pro_embeded_source',
1534 'operator' => '===',
1535 'value' => 'youtube',
1536 ],
1537 [
1538 'name' => 'ytChannelLayout',
1539 'operator' => '!==',
1540 'value' => 'carousel',
1541 ],
1542 ],
1543 ],
1544 ]
1545 );
1546
1547 $this->end_controls_section();
1548 }
1549 public function init_youtube_subscription_section()
1550 {
1551 $yt_condition = [
1552 'embedpress_pro_embeded_source' => 'youtube',
1553 ];
1554 $this->start_controls_section(
1555 'embedpress_yt_subscription_section',
1556 [
1557 'label' => __('YouTube Subscriber', 'embedpress'),
1558 'condition' => $yt_condition,
1559
1560 ]
1561 );
1562
1563
1564 $this->add_control(
1565 'yt_sub_channel',
1566 [
1567
1568 'label' => sprintf(__('Channel ID %s', 'embedpress'), $this->pro_text),
1569 'type' => Controls_Manager::TEXT,
1570 'dynamic' => [
1571 'active' => true,
1572 ],
1573 'placeholder' => __('Enter Channel ID', 'embedpress'),
1574 'label_block' => true,
1575 'condition' => $yt_condition,
1576 'classes' => $this->pro_class,
1577 ]
1578 );
1579 $this->add_control(
1580 'yt_sub_text',
1581 [
1582
1583 'label' => sprintf(__('Subscription Text %s', 'embedpress'), $this->pro_text),
1584 'type' => Controls_Manager::TEXT,
1585 'dynamic' => [
1586 'active' => true,
1587 ],
1588 'placeholder' => __('Eg. Don\'t miss out! Subscribe', 'embedpress'),
1589 'label_block' => true,
1590 'condition' => $yt_condition,
1591 'classes' => $this->pro_class,
1592 ]
1593 );
1594
1595
1596 $this->add_control(
1597 'yt_sub_layout',
1598 [
1599 'label' => sprintf(__('Layout %s', 'embedpress'), $this->pro_text),
1600 'type' => Controls_Manager::SELECT,
1601 'label_block' => false,
1602 'default' => 'default',
1603 'options' => [
1604 'default' => __('Default', 'embedpress'),
1605 'full' => __('Full', 'embedpress')
1606 ],
1607 'condition' => [
1608 'embedpress_pro_embeded_source' => 'youtube',
1609 ],
1610 'classes' => $this->pro_class,
1611 ]
1612 );
1613
1614 $this->add_control(
1615 'yt_sub_theme',
1616 [
1617 'label' => sprintf(__('Theme %s', 'embedpress'), $this->pro_text),
1618 'type' => Controls_Manager::SELECT,
1619 'label_block' => false,
1620 'default' => 'default',
1621 'options' => [
1622 'default' => __('Default', 'embedpress'),
1623 'dark' => __('Dark', 'embedpress')
1624 ],
1625 'condition' => [
1626 'embedpress_pro_embeded_source' => 'youtube',
1627 ],
1628 'classes' => $this->pro_class,
1629 ]
1630 );
1631
1632 $this->add_control(
1633 'yt_sub_count',
1634 [
1635 'label' => sprintf(__('Subscriber Count %s', 'embedpress'), $this->pro_text),
1636 'type' => Controls_Manager::SWITCHER,
1637 'label_block' => false,
1638 'return_value' => 'yes',
1639 'default' => 'yes',
1640 'condition' => $yt_condition,
1641 'classes' => $this->pro_class,
1642 ]
1643 );
1644
1645 $this->end_controls_section();
1646 }
1647
1648 public function init_youtube_livechat_section()
1649 {
1650 $yt_condition = [
1651 'embedpress_pro_embeded_source' => 'youtube',
1652 ];
1653 $this->start_controls_section(
1654 'embedpress_yt_livechat_section',
1655 [
1656 'label' => __('YouTube Live Chat', 'embedpress'),
1657 'condition' => $yt_condition,
1658
1659 ]
1660 );
1661
1662 $this->add_control(
1663 'yt_lc_show',
1664 [
1665 'label' => sprintf(__('Show YouTube Live Chat %s', 'embedpress'), $this->pro_text),
1666 'type' => Controls_Manager::SWITCHER,
1667 'label_block' => false,
1668 'return_value' => 'yes',
1669 'default' => '',
1670 'label_off' => __('Hide', 'embedpress'),
1671 'label_on' => __('Show', 'embedpress'),
1672 'condition' => $yt_condition,
1673 'classes' => $this->pro_class,
1674 ]
1675 );
1676
1677
1678 $this->end_controls_section();
1679 }
1680
1681 //End Youtube Controls
1682
1683 /**
1684 * Dailymotion Controls
1685 */
1686 public function init_dailymotion_control()
1687 {
1688 $dm_condition = [
1689 'embedpress_pro_embeded_source' => 'dailymotion'
1690 ];
1691
1692 $this->start_controls_section(
1693 'embedpress_dailymotion_section',
1694 [
1695 'label' => esc_html__('Dailymotion Controls', 'embedpress'),
1696 'condition' => $dm_condition,
1697 ]
1698 );
1699
1700 //@TODO; Kamal - migrate from 'embedpress_pro_dailymotion_logo' to 'embedpress_pro_dailymotion_ui_logo'
1701 $this->add_control(
1702 'embedpress_pro_dailymotion_ui_logo',
1703 [
1704 'label' => sprintf(__('Logo %s', 'embedpress'), $this->pro_text),
1705 'type' => Controls_Manager::SWITCHER,
1706 'label_block' => false,
1707 'return_value' => 'yes',
1708 'default' => 'yes',
1709 'label_off' => __('Hide', 'embedpress'),
1710 'label_on' => __('Show', 'embedpress'),
1711 'condition' => [
1712 'embedpress_pro_embeded_source' => 'dailymotion'
1713 ],
1714 'classes' => $this->pro_class,
1715 ]
1716 );
1717 $this->add_control(
1718 'embedpress_pro_dailymotion_autoplay',
1719 [
1720 'label' => __('Auto Play', 'embedpress'),
1721 'type' => Controls_Manager::SWITCHER,
1722 'label_block' => false,
1723 'return_value' => 'yes',
1724 'default' => 'no',
1725 'label_off' => __('Hide', 'embedpress'),
1726 'label_on' => __('Show', 'embedpress'),
1727 'condition' => [
1728 'embedpress_pro_embeded_source' => 'dailymotion'
1729 ]
1730 ]
1731 );
1732 $this->add_control(
1733 'embedpress_pro_dailymotion_play_on_mobile',
1734 [
1735 'label' => __('Play On Mobile', 'embedpress'),
1736 'type' => Controls_Manager::SWITCHER,
1737 'label_block' => false,
1738 'return_value' => 'yes',
1739 'default' => 'no',
1740 'label_off' => __('Hide', 'embedpress'),
1741 'label_on' => __('Show', 'embedpress'),
1742 'condition' => [
1743 'embedpress_pro_embeded_source' => 'dailymotion',
1744 'embedpress_pro_dailymotion_autoplay' => 'yes'
1745 ]
1746 ]
1747 );
1748 $this->add_control(
1749 'embedpress_pro_dailymotion_mute',
1750 [
1751 'label' => __('Mute', 'embedpress'),
1752 'type' => Controls_Manager::SWITCHER,
1753 'label_block' => false,
1754 'return_value' => 'yes',
1755 'default' => 'no',
1756 'label_off' => __('Hide', 'embedpress'),
1757 'label_on' => __('Show', 'embedpress'),
1758 'condition' => [
1759 'embedpress_pro_embeded_source' => 'dailymotion'
1760 ]
1761 ]
1762 );
1763 $this->add_control(
1764 'embedpress_pro_dailymotion_player_control',
1765 [
1766 'label' => __('Player Controls', 'embedpress'),
1767 'type' => Controls_Manager::SWITCHER,
1768 'label_block' => false,
1769 'return_value' => 'yes',
1770 'default' => 'yes',
1771 'label_off' => __('Hide', 'embedpress'),
1772 'label_on' => __('Show', 'embedpress'),
1773 'condition' => [
1774 'embedpress_pro_embeded_source' => 'dailymotion'
1775 ]
1776 ]
1777 );
1778 $this->add_control(
1779 'embedpress_pro_dailymotion_video_info',
1780 [
1781 'label' => __('Video Info', 'embedpress'),
1782 'type' => Controls_Manager::SWITCHER,
1783 'label_block' => false,
1784 'return_value' => 'yes',
1785 'default' => 'yes',
1786 'label_off' => __('Hide', 'embedpress'),
1787 'label_on' => __('Show', 'embedpress'),
1788 'condition' => [
1789 'embedpress_pro_embeded_source' => 'dailymotion'
1790 ]
1791 ]
1792 );
1793 $this->add_control(
1794 'embedpress_pro_dailymotion_control_color',
1795 [
1796 'label' => __('Control Color', 'embedpress'),
1797 'type' => Controls_Manager::COLOR,
1798 'label_block' => false,
1799 'default' => '#dd3333',
1800 'condition' => [
1801 'embedpress_pro_embeded_source' => 'dailymotion'
1802 ]
1803 ]
1804 );
1805 $this->init_branding_controls('dailymotion');
1806
1807 $this->end_controls_section();
1808 }
1809 //End Dailymotion Controls
1810
1811 /**
1812 * Wistia Controls
1813 */
1814 public function init_wistia_controls()
1815 {
1816 $wistia_condition = [
1817 'embedpress_pro_embeded_source' => 'wistia'
1818 ];
1819
1820 $this->start_controls_section(
1821 'embedpress_wistia_section',
1822 [
1823 'label' => esc_html__('Wistia Controls', 'embedpress'),
1824 'condition' => $wistia_condition,
1825 ]
1826 );
1827
1828 $this->add_control(
1829 'embedpress_pro_wistia_auto_play',
1830 [
1831 'label' => __('Auto Play', 'embedpress'),
1832 'type' => Controls_Manager::SWITCHER,
1833 'label_block' => false,
1834 'return_value' => 'yes',
1835 'default' => 'no',
1836 'condition' => [
1837 'embedpress_pro_embeded_source' => 'wistia'
1838 ],
1839 ]
1840 );
1841
1842 $this->add_control(
1843 'embedpress_pro_wistia_color',
1844 [
1845 'label' => __('Scheme', 'embedpress'),
1846 'type' => Controls_Manager::COLOR,
1847 'label_block' => false,
1848 'default' => '#dd3333',
1849 'condition' => [
1850 'embedpress_pro_embeded_source' => 'wistia'
1851 ]
1852 ]
1853 );
1854
1855 $this->add_control(
1856 'embedpress_pro_wistia_player_options',
1857 [
1858 'label' => __('Player Options', 'embedpress'),
1859 'type' => Controls_Manager::HEADING,
1860 'separator' => 'before',
1861 'condition' => [
1862 'embedpress_pro_embeded_source' => 'wistia'
1863 ]
1864 ]
1865 );
1866
1867
1868
1869 $this->add_control(
1870 'embedpress_pro_wistia_fullscreen_button',
1871 [
1872 'label' => __('Fullscreen Button', 'embedpress'),
1873 'type' => Controls_Manager::SWITCHER,
1874 'label_block' => false,
1875 'return_value' => 'yes',
1876 'default' => 'no',
1877 'condition' => [
1878 'embedpress_pro_embeded_source' => 'wistia'
1879 ],
1880 ]
1881 );
1882
1883 $this->add_control(
1884 'embedpress_pro_wistia_small_play_button',
1885 [
1886 'label' => __('Small Play Button', 'embedpress'),
1887 'type' => Controls_Manager::SWITCHER,
1888 'label_block' => false,
1889 'return_value' => 'yes',
1890 'default' => 'no',
1891 'condition' => [
1892 'embedpress_pro_embeded_source' => 'wistia'
1893 ],
1894 ]
1895 );
1896
1897
1898
1899
1900 // $this->add_control(
1901 // 'embedpress_pro_wistia_resumable',
1902 // [
1903 // 'label' => __('Resumable', 'embedpress'),
1904 // 'type' => Controls_Manager::SWITCHER,
1905 // 'label_block' => false,
1906 // 'return_value' => 'yes',
1907 // 'default' => 'no',
1908 // 'condition' => [
1909 // 'embedpress_pro_embeded_source' => 'wistia'
1910 // ],
1911 // ]
1912 // );
1913
1914
1915 // $this->add_control(
1916 // 'embedpress_pro_wistia_focus',
1917 // [
1918 // 'label' => __('Focus', 'embedpress'),
1919 // 'type' => Controls_Manager::SWITCHER,
1920 // 'label_block' => false,
1921 // 'return_value' => 'yes',
1922 // 'default' => 'no',
1923 // 'condition' => [
1924 // 'embedpress_pro_embeded_source' => 'wistia'
1925 // ],
1926 // ]
1927 // );
1928
1929 // --- Wistia PRO Controls --
1930 $this->add_control(
1931 'embedpress_pro_wistia_captions',
1932 [
1933 'label' => sprintf(__('Captions %s', 'embedpress'), $this->pro_text),
1934 'type' => Controls_Manager::SWITCHER,
1935 'label_block' => false,
1936 'return_value' => 'yes',
1937 'default' => 'no',
1938 'condition' => [
1939 'embedpress_pro_embeded_source' => 'wistia'
1940 ],
1941 'classes' => $this->pro_class,
1942 ]
1943 );
1944
1945 $this->add_control(
1946 'embedpress_pro_wistia_captions_enabled_by_default',
1947 [
1948 'label' => sprintf(__('Caption Enabled by Default', 'embedpress'), $this->pro_text),
1949 'type' => Controls_Manager::SWITCHER,
1950 'label_block' => false,
1951 'return_value' => 'yes',
1952 'default' => 'no',
1953 'condition' => [
1954 'embedpress_pro_embeded_source' => 'wistia',
1955 'embedpress_pro_wistia_captions' => 'yes'
1956 ],
1957 'classes' => $this->pro_class,
1958 ]
1959 );
1960 $this->add_control(
1961 'embedpress_pro_wistia_playbar',
1962 [
1963 'label' => __('Playbar ', 'embedpress'),
1964 'type' => Controls_Manager::SWITCHER,
1965 'label_block' => false,
1966 'return_value' => 'yes',
1967 'default' => 'no',
1968 'condition' => [
1969 'embedpress_pro_embeded_source' => 'wistia'
1970 ],
1971 ]
1972 );
1973
1974 $this->add_control(
1975 'embedpress_pro_wistia_volume_control',
1976 [
1977 'label' => sprintf(__('Volume Control %s', 'embedpress'), $this->pro_text),
1978 'type' => Controls_Manager::SWITCHER,
1979 'label_block' => false,
1980 'return_value' => 'yes',
1981 'default' => 'yes',
1982 'condition' => [
1983 'embedpress_pro_embeded_source' => 'wistia'
1984 ],
1985 'classes' => $this->pro_class,
1986 ]
1987 );
1988
1989
1990 $this->add_control(
1991 'embedpress_pro_wistia_volume',
1992 [
1993 'label' => sprintf(__('Volume %s', 'embedpress'), $this->pro_text),
1994 'type' => Controls_Manager::SLIDER,
1995 'default' => [
1996 'size' => 100,
1997 ],
1998 'range' => [
1999 'px' => [
2000 'min' => 0,
2001 'max' => 100,
2002 ]
2003 ],
2004 'condition' => [
2005 'embedpress_pro_embeded_source' => 'wistia',
2006 'embedpress_pro_wistia_volume_control' => 'yes'
2007 ],
2008 'classes' => $this->pro_class,
2009 ]
2010 );
2011
2012 // $this->add_control(
2013 // 'embedpress_pro_wistia_rewind',
2014 // [
2015 // 'label' => __('Rewind', 'embedpress'),
2016 // 'type' => Controls_Manager::SWITCHER,
2017 // 'label_block' => false,
2018 // 'return_value' => 'yes',
2019 // 'default' => 'no',
2020 // 'condition' => [
2021 // 'embedpress_pro_embeded_source' => 'wistia'
2022 // ],
2023 // ]
2024 // );
2025
2026 // $this->add_control(
2027 // 'embedpress_pro_wistia_rewind_time',
2028 // [
2029 // 'label' => __('Rewind time', 'embedpress'),
2030 // 'type' => Controls_Manager::SLIDER,
2031 // 'default' => [
2032 // 'size' => 10,
2033 // ],
2034 // 'range' => [
2035 // 'px' => [
2036 // 'min' => 1,
2037 // 'max' => 100,
2038 // ]
2039 // ],
2040 // 'condition' => [
2041 // 'embedpress_pro_wistia_rewind' => 'yes',
2042 // 'embedpress_pro_embeded_source' => 'wistia'
2043 // ],
2044 // ]
2045 // );
2046 $this->init_branding_controls('wistia');
2047
2048 $this->end_controls_section();
2049 }
2050 //End Wistia controls
2051
2052
2053
2054 /**
2055 * Twitch Controls
2056 */
2057 public function init_twitch_control()
2058 {
2059 $condition = [
2060 'embedpress_pro_embeded_source' => 'twitch'
2061 ];
2062
2063 $this->start_controls_section(
2064 'embedpress_twitch_section',
2065 [
2066 'label' => esc_html__('Twitch Controls', 'embedpress'),
2067 'condition' => $condition,
2068 ]
2069 );
2070
2071 $this->add_control(
2072 'embedpress_pro_twitch_autoplay',
2073 [
2074 'label' => __('Autoplay', 'embedpress'),
2075 'type' => Controls_Manager::SWITCHER,
2076 'label_off' => __('No', 'embedpress'),
2077 'label_on' => __('Yes', 'embedpress'),
2078 'default' => 'yes',
2079 'condition' => $condition,
2080 ]
2081 );
2082 $this->add_control(
2083 'embedpress_pro_fs',
2084 [
2085 'label' => __('Allow Full Screen Video', 'embedpress'),
2086 'type' => Controls_Manager::SWITCHER,
2087 'label_off' => __('No', 'embedpress'),
2088 'label_on' => __('Yes', 'embedpress'),
2089 'default' => 'yes',
2090 'condition' => $condition,
2091 ]
2092 );
2093
2094 // -- Twitch PRO controls --
2095 $this->add_control(
2096 'embedpress_pro_twitch_chat',
2097 [
2098 'label' => sprintf(__('Show Chat %s', 'embedpress'), $this->pro_text),
2099 'type' => Controls_Manager::SWITCHER,
2100 'label_off' => __('Hide', 'embedpress'),
2101 'label_on' => __('Show', 'embedpress'),
2102 'condition' => $condition,
2103 'classes' => $this->pro_class,
2104
2105 ]
2106 );
2107 $this->add_control(
2108 'embedpress_pro_twitch_mute',
2109 [
2110 'label' => __('Mute on start', 'embedpress'),
2111 'type' => Controls_Manager::SWITCHER,
2112 'label_off' => __('Hide', 'embedpress'),
2113 'label_on' => __('Show', 'embedpress'),
2114 'condition' => $condition,
2115 ]
2116 );
2117 $this->add_control(
2118 'embedpress_pro_twitch_theme',
2119 [
2120 'label' => __('Theme', 'embedpress'),
2121 'type' => Controls_Manager::SELECT,
2122 'default' => 'dark',
2123 'options' => [
2124 'dark' => __('Dark', 'embedpress'),
2125 'light' => __('Light', 'embedpress'),
2126 ],
2127 'condition' => $condition,
2128 ]
2129 );
2130
2131 $this->init_branding_controls('twitch');
2132
2133 $this->end_controls_section();
2134 }
2135 //End Twitch controls
2136
2137
2138 /**
2139 * SoundCloud Controls
2140 */
2141 public function init_soundcloud_controls()
2142 {
2143 $sc_condition = [
2144 'embedpress_pro_embeded_source' => 'soundcloud'
2145 ];
2146
2147 $this->start_controls_section(
2148 'embedpress_soundcloud_section',
2149 [
2150 'label' => esc_html__('SoundCloud Controls', 'embedpress'),
2151 'condition' => $sc_condition,
2152 ]
2153 );
2154
2155 $this->add_control(
2156 'embedpress_pro_soundcloud_visual',
2157 [
2158 'label' => __('Visual Player', 'embedpress'),
2159 'type' => Controls_Manager::SWITCHER,
2160 'label_block' => false,
2161 'return_value' => 'yes',
2162 'default' => 'no',
2163 'label_off' => __('Hide', 'embedpress'),
2164 'label_on' => __('Show', 'embedpress'),
2165 'condition' => [
2166 'embedpress_pro_embeded_source' => 'soundcloud'
2167 ],
2168 ]
2169 );
2170
2171 $this->add_control(
2172 'embedpress_pro_soundcloud_color',
2173 [
2174 'label' => __('Scheme', 'embedpress'),
2175 'type' => Controls_Manager::COLOR,
2176 'label_block' => false,
2177 'default' => '#FF5500',
2178 'condition' => [
2179 'embedpress_pro_embeded_source' => 'soundcloud'
2180 ]
2181 ]
2182 );
2183
2184 $this->add_control(
2185 'embedpress_pro_soundcloud_autoplay',
2186 [
2187 'label' => __('Auto Play', 'embedpress'),
2188 'type' => Controls_Manager::SWITCHER,
2189 'label_block' => false,
2190 'return_value' => 'yes',
2191 'default' => 'no',
2192 'label_off' => __('Hide', 'embedpress'),
2193 'label_on' => __('Show', 'embedpress'),
2194 'condition' => [
2195 'embedpress_pro_embeded_source' => 'soundcloud'
2196 ],
2197 ]
2198 );
2199
2200
2201
2202 $this->add_control(
2203 'embedpress_pro_soundcloud_share_button',
2204 [
2205 'label' => __('Share Button', 'embedpress'),
2206 'type' => Controls_Manager::SWITCHER,
2207 'label_block' => false,
2208 'return_value' => 'yes',
2209 'default' => 'yes',
2210 'label_off' => __('Hide', 'embedpress'),
2211 'label_on' => __('Show', 'embedpress'),
2212 'condition' => [
2213 'embedpress_pro_embeded_source' => 'soundcloud'
2214 ],
2215 ]
2216 );
2217
2218 $this->add_control(
2219 'embedpress_pro_soundcloud_comments',
2220 [
2221 'label' => __('Comments', 'embedpress'),
2222 'type' => Controls_Manager::SWITCHER,
2223 'label_block' => false,
2224 'return_value' => 'yes',
2225 'default' => 'yes',
2226 'label_off' => __('Hide', 'embedpress'),
2227 'label_on' => __('Show', 'embedpress'),
2228 'condition' => [
2229 'embedpress_pro_embeded_source' => 'soundcloud'
2230 ],
2231 ]
2232 );
2233
2234
2235
2236 $this->add_control(
2237 'embedpress_pro_soundcloud_artwork',
2238 [
2239 'label' => __('Artwork', 'embedpress'),
2240 'type' => Controls_Manager::SWITCHER,
2241 'label_block' => false,
2242 'return_value' => 'yes',
2243 'default' => 'yes',
2244 'label_off' => __('Hide', 'embedpress'),
2245 'label_on' => __('Show', 'embedpress'),
2246 'condition' => [
2247 'embedpress_pro_embeded_source' => 'soundcloud',
2248 'embedpress_pro_soundcloud_visual!' => 'yes'
2249 ]
2250 ]
2251 );
2252
2253 $this->add_control(
2254 'embedpress_pro_soundcloud_play_count',
2255 [
2256 'label' => __('Play Count', 'embedpress'),
2257 'type' => Controls_Manager::SWITCHER,
2258 'label_block' => false,
2259 'return_value' => 'yes',
2260 'default' => 'yes',
2261 'label_off' => __('Hide', 'embedpress'),
2262 'label_on' => __('Show', 'embedpress'),
2263 'condition' => [
2264 'embedpress_pro_embeded_source' => 'soundcloud',
2265 'embedpress_pro_soundcloud_visual!' => 'yes'
2266 ],
2267 ]
2268 );
2269
2270 $this->add_control(
2271 'embedpress_pro_soundcloud_user_name',
2272 [
2273 'label' => __('User Name', 'embedpress'),
2274 'type' => Controls_Manager::SWITCHER,
2275 'label_block' => false,
2276 'return_value' => 'yes',
2277 'default' => 'yes',
2278 'label_off' => __('Hide', 'embedpress'),
2279 'label_on' => __('Show', 'embedpress'),
2280 'condition' => [
2281 'embedpress_pro_embeded_source' => 'soundcloud'
2282 ],
2283 ]
2284 );
2285
2286 $this->add_control(
2287 'embedpress_pro_soundcloud_buy_button',
2288 [
2289 'label' => sprintf(__('Buy Button %s', 'embedpress'), $this->pro_text),
2290 'type' => Controls_Manager::SWITCHER,
2291 'label_block' => false,
2292 'return_value' => 'yes',
2293 'default' => 'yes',
2294 'label_off' => __('Hide', 'embedpress'),
2295 'label_on' => __('Show', 'embedpress'),
2296 'condition' => [
2297 'embedpress_pro_embeded_source' => 'soundcloud'
2298 ],
2299 'classes' => $this->pro_class,
2300 ]
2301 );
2302 $this->add_control(
2303 'embedpress_pro_soundcloud_download_button',
2304 [
2305 'label' => sprintf(__('Download Button %s', 'embedpress'), $this->pro_text),
2306 'type' => Controls_Manager::SWITCHER,
2307 'label_block' => false,
2308 'return_value' => 'yes',
2309 'default' => 'yes',
2310 'label_off' => __('Hide', 'embedpress'),
2311 'label_on' => __('Show', 'embedpress'),
2312 'condition' => [
2313 'embedpress_pro_embeded_source' => 'soundcloud'
2314 ],
2315 'classes' => $this->pro_class,
2316 ]
2317 );
2318
2319 $this->end_controls_section();
2320 }
2321 //End SoundCloud controls
2322
2323 /**
2324 * Vimeo Controls
2325 */
2326 public function init_vimeo_controls()
2327 {
2328 $vimeo_condition = [
2329 'embedpress_pro_embeded_source' => 'vimeo'
2330 ];
2331
2332 $this->start_controls_section(
2333 'embedpress_vimeo_section',
2334 [
2335 'label' => esc_html__('Vimeo Controls', 'embedpress'),
2336 'condition' => $vimeo_condition,
2337 ]
2338 );
2339
2340 $this->add_control(
2341 'embedpress_pro_vimeo_start_time',
2342 [
2343 'label' => __('Start Time', 'embedpress'),
2344 'type' => Controls_Manager::NUMBER,
2345 'description' => __('Specify a start time (in seconds)', 'embedpress'),
2346 'condition' => $vimeo_condition,
2347 ]
2348 );
2349
2350 $this->add_control(
2351 'embedpress_pro_vimeo_auto_play',
2352 [
2353 'label' => __('Auto Play', 'embedpress'),
2354 'type' => Controls_Manager::SWITCHER,
2355 'label_block' => false,
2356 'return_value' => 'yes',
2357 'default' => 'no',
2358 'condition' => $vimeo_condition,
2359 ]
2360 );
2361
2362 $this->add_control(
2363 'embedpress_pro_vimeo_autopause',
2364 [
2365 'label' => sprintf(__('Auto Pause %s', 'embedpress'), $this->pro_text),
2366 'type' => Controls_Manager::SWITCHER,
2367 'label_block' => false,
2368 'return_value' => 'yes',
2369 'default' => 'no',
2370 'description' => __(
2371 'Automatically stop the current video from playing when another one starts.',
2372 'embedpress'
2373 ),
2374 'condition' => $vimeo_condition,
2375 'classes' => $this->pro_class,
2376 ]
2377 );
2378
2379 $this->add_control(
2380 'embedpress_pro_vimeo_dnt',
2381 [
2382 'label' => sprintf(__('DNT %s', 'embedpress'), $this->pro_text),
2383 'type' => Controls_Manager::SWITCHER,
2384 'label_block' => false,
2385 'return_value' => 'yes',
2386 'default' => 'yes',
2387 'description' => __(
2388 'Set this parameter to "yes" will block tracking any session data, including cookies. If Auto Pause is enabled this will not work.',
2389 'embedpress'
2390 ),
2391 'condition' => $vimeo_condition,
2392 'classes' => $this->pro_class,
2393 ]
2394 );
2395
2396 $this->add_control(
2397 'embedpress_pro_vimeo_color',
2398 [
2399 'label' => __('Scheme', 'embedpress'),
2400 'type' => Controls_Manager::COLOR,
2401 'label_block' => false,
2402 'default' => '#00adef',
2403 'condition' => [
2404 'emberpress_custom_player!' => 'yes',
2405 'embedpress_pro_embeded_source' => 'vimeo'
2406 ]
2407 ]
2408 );
2409
2410 $this->add_control(
2411 'embedpress_pro_vimeo_author_options',
2412 [
2413 'label' => __('Author Information', 'embedpress'),
2414 'type' => Controls_Manager::HEADING,
2415 'separator' => 'before',
2416 'condition' => [
2417 'embedpress_pro_embeded_source' => 'vimeo',
2418 'emberpress_custom_player!' => 'yes',
2419 ]
2420 ]
2421 );
2422
2423 $this->add_control(
2424 'embedpress_pro_vimeo_display_title',
2425 [
2426 'label' => __('Title', 'embedpress'),
2427 'type' => Controls_Manager::SWITCHER,
2428 'label_block' => false,
2429 'return_value' => 'yes',
2430 'default' => 'yes',
2431 'condition' => [
2432 'emberpress_custom_player!' => 'yes',
2433 'embedpress_pro_embeded_source' => 'vimeo'
2434 ]
2435 ]
2436 );
2437
2438 //----- Vimeo PRO controls
2439
2440 $this->add_control(
2441 'embedpress_pro_vimeo_display_author',
2442 [
2443 'label' => __('Author', 'embedpress'),
2444 'type' => Controls_Manager::SWITCHER,
2445 'label_block' => false,
2446 'return_value' => 'yes',
2447 'default' => 'yes',
2448 'condition' => [
2449 'emberpress_custom_player!' => 'yes',
2450 'embedpress_pro_embeded_source' => 'vimeo'
2451 ],
2452 ]
2453 );
2454
2455 $this->add_control(
2456 'embedpress_pro_vimeo_avatar',
2457 [
2458 'label' => __('Avatar', 'embedpress'),
2459 'type' => Controls_Manager::SWITCHER,
2460 'label_block' => false,
2461 'return_value' => 'yes',
2462 'default' => 'yes',
2463 'condition' => [
2464 'emberpress_custom_player!' => 'yes',
2465 'embedpress_pro_embeded_source' => 'vimeo'
2466 ],
2467 ]
2468 );
2469
2470 $this->add_control(
2471 'embedpress_pro_vimeo_loop',
2472 [
2473 'label' => sprintf(__('Loop %s', 'embedpress'), $this->pro_text),
2474 'type' => Controls_Manager::SWITCHER,
2475 'label_block' => false,
2476 'return_value' => 'yes',
2477 'default' => 'no',
2478 'condition' => [
2479 'emberpress_custom_player!' => 'yes',
2480 'embedpress_pro_embeded_source' => 'vimeo'
2481 ],
2482 'classes' => $this->pro_class,
2483 ]
2484 );
2485
2486 $this->init_branding_controls('vimeo');
2487
2488 $this->end_controls_section();
2489 }
2490 //End Vimeo controls
2491
2492
2493 /**
2494 * Spotify Controls
2495 */
2496 public function init_spotify_controls()
2497 {
2498 $condition = [
2499 'embedpress_pro_embeded_source' => 'spotify'
2500 ];
2501
2502 $this->add_control(
2503 'spotify_theme',
2504 [
2505 'label' => __('Player Background', 'embedpress'),
2506 'description' => __('Dynamic option will use the most vibrant color from the album art.', 'embedpress'),
2507 'type' => Controls_Manager::SELECT,
2508 'label_block' => false,
2509 'default' => '1',
2510 'options' => [
2511 '1' => __('Dynamic', 'embedpress'),
2512 '0' => __('Black & White', 'embedpress')
2513 ],
2514 'condition' => $condition
2515 ]
2516 );
2517 }
2518 //End Spotify controls
2519
2520 /**
2521 * OpenSea Controls
2522 */
2523 public function init_opensea_control()
2524 {
2525 $condition = [
2526 'embedpress_pro_embeded_source' => 'opensea'
2527 ];
2528
2529 $this->add_control(
2530 'limit',
2531 [
2532 'type' => \Elementor\Controls_Manager::NUMBER,
2533 'label' => esc_html__('Limit', 'embedpress'),
2534 'placeholder' => '9',
2535 'min' => 1,
2536 'max' => 100,
2537 'step' => 1,
2538 'default' => 20,
2539 'condition' => [
2540 'embedpress_pro_embeded_nft_type' => ['collection'],
2541 'embedpress_pro_embeded_source!' => [
2542 'default',
2543 'youtube',
2544 'vimeo',
2545 'dailymotion',
2546 'wistia',
2547 'twitch',
2548 'meetup',
2549 'soundcloud',
2550 'instafeed',
2551 'calendly',
2552 'selfhosted_video',
2553 'selfhosted_audio',
2554 'spreaker',
2555 'google_photos'
2556 ],
2557 ],
2558 ]
2559 );
2560
2561
2562 $this->add_control(
2563 'orderby',
2564 [
2565 'type' => \Elementor\Controls_Manager::SELECT,
2566 'label' => esc_html__('Order By', 'embedpress'),
2567 'options' => [
2568 'asc' => esc_html__('Oldest', 'embedpress'),
2569 'desc' => esc_html__('Newest', 'embedpress'),
2570 ],
2571 'default' => 'desc',
2572 'condition' => [
2573 'embedpress_pro_embeded_nft_type' => ['collection'],
2574 'embedpress_pro_embeded_source!' => [
2575 'default',
2576 'youtube',
2577 'vimeo',
2578 'dailymotion',
2579 'wistia',
2580 'meetup',
2581 'twitch',
2582 'soundcloud',
2583 'instafeed',
2584 'calendly',
2585 'selfhosted_video',
2586 'selfhosted_audio',
2587 'spreaker',
2588 'google_photos'
2589
2590 ],
2591 ],
2592 ]
2593 );
2594 }
2595
2596 public function init_opensea_control_section()
2597 {
2598 $condition = [
2599 'embedpress_pro_embeded_source' => 'opensea',
2600 ];
2601
2602 $this->start_controls_section(
2603 'embedpress_opensea_control_section',
2604 [
2605 'label' => __('OpenSea Control Settings', 'embedpress'),
2606 'condition' => $condition,
2607 ]
2608 );
2609
2610 $this->add_control(
2611 'opense_important_note_single',
2612 [
2613 'type' => \Elementor\Controls_Manager::RAW_HTML,
2614 'raw' => esc_html__('These options take effect only when a Opensea Single Asset is embedded.', 'embedpress'),
2615 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
2616 'condition' => [
2617 'embedpress_pro_embeded_nft_type' => 'single'
2618 ],
2619
2620 ]
2621 );
2622 $this->add_control(
2623 'opense_important_note_collection',
2624 [
2625 'type' => \Elementor\Controls_Manager::RAW_HTML,
2626 'raw' => esc_html__('These options take effect only when a Opensea Collection is embedded.', 'embedpress'),
2627 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
2628 'condition' => [
2629 'embedpress_pro_embeded_nft_type' => 'collection'
2630 ],
2631 ]
2632 );
2633
2634 $this->add_control(
2635 'layout',
2636 [
2637 'label' => __('Layout', 'embedpress'),
2638 'type' => \Elementor\Controls_Manager::SELECT,
2639 'label_block' => false,
2640 'default' => 'ep-grid',
2641 'options' => [
2642 'ep-grid' => esc_html__('Grid', 'embedpress'),
2643 'ep-list' => esc_html__('List', 'embedpress'),
2644 ],
2645 'conditions' => [
2646 'terms' => [
2647 [
2648 'name' => 'embedpress_pro_embeded_nft_type',
2649 'operator' => '===',
2650 'value' => 'collection',
2651 ],
2652 ],
2653 ]
2654
2655 ]
2656 );
2657
2658
2659 $this->add_control(
2660 'preset',
2661 [
2662 'label' => __('Preset', 'embedpress'),
2663 'type' => \Elementor\Controls_Manager::SELECT,
2664 'label_block' => false,
2665 'default' => 'ep-preset-1',
2666 'options' => [
2667 'ep-preset-1' => esc_html__('Preset 1', 'embedpress'),
2668 'ep-preset-2' => esc_html__('Preset 2', 'embedpress'),
2669 ],
2670 'conditions' => [
2671 'terms' => [
2672 [
2673 'name' => 'embedpress_pro_embeded_nft_type',
2674 'operator' => '===',
2675 'value' => 'collection',
2676 'relation' => 'and'
2677 ],
2678 [
2679 'name' => 'layout',
2680 'operator' => '===',
2681 'value' => 'ep-grid',
2682 'relation' => 'and'
2683 ],
2684 ],
2685 ]
2686
2687 ]
2688 );
2689
2690 $this->add_control(
2691 'nftperrow',
2692 [
2693 'label' => __('Column', 'embedpress'),
2694 'type' => \Elementor\Controls_Manager::SELECT,
2695 'label_block' => false,
2696 'default' => '3',
2697 'options' => [
2698 '1' => esc_html__('1', 'embedpress'),
2699 '2' => esc_html__('2', 'embedpress'),
2700 '3' => esc_html__('3', 'embedpress'),
2701 '4' => esc_html__('4', 'embedpress'),
2702 '5' => esc_html__('5', 'embedpress'),
2703 '6' => esc_html__('6', 'embedpress'),
2704 'auto' => esc_html__('Auto', 'embedpress'),
2705 ],
2706 'condition' => [
2707 'embedpress_pro_embeded_nft_type' => ['collection']
2708 ],
2709
2710 ]
2711 );
2712
2713 $this->add_control(
2714 'gapbetweenitem',
2715 [
2716 'label' => esc_html__('Gap Between Item', 'embedpress'),
2717 'type' => \Elementor\Controls_Manager::SLIDER,
2718 'size_units' => ['px'],
2719 'range' => [
2720 'px' => [
2721 'min' => 1,
2722 'max' => 100,
2723 'step' => 1,
2724 ],
2725 ],
2726 'default' => [
2727 'unit' => 'px',
2728 'size' => 15,
2729 ],
2730 'condition' => [
2731 'embedpress_pro_embeded_nft_type' => ['collection']
2732 ],
2733 ]
2734 );
2735
2736 $this->add_control(
2737 'collectionname',
2738 [
2739 'label' => __('Collection Name', 'embedpress'),
2740 'type' => Controls_Manager::SWITCHER,
2741 'label_block' => false,
2742 'return_value' => 'yes',
2743 'label_off' => __('Hide', 'embedpress'),
2744 'label_on' => __('Show', 'embedpress'),
2745 'default' => 'yes',
2746 'condition' => [
2747 'embedpress_pro_embeded_nft_type' => 'single'
2748 ],
2749 ]
2750 );
2751 $this->add_control(
2752 'nftimage',
2753 [
2754 'label' => __('Thumbnail', 'embedpress'),
2755 'type' => Controls_Manager::SWITCHER,
2756 'label_block' => false,
2757 'return_value' => 'yes',
2758 'label_off' => __('Hide', 'embedpress'),
2759 'label_on' => __('Show', 'embedpress'),
2760 'default' => 'yes',
2761 'condition' => $condition,
2762 ]
2763 );
2764 $this->add_control(
2765 'nfttitle',
2766 [
2767 'label' => __('Title', 'embedpress'),
2768 'type' => Controls_Manager::SWITCHER,
2769 'label_block' => false,
2770 'return_value' => 'yes',
2771 'default' => '',
2772 'label_off' => __('Hide', 'embedpress'),
2773 'label_on' => __('Show', 'embedpress'),
2774 'default' => 'yes',
2775 'condition' => $condition,
2776 ]
2777 );
2778 $this->add_control(
2779 'nftcreator',
2780 [
2781 'label' => __('Creator', 'embedpress'),
2782 'type' => Controls_Manager::SWITCHER,
2783 'label_block' => false,
2784 'return_value' => 'yes',
2785 'default' => '',
2786 'label_off' => __('Hide', 'embedpress'),
2787 'label_on' => __('Show', 'embedpress'),
2788 'default' => 'yes',
2789 'condition' => $condition,
2790 ]
2791 );
2792
2793 $this->add_control(
2794 'prefix_nftcreator',
2795 [
2796 'label' => sprintf(__('Prefix %s', 'embedpress'), $this->pro_text),
2797 'type' => \Elementor\Controls_Manager::TEXT,
2798 'default' => esc_html__('Created By', 'embedpress'),
2799 'placeholder' => esc_html__('Created By', 'embedpress'),
2800 'classes' => $this->pro_class,
2801 'condition' => [
2802 'nftcreator' => 'yes',
2803 ]
2804 ]
2805 );
2806
2807 $this->add_control(
2808 'nftprice',
2809 [
2810 'label' => __('Current Price', 'embedpress'),
2811 'type' => Controls_Manager::SWITCHER,
2812 'label_block' => false,
2813 'return_value' => 'yes',
2814 'default' => '',
2815 'label_off' => __('Hide', 'embedpress'),
2816 'label_on' => __('Show', 'embedpress'),
2817 'default' => 'yes',
2818 'condition' => $condition,
2819 ]
2820 );
2821
2822 $this->add_control(
2823 'prefix_nftprice',
2824 [
2825 'label' => sprintf(__('Prefix %s', 'embedpress'), $this->pro_text),
2826 'type' => \Elementor\Controls_Manager::TEXT,
2827 'default' => esc_html__('Current Price', 'embedpress'),
2828 'placeholder' => esc_html__('Current Price', 'embedpress'),
2829 'classes' => $this->pro_class,
2830 'condition' => [
2831 'nftprice' => 'yes',
2832 ]
2833 ]
2834 );
2835
2836 $this->add_control(
2837 'nftlastsale',
2838 [
2839 'label' => __('Last Sale', 'embedpress'),
2840 'type' => Controls_Manager::SWITCHER,
2841 'label_block' => false,
2842 'return_value' => 'yes',
2843 'default' => '',
2844 'label_off' => __('Hide', 'embedpress'),
2845 'label_on' => __('Show', 'embedpress'),
2846 'default' => 'yes',
2847 'condition' => $condition,
2848 ]
2849 );
2850
2851 $this->add_control(
2852 'prefix_nftlastsale',
2853 [
2854 'label' => sprintf(__('Prefix %s', 'embedpress'), $this->pro_text),
2855 'type' => \Elementor\Controls_Manager::TEXT,
2856 'default' => esc_html__('Last Sale', 'embedpress'),
2857 'placeholder' => esc_html__('Last Sale', 'embedpress'),
2858 'classes' => $this->pro_class,
2859 'condition' => [
2860 'nftlastsale' => 'yes',
2861 ]
2862 ]
2863 );
2864
2865 $this->add_control(
2866 'nftbutton',
2867 [
2868 'label' => __('Button', 'embedpress'),
2869 'type' => Controls_Manager::SWITCHER,
2870 'label_block' => false,
2871 'return_value' => 'yes',
2872 'default' => '',
2873 'label_off' => __('Hide', 'embedpress'),
2874 'label_on' => __('Show', 'embedpress'),
2875 'default' => 'yes',
2876 'condition' => $condition,
2877 ]
2878 );
2879 $this->add_control(
2880 'label_nftbutton',
2881 [
2882 'label' => sprintf(__('Button Label %s', 'embedpress'), $this->pro_text),
2883 'type' => \Elementor\Controls_Manager::TEXT,
2884 'default' => esc_html__('See Details', 'embedpress'),
2885 'placeholder' => esc_html__('See Details', 'embedpress'),
2886 'classes' => $this->pro_class,
2887 'condition' => [
2888 'nftbutton' => 'yes',
2889 ]
2890 ]
2891 );
2892
2893 $this->add_control(
2894 'loadmore',
2895 [
2896 'label' => sprintf(__('Load More %s', 'embedpress'), $this->pro_text),
2897 'type' => Controls_Manager::SWITCHER,
2898 'label_block' => false,
2899 'return_value' => 'yes',
2900 'default' => '',
2901 'label_off' => __('Hide', 'embedpress'),
2902 'label_on' => __('Show', 'embedpress'),
2903 'default' => '',
2904 'classes' => $this->pro_class,
2905 'condition' => [
2906 'embedpress_pro_embeded_nft_type' => ['collection']
2907 ],
2908 ]
2909 );
2910 $this->add_control(
2911 'itemperpage',
2912 [
2913 'type' => \Elementor\Controls_Manager::NUMBER,
2914 'label' => esc_html__('Item Per Page', 'embedpress'),
2915 'placeholder' => '9',
2916 'min' => 1,
2917 'max' => 100,
2918 'step' => 1,
2919 'default' => 9,
2920 'condition' => [
2921 'loadmore' => 'yes'
2922 ],
2923 ]
2924 );
2925 $this->add_control(
2926 'loadmorelabel',
2927 [
2928 'type' => \Elementor\Controls_Manager::TEXT,
2929 'label' => esc_html__('Load More Label', 'embedpress'),
2930 'placeholder' => 'Load More',
2931 'default' => 'Load More',
2932 'condition' => [
2933 'loadmore' => 'yes'
2934 ],
2935 ]
2936 );
2937
2938 $this->add_control(
2939 'nftrank',
2940 [
2941 'label' => __('Rank', 'embedpress'),
2942 'type' => Controls_Manager::SWITCHER,
2943 'label_block' => false,
2944 'return_value' => 'yes',
2945 'label_off' => __('Hide', 'embedpress'),
2946 'label_on' => __('Show', 'embedpress'),
2947 'default' => 'yes',
2948 'condition' => [
2949 'embedpress_pro_embeded_nft_type' => 'single'
2950 ],
2951 ]
2952 );
2953 $this->add_control(
2954 'label_nftrank',
2955 [
2956 'label' => sprintf(__('Rank Label %s', 'embedpress'), $this->pro_text),
2957 'type' => \Elementor\Controls_Manager::TEXT,
2958 'default' => esc_html__('Rank', 'embedpress'),
2959 'placeholder' => esc_html__('Rank', 'embedpress'),
2960 'classes' => $this->pro_class,
2961 'condition' => [
2962 'nftrank' => 'yes',
2963 'embedpress_pro_embeded_nft_type!' => 'collection'
2964 ]
2965 ]
2966 );
2967
2968 $this->add_control(
2969 'nftdetails',
2970 [
2971 'label' => __('Details', 'embedpress'),
2972 'type' => Controls_Manager::SWITCHER,
2973 'label_block' => false,
2974 'return_value' => 'yes',
2975 'label_off' => __('Hide', 'embedpress'),
2976 'label_on' => __('Show', 'embedpress'),
2977 'default' => 'yes',
2978 'condition' => [
2979 'embedpress_pro_embeded_nft_type' => 'single'
2980 ],
2981 ]
2982 );
2983
2984 $this->add_control(
2985 'label_nftdetails',
2986 [
2987 'label' => sprintf(__('Details Label %s', 'embedpress'), $this->pro_text),
2988 'type' => \Elementor\Controls_Manager::TEXT,
2989 'default' => esc_html__('Details', 'embedpress'),
2990 'placeholder' => esc_html__('Details', 'embedpress'),
2991 'classes' => $this->pro_class,
2992 'condition' => [
2993 'nftdetails' => 'yes',
2994 'embedpress_pro_embeded_nft_type!' => 'collection'
2995 ]
2996 ]
2997 );
2998
2999 $this->end_controls_section();
3000 }
3001
3002 public function init_opensea_color_and_typography()
3003 {
3004 $condition = [
3005 'embedpress_pro_embeded_source' => 'opensea',
3006 ];
3007
3008 $this->start_controls_section(
3009 'embedpress_color_typography_control_section',
3010 [
3011 'label' => __('Color and Typography', 'embedpress'),
3012 'tab' => Controls_Manager::TAB_STYLE,
3013 'condition' => $condition,
3014 ]
3015 );
3016
3017 $this->add_control(
3018 'opense_color_important_note_single',
3019 [
3020 'type' => \Elementor\Controls_Manager::RAW_HTML,
3021 'raw' => esc_html__('These options take effect only when a Opensea Single Asset is embedded.', 'embedpress'),
3022 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
3023 'condition' => [
3024 'embedpress_pro_embeded_nft_type' => 'single'
3025 ],
3026
3027 ]
3028 );
3029 $this->add_control(
3030 'opense_color_important_note_collection',
3031 [
3032 'type' => \Elementor\Controls_Manager::RAW_HTML,
3033 'raw' => esc_html__('These options take effect only when a Opensea Collection is embedded.', 'embedpress'),
3034 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
3035 'condition' => [
3036 'embedpress_pro_embeded_nft_type' => 'collection'
3037 ],
3038 ]
3039 );
3040
3041
3042 $this->add_control(
3043 'item_heading',
3044 [
3045 'label' => esc_html__('Item', 'embedpress'),
3046 'type' => \Elementor\Controls_Manager::HEADING,
3047 'separator' => 'before',
3048 ]
3049 );
3050
3051 $this->add_control(
3052 'nft_item_background_color',
3053 [
3054 'label' => esc_html__('Background Color', 'embedpress'),
3055 'type' => \Elementor\Controls_Manager::COLOR,
3056 'selectors' => [
3057 '{{WRAPPER}} .ep_nft_content_wrap .ep_nft_item' => 'background-color: {{VALUE}}',
3058 ],
3059 ]
3060 );
3061
3062 $this->add_control(
3063 'collectionname_heading',
3064 [
3065 'label' => esc_html__('Collection Name', 'embedpress'),
3066 'type' => \Elementor\Controls_Manager::HEADING,
3067 'separator' => 'before',
3068 ]
3069 );
3070
3071 $this->add_control(
3072 'nft_collectionname_color',
3073 [
3074 'label' => esc_html__('Color', 'embedpress'),
3075 'type' => \Elementor\Controls_Manager::COLOR,
3076 'selectors' => [
3077 '{{WRAPPER}} .ep-nft-single-item-wraper a.CollectionLink--link' => 'color: {{VALUE}}',
3078 ],
3079 ]
3080 );
3081 $this->add_control(
3082 'nft_collectionname_hover_color',
3083 [
3084 'label' => esc_html__('Hove Color', 'embedpress'),
3085 'type' => \Elementor\Controls_Manager::COLOR,
3086 'selectors' => [
3087 '{{WRAPPER}} .ep-nft-single-item-wraper a.CollectionLink--link:hover' => 'color: {{VALUE}}',
3088 ],
3089 ]
3090 );
3091 $this->add_group_control(
3092 \Elementor\Group_Control_Typography::get_type(),
3093 [
3094 'name' => 'nft_collectionname_typography',
3095 'selector' => '{{WRAPPER}} .ep-nft-single-item-wraper a.CollectionLink--link',
3096 ]
3097 );
3098
3099 $this->add_control(
3100 'title_heading',
3101 [
3102 'label' => esc_html__('Title', 'embedpress'),
3103 'type' => \Elementor\Controls_Manager::HEADING,
3104 'separator' => 'before',
3105 ]
3106 );
3107
3108 $this->add_control(
3109 'nft_title_color',
3110 [
3111 'label' => esc_html__('Color', 'embedpress'),
3112 'type' => \Elementor\Controls_Manager::COLOR,
3113 'selectors' => [
3114 '{{WRAPPER}} .ep_nft_title' => 'color: {{VALUE}}',
3115 ],
3116 ]
3117 );
3118 $this->add_group_control(
3119 \Elementor\Group_Control_Typography::get_type(),
3120 [
3121 'name' => 'nft_title_typography',
3122 'selector' => '{{WRAPPER}} .ep_nft_title',
3123 ]
3124 );
3125
3126
3127 $this->add_control(
3128 'creator_heading',
3129 [
3130 'label' => esc_html__('Creator', 'embedpress'),
3131 'type' => \Elementor\Controls_Manager::HEADING,
3132 'separator' => 'before',
3133 ]
3134 );
3135
3136 $this->add_control(
3137 'nft_creator_color',
3138 [
3139 'label' => esc_html__('Color', 'embedpress'),
3140 'type' => \Elementor\Controls_Manager::COLOR,
3141 'selectors' => [
3142 '{{WRAPPER}} .ep_nft_creator span' => 'color: {{VALUE}}',
3143 ],
3144 ]
3145 );
3146 $this->add_group_control(
3147 \Elementor\Group_Control_Typography::get_type(),
3148 [
3149 'name' => 'nft_creator_typography',
3150 'selector' => '{{WRAPPER}} .ep_nft_creator span',
3151 ]
3152 );
3153
3154 $this->add_control(
3155 'nft_created_by_color',
3156 [
3157 'label' => esc_html__('Link Color', 'embedpress'),
3158 'type' => \Elementor\Controls_Manager::COLOR,
3159 'selectors' => [
3160 '{{WRAPPER}} .ep_nft_creator span a' => 'color: {{VALUE}}',
3161 ],
3162 ]
3163 );
3164 $this->add_group_control(
3165 \Elementor\Group_Control_Typography::get_type(),
3166 [
3167 'label' => esc_html__('Link Typography', 'embedpress'),
3168 'name' => 'nft_created_by_typography',
3169 'selector' => '{{WRAPPER}} .ep_nft_creator span a',
3170 ]
3171 );
3172
3173 $this->add_control(
3174 'price_heading',
3175 [
3176 'label' => esc_html__('Current Price', 'embedpress'),
3177 'type' => \Elementor\Controls_Manager::HEADING,
3178 'separator' => 'before',
3179 ]
3180 );
3181
3182 $this->add_control(
3183 'nft_price_color',
3184 [
3185 'label' => esc_html__('Color', 'embedpress'),
3186 'type' => \Elementor\Controls_Manager::COLOR,
3187 'selectors' => [
3188 '{{WRAPPER}} .ep_current_price span' => 'color: {{VALUE}}',
3189 ],
3190 ]
3191 );
3192
3193 $this->add_group_control(
3194 \Elementor\Group_Control_Typography::get_type(),
3195 [
3196 'name' => 'nft_price_typography',
3197 'selector' => '{{WRAPPER}} .ep_current_price span',
3198 ]
3199 );
3200 $this->add_control(
3201 'last_sale_heading',
3202 [
3203 'label' => esc_html__('Last Sale Price', 'embedpress'),
3204 'type' => \Elementor\Controls_Manager::HEADING,
3205 'separator' => 'before',
3206 ]
3207 );
3208
3209 $this->add_control(
3210 'nft_last_sale_color',
3211 [
3212 'label' => esc_html__('Color', 'embedpress'),
3213 'type' => \Elementor\Controls_Manager::COLOR,
3214 'selectors' => [
3215 '{{WRAPPER}} .ep_nft_last_sale span' => 'color: {{VALUE}}',
3216 ],
3217 ]
3218 );
3219 $this->add_group_control(
3220 \Elementor\Group_Control_Typography::get_type(),
3221 [
3222 'name' => 'nft_last_sale_typography',
3223 'selector' => '{{WRAPPER}} .ep_nft_last_sale span',
3224 ]
3225 );
3226 $this->add_control(
3227 'nftbutton_heading',
3228 [
3229 'label' => esc_html__('Button', 'embedpress'),
3230 'type' => \Elementor\Controls_Manager::HEADING,
3231 'separator' => 'before',
3232 ]
3233 );
3234
3235
3236 $this->add_control(
3237 'nftbutton_color',
3238 [
3239 'label' => esc_html__('Color', 'embedpress'),
3240 'type' => \Elementor\Controls_Manager::COLOR,
3241 'selectors' => [
3242 '{{WRAPPER}} .ep-nft-gallery-wrapper.ep-nft-gallery-r1a5mbx .ep_nft_button a' => 'color: {{VALUE}}',
3243 ],
3244 ]
3245 );
3246 $this->add_control(
3247 'nftbutton_bg_color',
3248 [
3249 'label' => esc_html__('Background Color', 'embedpress'),
3250 'type' => \Elementor\Controls_Manager::COLOR,
3251 'selectors' => [
3252 '{{WRAPPER}} .ep-nft-gallery-wrapper.ep-nft-gallery-r1a5mbx .ep_nft_button a' => 'background-color: {{VALUE}}',
3253 ],
3254 ]
3255 );
3256 $this->add_group_control(
3257 \Elementor\Group_Control_Typography::get_type(),
3258 [
3259 'name' => 'nftbutton_typography',
3260 'selector' => '{{WRAPPER}} .ep-nft-gallery-wrapper.ep-nft-gallery-r1a5mbx .ep_nft_button a',
3261 ]
3262 );
3263 $this->add_control(
3264 'nft_loadmore_style',
3265 [
3266 'label' => esc_html__('Load More', 'embedpress'),
3267 'type' => \Elementor\Controls_Manager::HEADING,
3268 'separator' => 'before',
3269 'condition' => [
3270 'loadmore' => 'yes',
3271 'embedpress_pro_embeded_nft_type' => 'collection'
3272 ]
3273 ]
3274 );
3275
3276 $this->add_control(
3277 'nft_loadmore_color',
3278 [
3279 'label' => esc_html__('Text Color', 'embedpress'),
3280 'type' => \Elementor\Controls_Manager::COLOR,
3281 'selectors' => [
3282 '{{WRAPPER}} .nft-loadmore' => 'color: {{VALUE}}!important;',
3283 '{{WRAPPER}} .nft-loadmore svg' => 'fill: {{VALUE}}!important;',
3284 ],
3285 'condition' => [
3286 'loadmore' => 'yes',
3287 'embedpress_pro_embeded_nft_type' => 'collection'
3288 ]
3289 ]
3290 );
3291 $this->add_group_control(
3292 \Elementor\Group_Control_Typography::get_type(),
3293 [
3294 'name' => 'nft_loadmore_typography',
3295 'selector' => '{{WRAPPER}} .nft-loadmore, {{WRAPPER}} .nft-loadmore svg',
3296 'condition' => [
3297 'loadmore' => 'yes',
3298 'embedpress_pro_embeded_nft_type' => 'collection'
3299 ]
3300 ]
3301 );
3302 $this->add_control(
3303 'nft_loadmore_bgcolor',
3304 [
3305 'label' => esc_html__('Background Color', 'embedpress'),
3306 'type' => \Elementor\Controls_Manager::COLOR,
3307 'selectors' => [
3308 '{{WRAPPER}} .nft-loadmore' => 'background-color: {{VALUE}}!important;',
3309 ],
3310 'condition' => [
3311 'loadmore' => 'yes',
3312 'embedpress_pro_embeded_nft_type' => 'collection'
3313 ]
3314 ]
3315 );
3316
3317 $this->add_control(
3318 'nftrank_heading',
3319 [
3320 'label' => esc_html__('Rank', 'embedpress'),
3321 'type' => \Elementor\Controls_Manager::HEADING,
3322 'separator' => 'before',
3323 'condition' => [
3324 'nftrank' => 'yes',
3325 'embedpress_pro_embeded_nft_type!' => 'collection'
3326 ]
3327 ]
3328 );
3329
3330 $this->add_control(
3331 'nftrank_label_color',
3332 [
3333 'label' => esc_html__('Label Color', 'embedpress'),
3334 'type' => \Elementor\Controls_Manager::COLOR,
3335 'selectors' => [
3336 '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper' => 'color: {{VALUE}}!important;',
3337 ],
3338 'condition' => [
3339 'nftrank' => 'yes',
3340 'embedpress_pro_embeded_nft_type!' => 'collection'
3341 ]
3342 ]
3343 );
3344 $this->add_group_control(
3345 \Elementor\Group_Control_Typography::get_type(),
3346 [
3347 'name' => 'nftrank_label_typography',
3348 'selector' => '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper ',
3349 'condition' => [
3350 'nftrank' => 'yes',
3351 'embedpress_pro_embeded_nft_type!' => 'collection'
3352 ]
3353 ]
3354 );
3355 $this->add_control(
3356 'nftrank_color',
3357 [
3358 'label' => esc_html__('Rank Color', 'embedpress'),
3359 'type' => \Elementor\Controls_Manager::COLOR,
3360 'selectors' => [
3361 '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper span.ep-nft-rank' => 'color: {{VALUE}}!important;',
3362 ],
3363 'condition' => [
3364 'nftrank' => 'yes',
3365 'embedpress_pro_embeded_nft_type!' => 'collection'
3366 ]
3367 ]
3368 );
3369 $this->add_control(
3370 'nftrank_border_color',
3371 [
3372 'label' => esc_html__('Border Color', 'embedpress'),
3373 'type' => \Elementor\Controls_Manager::COLOR,
3374 'selectors' => [
3375 '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper span.ep-nft-rank' => 'border-color: {{VALUE}}!important',
3376 ],
3377 'condition' => [
3378 'nftrank' => 'yes',
3379 'embedpress_pro_embeded_nft_type!' => 'collection'
3380 ]
3381 ]
3382 );
3383 $this->add_group_control(
3384 \Elementor\Group_Control_Typography::get_type(),
3385 [
3386 'name' => 'nftrank_typography',
3387 'selector' => '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper span.ep-nft-rank',
3388 'condition' => [
3389 'nftrank' => 'yes',
3390 'embedpress_pro_embeded_nft_type!' => 'collection'
3391 ]
3392 ]
3393 );
3394
3395
3396
3397 $this->add_control(
3398 'nftdetails_heading',
3399 [
3400 'label' => esc_html__('Details', 'embedpress'),
3401 'type' => \Elementor\Controls_Manager::HEADING,
3402 'separator' => 'before',
3403 'condition' => [
3404 'nftrank' => 'yes',
3405 'embedpress_pro_embeded_nft_type!' => 'collection'
3406 ]
3407 ]
3408 );
3409
3410 $this->add_control(
3411 'nftdetail_title_color',
3412 [
3413 'label' => esc_html__('Title Color', 'embedpress'),
3414 'type' => \Elementor\Controls_Manager::COLOR,
3415 'selectors' => [
3416 '{{WRAPPER}} .ep-title' => 'color: {{VALUE}}',
3417 ],
3418 'condition' => [
3419 'nftrank' => 'yes',
3420 'embedpress_pro_embeded_nft_type!' => 'collection'
3421 ]
3422 ]
3423 );
3424 $this->add_group_control(
3425 \Elementor\Group_Control_Typography::get_type(),
3426 [
3427 'label' => esc_html__('Title Typography', 'embedpress'),
3428 'name' => 'nftdetail_title_typography',
3429 'selector' => '{{WRAPPER}} .ep-title',
3430 'condition' => [
3431 'nftrank' => 'yes',
3432 'embedpress_pro_embeded_nft_type!' => 'collection'
3433 ]
3434 ]
3435 );
3436
3437 $this->add_control(
3438 'nftdetail_color',
3439 [
3440 'label' => esc_html__('Content Color', 'embedpress'),
3441 'type' => \Elementor\Controls_Manager::COLOR,
3442 'selectors' => [
3443 '{{WRAPPER}} .ep-asset-detail-item' => 'color: {{VALUE}}',
3444 ],
3445 'condition' => [
3446 'nftrank' => 'yes',
3447 'embedpress_pro_embeded_nft_type!' => 'collection'
3448 ]
3449 ]
3450 );
3451 $this->add_group_control(
3452 \Elementor\Group_Control_Typography::get_type(),
3453 [
3454 'label' => esc_html__('Content Typography', 'embedpress'),
3455 'name' => 'nftdetail_typography',
3456 'selector' => '{{WRAPPER}} .ep-asset-detail-item',
3457 'condition' => [
3458 'nftrank' => 'yes',
3459 'embedpress_pro_embeded_nft_type!' => 'collection'
3460 ]
3461 ]
3462 );
3463
3464 $this->add_control(
3465 'nftdetail_link_color',
3466 [
3467 'label' => esc_html__('Link Color', 'embedpress'),
3468 'type' => \Elementor\Controls_Manager::COLOR,
3469 'selectors' => [
3470 '{{WRAPPER}} .ep-asset-detail-item a' => 'color: {{VALUE}}',
3471 ],
3472 'condition' => [
3473 'nftrank' => 'yes',
3474 'embedpress_pro_embeded_nft_type!' => 'collection'
3475 ]
3476 ]
3477 );
3478 $this->add_group_control(
3479 \Elementor\Group_Control_Typography::get_type(),
3480 [
3481 'name' => 'nftdetail_link_typography',
3482 'selector' => '{{WRAPPER}} .ep-asset-detail-item a, .ep-asset-detail-item',
3483 'condition' => [
3484 'nftrank' => 'yes',
3485 'embedpress_pro_embeded_nft_type!' => 'collection'
3486 ]
3487 ]
3488 );
3489
3490
3491 $this->end_controls_section();
3492 }
3493
3494 //End OpenSea controls
3495
3496
3497
3498 /**
3499 * Instagram Feed Controls
3500 */
3501 public function init_instafeed_control()
3502 {
3503 $condition = [
3504 'embedpress_pro_embeded_source' => 'instafeed'
3505 ];
3506 $disableAi = [
3507 'active' => false,
3508 ];
3509
3510 $this->add_control(
3511 'instaLayout',
3512 [
3513 'type' => \Elementor\Controls_Manager::SELECT,
3514 'label' => esc_html__('Layout', 'embedpress'),
3515 'options' => [
3516 'insta-grid' => esc_html__('Grid', 'embedpress'),
3517 'insta-masonry' => sprintf(__('Masonry%s', 'embedpress'), $this->pro_label),
3518 'insta-carousel' => sprintf(__('Carousel%s', 'embedpress'), $this->pro_label),
3519 'insta-justify' => sprintf(__('Justify%s', 'embedpress'), $this->pro_label),
3520 ],
3521 'default' => 'insta-grid',
3522 'condition' => $condition,
3523 ]
3524 );
3525
3526 if (!apply_filters('embedpress/is_allow_rander', false)) {
3527 $this->add_control(
3528 'embedpress_insta_layout__pro_enable_warning',
3529 [
3530 'label' => sprintf(
3531 '<a style="color: red" target="_blank" href="https://wpdeveloper.com/in/upgrade-embedpress">%s</a>',
3532 esc_html__('Only Available in Pro Version!', 'essential-addons-for-elementor-lite')
3533 ),
3534 'type' => Controls_Manager::RAW_HTML,
3535 'condition' => [
3536 'instaLayout' => ['insta-masonry', 'insta-carousel'],
3537 ],
3538 ]
3539 );
3540 }
3541
3542 $this->add_control(
3543 'instafeedColumns',
3544 [
3545 'label' => __('Column', 'embedpress'),
3546 'type' => \Elementor\Controls_Manager::SELECT,
3547 'label_block' => false,
3548 'default' => '3',
3549 'options' => [
3550 '2' => esc_html__('2', 'embedpress'),
3551 '3' => esc_html__('3', 'embedpress'),
3552 '4' => esc_html__('4', 'embedpress'),
3553 '6' => esc_html__('6', 'embedpress'),
3554 'auto' => esc_html__('Auto', 'embedpress'),
3555 ],
3556 'condition' => [
3557 'instaLayout' => ['insta-grid', 'insta-masonry'],
3558 'embedpress_pro_embeded_source' => 'instafeed'
3559 ],
3560 ]
3561 );
3562
3563 $this->add_control(
3564 'instafeedColumnsGap',
3565 [
3566 'label' => esc_html__('Column Gap', 'embedpress'),
3567 'type' => \Elementor\Controls_Manager::NUMBER,
3568 'min' => 0,
3569 'max' => 100,
3570 'step' => 1,
3571 'default' => 5,
3572 'condition' => [
3573 'instaLayout' => ['insta-masonry', 'insta-grid'],
3574 ],
3575 ]
3576 );
3577
3578 $this->add_control(
3579 'embedpress_instafeed_slide_show',
3580 [
3581 'type' => \Elementor\Controls_Manager::SELECT,
3582 'label' => esc_html__('Slides to Show', 'embedpress'),
3583 'options' => [
3584 '1' => esc_html__('1', 'embedpress'),
3585 '2' => esc_html__('2', 'embedpress'),
3586 '3' => esc_html__('3', 'embedpress'),
3587 '4' => esc_html__('4', 'embedpress'),
3588 '5' => esc_html__('5', 'embedpress'),
3589 '6' => esc_html__('6', 'embedpress'),
3590 '7' => esc_html__('7', 'embedpress'),
3591 '8' => esc_html__('8', 'embedpress'),
3592 '9' => esc_html__('9', 'embedpress'),
3593 '10' => esc_html__('10', 'embedpress'),
3594 ],
3595 'default' => '5',
3596 'condition' => [
3597 'embedpress_pro_embeded_source' => 'instafeed',
3598 'instaLayout' => 'insta-carousel'
3599 ],
3600 ]
3601 );
3602
3603 $this->add_control(
3604 'embedpress_carousel_autoplay',
3605 [
3606 'label' => __('Auto Play', 'embedpress'),
3607 'type' => Controls_Manager::SWITCHER,
3608 'label_block' => false,
3609 'return_value' => 'yes',
3610 'default' => '',
3611 'condition' => [
3612 'embedpress_pro_embeded_source' => 'instafeed',
3613 'instaLayout' => 'insta-carousel'
3614 ],
3615 ]
3616 );
3617 $this->add_control(
3618 'embedpress_carousel_autoplay_speed',
3619 [
3620 'label' => esc_html__('Autoplay Speed(ms)', 'embedpress'),
3621 'type' => \Elementor\Controls_Manager::NUMBER,
3622 'min' => 0,
3623 'step' => 1,
3624 'default' => 0,
3625 'condition' => [
3626 'embedpress_pro_embeded_source' => 'instafeed',
3627 'instaLayout' => 'insta-carousel'
3628 ],
3629 ]
3630 );
3631 $this->add_control(
3632 'embedpress_carousel_transition_speed',
3633 [
3634 'label' => esc_html__('Transition Speed(ms)', 'embedpress'),
3635 'type' => \Elementor\Controls_Manager::NUMBER,
3636 'min' => 0,
3637 'step' => 1,
3638 'default' => 0,
3639 'condition' => [
3640 'embedpress_pro_embeded_source' => 'instafeed',
3641 'instaLayout' => 'insta-carousel'
3642 ],
3643 ]
3644 );
3645 $this->add_control(
3646 'embedpress_carousel_loop',
3647 [
3648 'label' => __('Loop', 'embedpress'),
3649 'type' => Controls_Manager::SWITCHER,
3650 'label_block' => false,
3651 'return_value' => 'yes',
3652 'default' => 'yes',
3653 'condition' => [
3654 'embedpress_pro_embeded_source' => 'instafeed',
3655 'instaLayout' => 'insta-carousel'
3656 ],
3657 ]
3658 );
3659
3660 $this->add_control(
3661 'embedpress_carousel_arrows',
3662 [
3663 'label' => __('Arrows', 'embedpress'),
3664 'type' => Controls_Manager::SWITCHER,
3665 'label_block' => false,
3666 'return_value' => 'yes',
3667 'default' => 'yes',
3668 'condition' => [
3669 'embedpress_pro_embeded_source' => 'instafeed',
3670 'instaLayout' => 'insta-carousel'
3671 ],
3672 ]
3673 );
3674
3675
3676 $this->add_control(
3677 'embedpress_carousel_spacing',
3678 [
3679 'label' => esc_html__('Spacing', 'embedpress'),
3680 'type' => \Elementor\Controls_Manager::NUMBER,
3681 'min' => 0,
3682 'max' => 100,
3683 'step' => 1,
3684 'default' => 0,
3685 'condition' => [
3686 'embedpress_pro_embeded_source' => 'instafeed',
3687 'instaLayout' => 'insta-carousel'
3688 ],
3689 ]
3690 );
3691
3692 $this->add_control(
3693 'instafeedPostsPerPage',
3694 [
3695 'label' => esc_html__('Posts Per Page', 'embedpress'),
3696 'type' => \Elementor\Controls_Manager::NUMBER,
3697 'min' => 1,
3698 'max' => 100,
3699 'step' => 12,
3700 'default' => 12,
3701 'condition' => [
3702 'embedpress_pro_embeded_source' => 'instafeed',
3703 ],
3704 ]
3705 );
3706
3707 $this->add_control(
3708 'instafeedTab',
3709 [
3710 'label' => sprintf(__('Feed Tab %s', 'embedpress'), $this->pro_text),
3711 'type' => Controls_Manager::SWITCHER,
3712 'classes' => $this->pro_class,
3713 'label_block' => false,
3714 'return_value' => 'yes',
3715 'default' => 'yes',
3716 'condition' => $condition,
3717 ]
3718 );
3719
3720 $this->add_control(
3721 'instafeedLikesCount',
3722 [
3723 'label' => sprintf(__('Like Count %s', 'embedpress'), $this->pro_text),
3724 'type' => Controls_Manager::SWITCHER,
3725 'classes' => $this->pro_class,
3726 'label_block' => false,
3727 'return_value' => 'true',
3728 'default' => 'true',
3729 'condition' => [
3730 'embedpress_pro_embeded_source' => 'instafeed',
3731 ],
3732 ]
3733 );
3734
3735 $this->add_control(
3736 'instafeedCommentsCount',
3737 [
3738 'label' => sprintf(__('Comments Count %s', 'embedpress'), $this->pro_text),
3739 'type' => Controls_Manager::SWITCHER,
3740 'classes' => $this->pro_class,
3741 'label_block' => false,
3742 'return_value' => 'true',
3743 'default' => 'true',
3744 'condition' => [
3745 'embedpress_pro_embeded_source' => 'instafeed',
3746 ],
3747 ]
3748 );
3749
3750
3751 $this->add_control(
3752 'instafeedPopup',
3753 [
3754 'label' => __('Popup', 'embedpress'),
3755 'type' => Controls_Manager::SWITCHER,
3756 'label_block' => false,
3757 'return_value' => 'yes',
3758 'default' => 'yes',
3759 'condition' => $condition,
3760 ]
3761 );
3762
3763 $this->add_control(
3764 'instafeedPopupFollowBtn',
3765 [
3766 'label' => __('Popup Follow Button', 'embedpress'),
3767 'type' => Controls_Manager::SWITCHER,
3768 'label_block' => false,
3769 'return_value' => 'yes',
3770 'default' => 'yes',
3771 'condition' => [
3772 'embedpress_pro_embeded_source' => 'instafeed',
3773 'instafeedPopup' => 'yes'
3774 ],
3775 ]
3776 );
3777
3778 $this->add_control(
3779 'instafeedPopupFollowBtnLabel',
3780 [
3781 'type' => \Elementor\Controls_Manager::TEXT,
3782 'label' => esc_html__('Follow Button Label', 'embedpress'),
3783 'placeholder' => 'Follow',
3784 'default' => 'Follow',
3785 'separator' => 'after',
3786 'condition' => [
3787 'instafeedPopupFollowBtn' => 'yes',
3788 'instafeedPopup' => 'yes',
3789 'embedpress_pro_embeded_source' => 'instafeed'
3790 ],
3791 'ai' => $disableAi
3792 ]
3793 );
3794
3795 $this->add_control(
3796 'instafeedLoadmore',
3797 [
3798 'label' => __('Load More', 'embedpress'),
3799 'type' => Controls_Manager::SWITCHER,
3800 'label_block' => false,
3801 'return_value' => 'yes',
3802 'default' => 'yes',
3803 'condition' => [
3804 'embedpress_pro_embeded_source' => 'instafeed',
3805 'instaLayout!' => 'insta-carousel'
3806 ],
3807 ]
3808 );
3809 $this->add_control(
3810 'instafeedLoadmoreLabel',
3811 [
3812 'type' => \Elementor\Controls_Manager::TEXT,
3813 'label' => esc_html__('Load More Button Label', 'embedpress'),
3814 'placeholder' => 'Load More',
3815 'default' => 'Load More',
3816 'condition' => [
3817 'embedpress_pro_embeded_source' => 'instafeed',
3818 'instafeedLoadmore' => 'yes',
3819 'instaLayout!' => 'insta-carousel'
3820 ],
3821 'ai' => $disableAi
3822 ]
3823 );
3824 }
3825
3826 public function init_instafeed_control_section()
3827 {
3828 $condition = [
3829 'embedpress_pro_embeded_source' => 'instafeed'
3830 ];
3831 $disableAi = [
3832 'active' => false,
3833 ];
3834
3835 $this->start_controls_section(
3836 'embedpress_instafeed_profile_section',
3837 [
3838 'label' => __('Instagram Profile Settings', 'embedpress'),
3839 'condition' => [
3840 'embedpress_pro_embeded_source' => 'instafeed'
3841 ],
3842 ]
3843 );
3844
3845
3846 $this->add_control(
3847 'instafeedProfileImage',
3848 [
3849 'label' => __('Profile Image', 'embedpress'),
3850 'type' => Controls_Manager::SWITCHER,
3851 'label_block' => false,
3852 'return_value' => 'yes',
3853 'default' => 'yes',
3854 'condition' => [
3855 'embedpress_pro_embeded_source' => 'instafeed'
3856 ],
3857 ]
3858 );
3859
3860 $this->add_control(
3861 "instafeedProfileImageUrl",
3862 [
3863 'label' => sprintf(__('Image %s', 'embedpress'), $this->pro_text),
3864 'type' => Controls_Manager::MEDIA,
3865 'classes' => $this->pro_class,
3866 'dynamic' => [
3867 'active' => false,
3868 ],
3869 'condition' => [
3870 'instafeedProfileImage' => 'yes',
3871 'embedpress_pro_embeded_source' => 'instafeed'
3872 ],
3873 'ai' => $disableAi
3874 ]
3875 );
3876
3877
3878 $this->add_control(
3879 'instafeedFollowBtn',
3880 [
3881 'label' => __('Follow Button', 'embedpress'),
3882 'type' => Controls_Manager::SWITCHER,
3883 'label_block' => false,
3884 'return_value' => 'yes',
3885 'default' => 'yes',
3886 'condition' => $condition,
3887 ]
3888 );
3889
3890 $this->add_control(
3891 'instafeedFollowBtnLabel',
3892 [
3893 'label' => sprintf(__('Button Label %s', 'embedpress'), $this->pro_text),
3894 'type' => Controls_Manager::TEXT,
3895 'classes' => $this->pro_class,
3896 'placeholder' => __('Follow', 'embedpress'),
3897 'default' => 'Follow',
3898 'separator' => 'after',
3899 'label_block' => false,
3900 'condition' => [
3901 'instafeedFollowBtn' => 'yes',
3902 'embedpress_pro_embeded_source' => 'instafeed'
3903 ],
3904 'ai' => $disableAi
3905 ]
3906 );
3907
3908 $this->add_control(
3909 'instafeedPostsCount',
3910 [
3911 'label' => __('Posts Count', 'embedpress'),
3912 'type' => Controls_Manager::SWITCHER,
3913 'label_block' => false,
3914 'return_value' => 'yes',
3915 'default' => 'yes',
3916 'condition' => [
3917 'embedpress_pro_embeded_source' => 'instafeed',
3918 'instafeedFeedType!' => 'hashtag_type'
3919 ],
3920 ]
3921 );
3922 $this->add_control(
3923 'instafeedPostsCountText',
3924 [
3925 'label' => __('Count Text', 'embedpress'),
3926 'type' => Controls_Manager::TEXT,
3927 'placeholder' => __('[count] posts', 'embedpress'),
3928 'default' => '[count] posts',
3929 'label_block' => false,
3930 'separator' => 'after',
3931 'condition' => [
3932 'instafeedPostsCount' => 'yes',
3933 'instafeedFeedType!' => 'hashtag_type',
3934 'embedpress_pro_embeded_source' => 'instafeed',
3935 ],
3936 'ai' => $disableAi
3937 ]
3938 );
3939 $this->add_control(
3940 'instafeedFollowersCount',
3941 [
3942 'label' => __('Followers Count', 'embedpress'),
3943 'type' => Controls_Manager::SWITCHER,
3944 'label_block' => false,
3945 'return_value' => 'yes',
3946 'default' => 'yes',
3947 'condition' => [
3948 'instafeedFeedType!' => 'hashtag_type',
3949 'embedpress_pro_embeded_source' => 'instafeed',
3950 ],
3951 ]
3952 );
3953 $this->add_control(
3954 'instafeedFollowersCountText',
3955 [
3956 'label' => __('Count Text', 'embedpress'),
3957 'type' => Controls_Manager::TEXT,
3958 'placeholder' => __('[count] followers', 'embedpress'),
3959 'default' => '[count] followers',
3960 'label_block' => false,
3961 'separator' => 'after',
3962 'condition' => [
3963 'instafeedFollowersCount' => 'yes',
3964 'instafeedFeedType!' => 'hashtag_type',
3965 'embedpress_pro_embeded_source' => 'instafeed'
3966 ],
3967 'ai' => $disableAi
3968 ]
3969 );
3970
3971 $this->add_control(
3972 'instafeedAccName',
3973 [
3974 'label' => __('Account Name', 'embedpress'),
3975 'type' => Controls_Manager::SWITCHER,
3976 'label_block' => false,
3977 'return_value' => 'yes',
3978 'default' => 'yes',
3979 'condition' => [
3980 'instafeedFeedType!' => 'hashtag_type',
3981 'embedpress_pro_embeded_source' => 'instafeed'
3982 ],
3983 ]
3984 );
3985 $this->end_controls_section();
3986
3987 $this->start_controls_section(
3988 'embedpress_instafeed_control_section',
3989 [
3990 'label' => __('Instagram Feed Settings', 'embedpress'),
3991 'condition' => [
3992 'embedpress_pro_embeded_source' => 'instafeed'
3993 ],
3994 ]
3995 );
3996
3997 $this->init_instafeed_control();
3998
3999 $this->end_controls_section();
4000 }
4001
4002
4003 //End Feed Controls
4004
4005
4006 /**
4007 * Calendly Controls
4008 */
4009 public function init_calendly_control_section()
4010 {
4011
4012 $condition = [
4013 'embedpress_pro_embeded_source' => 'calendly',
4014 ];
4015
4016 $this->start_controls_section(
4017 'embedpress_calendly_control_section',
4018 [
4019 'label' => __('Calendly Controls', 'embedpress'),
4020 'condition' => $condition,
4021 ]
4022 );
4023 $this->add_control(
4024 'cEmbedType',
4025 [
4026 'label' => __('Embed Type', 'embedpress'),
4027 'type' => \Elementor\Controls_Manager::SELECT,
4028 'default' => 'inline',
4029 'options' => [
4030 'inline' => __('Inline', 'embedpress'),
4031 'popup_button' => __('Popup Button', 'embedpress'),
4032 ],
4033 'condition' => $condition
4034 ]
4035 );
4036 $this->add_control(
4037 'popupControlsHeadding',
4038 [
4039 'label' => esc_html__('Popup Button Settings', 'embedpress'),
4040 'type' => \Elementor\Controls_Manager::HEADING,
4041 'separator' => 'before',
4042 'condition' => [
4043 'embedpress_pro_embeded_source' => 'calendly',
4044 'cEmbedType' => 'popup_button'
4045 ]
4046 ]
4047 );
4048 $this->add_control(
4049 'cPopupButtonText',
4050 [
4051 'label' => __('Button Text', 'embedpress'),
4052 'type' => \Elementor\Controls_Manager::TEXT,
4053 'label_block' => true,
4054 'default' => 'Schedule time with me',
4055 'condition' => [
4056 'embedpress_pro_embeded_source' => 'calendly',
4057 'cEmbedType' => 'popup_button'
4058 ],
4059 'ai' => [
4060 'active' => false,
4061 ],
4062 ]
4063 );
4064
4065
4066 $this->add_control(
4067 'cPopupButtonTextColor',
4068 [
4069 'label' => __('Text Color', 'embedpress'),
4070 'type' => \Elementor\Controls_Manager::COLOR,
4071 'default' => '#ffffff',
4072 'condition' => [
4073 'embedpress_pro_embeded_source' => 'calendly',
4074 'cEmbedType' => 'popup_button'
4075 ]
4076 ]
4077 );
4078 $this->add_control(
4079 'cPopupButtonBGColor',
4080 [
4081 'label' => __('Background Color', 'embedpress'),
4082 'type' => \Elementor\Controls_Manager::COLOR,
4083 'default' => '#0000FF',
4084 'condition' => [
4085 'embedpress_pro_embeded_source' => 'calendly',
4086 'cEmbedType' => 'popup_button'
4087 ]
4088 ]
4089 );
4090
4091 $this->add_control(
4092 'calendlyControlsHeadding',
4093 [
4094 'label' => esc_html__('Calender Settings', 'embedpress'),
4095 'type' => \Elementor\Controls_Manager::HEADING,
4096 'separator' => 'before',
4097 ]
4098 );
4099
4100 $this->add_control(
4101 'calendlyData',
4102 [
4103 'label' => sprintf(__('Calendly Data %s', 'embedpress'), $this->pro_text),
4104 'type' => \Elementor\Controls_Manager::SWITCHER,
4105 'default' => '',
4106 'classes' => $this->pro_class,
4107 'condition' => $condition
4108 ]
4109 );
4110
4111 $this->add_control(
4112 'calendlyDataLink',
4113 [
4114 'type' => \Elementor\Controls_Manager::RAW_HTML,
4115 '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>',
4116 'condition' => [
4117 'calendlyData' => 'yes'
4118 ]
4119
4120 ]
4121 );
4122
4123 $this->add_control(
4124 'hideCookieBanner',
4125 [
4126 'label' => __('Hide Cookie Banner', 'embedpress'),
4127 'type' => \Elementor\Controls_Manager::SWITCHER,
4128 'default' => '',
4129 'condition' => $condition
4130 ]
4131 );
4132 $this->add_control(
4133 'hideEventTypeDetails',
4134 [
4135 'label' => __('Hide Event Type Details', 'embedpress'),
4136 'type' => \Elementor\Controls_Manager::SWITCHER,
4137 'default' => '',
4138 'condition' => $condition
4139 ]
4140 );
4141
4142 $this->add_control(
4143 'cBackgroundColor',
4144 [
4145 'label' => __('Background Color', 'embedpress'),
4146 'type' => \Elementor\Controls_Manager::COLOR,
4147 'default' => '',
4148 'condition' => $condition
4149 ]
4150 );
4151
4152 $this->add_control(
4153 'cTextColor',
4154 [
4155 'label' => __('Text Color', 'embedpress'),
4156 'type' => \Elementor\Controls_Manager::COLOR,
4157 'default' => '',
4158 'condition' => $condition
4159 ]
4160 );
4161
4162 $this->add_control(
4163 'cButtonLinkColor',
4164 [
4165 'label' => __('Button & Link Color', 'embedpress'),
4166 'type' => \Elementor\Controls_Manager::COLOR,
4167 'default' => '',
4168 'condition' => $condition
4169 ]
4170 );
4171
4172 $this->end_controls_section();
4173 }
4174
4175 //End calendly controlS
4176
4177 /**
4178 * Start Spreaker Controls
4179 */
4180 public function init_spreaker_control_section()
4181 {
4182
4183 $condition = [
4184 'embedpress_pro_embeded_source' => 'spreaker',
4185 ];
4186
4187 $this->start_controls_section(
4188 'embedpress_spreaker_control_section',
4189 [
4190 'label' => __('Spreaker Controls', 'embedpress'),
4191 'condition' => $condition,
4192 ]
4193 );
4194
4195 $this->add_control(
4196 'theme',
4197 [
4198 'label' => __('Theme', 'embedpress'),
4199 'type' => \Elementor\Controls_Manager::SELECT,
4200 'default' => 'light',
4201 'options' => [
4202 'light' => __('Light', 'embedpress'),
4203 'dark' => __('Dark', 'embedpress'),
4204 ],
4205 ]
4206 );
4207
4208 $this->add_control(
4209 'color',
4210 [
4211 'label' => __('Main Color', 'embedpress'),
4212 'type' => \Elementor\Controls_Manager::COLOR,
4213 ]
4214 );
4215
4216 $this->add_control(
4217 "coverImageUrl",
4218 [
4219 'label' => sprintf(__('Cover Image %s', 'embedpress'), $this->pro_text),
4220 'type' => Controls_Manager::MEDIA,
4221 'dynamic' => [
4222 'active' => true,
4223 ],
4224 'classes' => $this->pro_class,
4225
4226 ]
4227 );
4228
4229
4230
4231 $this->add_control(
4232 'hideDownload',
4233 [
4234 'label' => sprintf(__('Disable Download %s', 'embedpress'), $this->pro_text),
4235 'type' => \Elementor\Controls_Manager::SWITCHER,
4236 'label_on' => __('Yes', 'embedpress'),
4237 'label_off' => __('No', 'embedpress'),
4238 'return_value' => 'yes',
4239 'default' => 'no',
4240 'classes' => $this->pro_class,
4241 ]
4242 );
4243
4244 $this->add_control(
4245 'playlist',
4246 [
4247 'label' => __('Enable Playlist', 'embedpress'),
4248 'type' => \Elementor\Controls_Manager::SWITCHER,
4249 'label_on' => __('Yes', 'embedpress'),
4250 'label_off' => __('No', 'embedpress'),
4251 'return_value' => 'yes',
4252 'default' => 'yes',
4253 'description' => __('This option is for podcast playlists and doesn’t affect individual episodes.', 'embedpress'),
4254 ]
4255 );
4256
4257
4258 $this->add_control(
4259 'playlistContinuous',
4260 [
4261 'label' => sprintf(__('Continuous Playlist %s', 'embedpress'), $this->pro_text),
4262 'type' => \Elementor\Controls_Manager::SWITCHER,
4263 'label_on' => __('Yes', 'embedpress'),
4264 'label_off' => __('No', 'embedpress'),
4265 'return_value' => 'yes',
4266 'default' => 'no',
4267 'classes' => $this->pro_class,
4268 'condition' => [
4269 'playlist' => 'yes',
4270 ],
4271 ]
4272 );
4273
4274 $this->add_control(
4275 'playlistLoop',
4276 [
4277 'label' => __('Loop Playlist', 'embedpress'),
4278 'type' => \Elementor\Controls_Manager::SWITCHER,
4279 'label_on' => __('Yes', 'embedpress'),
4280 'label_off' => __('No', 'embedpress'),
4281 'return_value' => 'yes',
4282 'default' => 'yes',
4283 'condition' => [
4284 'playlist' => 'yes',
4285 'playlistContinuous' => 'yes',
4286 ],
4287 ]
4288 );
4289
4290 $this->add_control(
4291 'playlistAutoupdate',
4292 [
4293 'label' => __('Playlist Autoupdate', 'embedpress'),
4294 'type' => \Elementor\Controls_Manager::SWITCHER,
4295 'label_on' => __('Yes', 'embedpress'),
4296 'label_off' => __('No', 'embedpress'),
4297 'return_value' => 'yes',
4298 'default' => 'yes',
4299 'condition' => [
4300 'playlist' => 'yes',
4301 ],
4302 ]
4303 );
4304 $this->add_control(
4305 'hidePlaylistDescriptions',
4306 [
4307 'label' => __('Hide Playlist Descriptions', 'embedpress'),
4308 'type' => \Elementor\Controls_Manager::SWITCHER,
4309 'label_on' => __('Yes', 'embedpress'),
4310 'label_off' => __('No', 'embedpress'),
4311 'return_value' => 'yes',
4312 'default' => 'no',
4313 'condition' => [
4314 'playlist' => 'yes',
4315 ],
4316 ]
4317 );
4318
4319 $this->add_control(
4320 'hidePlaylistImages',
4321 [
4322 'label' => __('Hide Playlist Images', 'embedpress'),
4323 'type' => \Elementor\Controls_Manager::SWITCHER,
4324 'label_on' => __('Yes', 'embedpress'),
4325 'label_off' => __('No', 'embedpress'),
4326 'return_value' => 'yes',
4327 'default' => 'no',
4328 'condition' => [
4329 'playlist' => 'yes',
4330 ],
4331 ]
4332 );
4333
4334 $this->add_control(
4335 'episodeImagePosition',
4336 [
4337 'label' => __('Episode Image Position', 'embedpress'),
4338 'type' => \Elementor\Controls_Manager::SELECT,
4339 'default' => 'right',
4340 'options' => [
4341 'right' => __('Right', 'embedpress'),
4342 'left' => __('Left', 'embedpress'),
4343 ],
4344 'label_block' => true,
4345 ]
4346 );
4347
4348
4349 $this->add_control(
4350 'showChaptersImage',
4351 [
4352 'label' => __('Show Chapters Images', 'embedpress'),
4353 'type' => \Elementor\Controls_Manager::SWITCHER,
4354 'label_on' => __('Yes', 'embedpress'),
4355 'label_off' => __('No', 'embedpress'),
4356 'return_value' => 'yes',
4357 'default' => 'yes',
4358 'description' => __('Only applies if the podcast includes chapter images.', 'embedpress'),
4359 ]
4360 );
4361
4362 $this->add_control(
4363 'hideLikes',
4364 [
4365 'label' => __('Hide Likes', 'embedpress'),
4366 'type' => \Elementor\Controls_Manager::SWITCHER,
4367 'label_on' => __('Yes', 'embedpress'),
4368 'label_off' => __('No', 'embedpress'),
4369 'return_value' => 'yes',
4370 'default' => 'no',
4371 ]
4372 );
4373
4374 $this->add_control(
4375 'hideComments',
4376 [
4377 'label' => __('Hide Comments', 'embedpress'),
4378 'type' => \Elementor\Controls_Manager::SWITCHER,
4379 'label_on' => __('Yes', 'embedpress'),
4380 'label_off' => __('No', 'embedpress'),
4381 'return_value' => 'yes',
4382 'default' => 'no',
4383 ]
4384 );
4385
4386 $this->add_control(
4387 'hideSharing',
4388 [
4389 'label' => __('Hide Sharing', 'embedpress'),
4390 'type' => \Elementor\Controls_Manager::SWITCHER,
4391 'label_on' => __('Yes', 'embedpress'),
4392 'label_off' => __('No', 'embedpress'),
4393 'return_value' => 'yes',
4394 'default' => 'no',
4395 ]
4396 );
4397
4398 $this->add_control(
4399 'hideLogo',
4400 [
4401 'label' => __('Hide Logo', 'embedpress'),
4402 'type' => \Elementor\Controls_Manager::SWITCHER,
4403 'label_on' => __('Yes', 'embedpress'),
4404 'label_off' => __('No', 'embedpress'),
4405 'return_value' => 'yes',
4406 'default' => 'no',
4407 'description' => __('Hide the Spreaker logo and branding in the player. Requires Broadcaster plan or higher.', 'embedpress'),
4408 ]
4409 );
4410
4411 $this->add_control(
4412 'hideEpisodeDescription',
4413 [
4414 'label' => __('Hide Episode Description', 'embedpress'),
4415 'type' => \Elementor\Controls_Manager::SWITCHER,
4416 'label_on' => __('Yes', 'embedpress'),
4417 'label_off' => __('No', 'embedpress'),
4418 'return_value' => 'yes',
4419 'default' => 'no',
4420 ]
4421 );
4422
4423
4424 $this->end_controls_section();
4425 }
4426
4427 public function init_google_photos_control_setion()
4428 {
4429 $condition = [
4430 'embedpress_pro_embeded_source' => 'google_photos',
4431 ];
4432
4433 $this->start_controls_section(
4434 'google_photos_controls_section',
4435 [
4436 'label' => __('Google Photos Controls', 'embedpress'),
4437 'condition' => $condition,
4438 ]
4439 );
4440
4441
4442
4443 // $this->pro_text
4444 // Mode Selection
4445 $this->add_control(
4446 'mode',
4447 [
4448 'label' => __('Album Mode', 'embedpress'),
4449 'type' => \Elementor\Controls_Manager::SELECT,
4450 'options' => [
4451 'carousel' => __('Carousel', 'embedpress'),
4452 'gallery-player' => __('Gallery Player', 'embedpress'),
4453 'gallery-grid' => __('Grid', 'embedpress') . ' ' . __($this->pro_text, 'embedpress'),
4454 'gallery-masonary' => __('Masonry', 'embedpress') . ' ' . __($this->pro_text, 'embedpress'),
4455 'gallery-justify' => __('Justify', 'embedpress') . ' ' . __($this->pro_text, 'embedpress'),
4456 ],
4457 'default' => 'carousel',
4458 ]
4459 );
4460
4461 if (!apply_filters('embedpress/is_allow_rander', false)) {
4462 $this->add_control(
4463 'embedpress_google_photos__pro_enable_warning_1',
4464 [
4465 'label' => sprintf(
4466 '<a style="color: red" target="_blank" href="https://wpdeveloper.com/in/upgrade-embedpress">%s</a>',
4467 esc_html__('Only Available in Pro Version!', 'essential-addons-for-elementor-lite')
4468 ),
4469 'type' => Controls_Manager::RAW_HTML,
4470 'condition' => [
4471 'mode' => ['gallery-grid', 'gallery-masonary', 'gallery-justify'],
4472 ],
4473 ]
4474 );
4475 }
4476
4477 $this->add_control(
4478 'showTitle',
4479 [
4480 'label' => __('Show Title', 'embedpress'),
4481 'type' => \Elementor\Controls_Manager::SWITCHER,
4482 'label_on' => __('Yes', 'embedpress'),
4483 'label_off' => __('No', 'embedpress'),
4484 'default' => 'yes',
4485 'condition' => [
4486 'embedpress_pro_embeded_source' => 'google_photos',
4487 ],
4488 ]
4489 );
4490
4491
4492 // Player Autoplay, Delay, and Repeat
4493 $this->add_control(
4494 'playerAutoplay',
4495 [
4496 'label' => __('Autoplay', 'embedpress'),
4497 'type' => \Elementor\Controls_Manager::SWITCHER,
4498 'label_on' => __('Yes', 'embedpress'),
4499 'label_off' => __('No', 'embedpress'),
4500 'default' => 'no',
4501 'condition' => [
4502 'mode' => 'gallery-player',
4503 ],
4504 ]
4505 );
4506
4507 $this->add_control(
4508 'delay',
4509 [
4510 'label' => __('Delay (seconds)', 'embedpress'),
4511 'type' => \Elementor\Controls_Manager::NUMBER,
4512 'min' => 1,
4513 'max' => 60,
4514 'default' => 5,
4515 'condition' => [
4516 'mode' => 'gallery-player',
4517 ],
4518 ]
4519 );
4520
4521 $this->add_control(
4522 'repeat',
4523 [
4524 'label' => __('Repeat', 'embedpress'),
4525 'type' => \Elementor\Controls_Manager::SWITCHER,
4526 'label_on' => __('Yes', 'embedpress'),
4527 'label_off' => __('No', 'embedpress'),
4528 'default' => 'no',
4529 'condition' => [
4530 'mode' => 'gallery-player',
4531 ],
4532 ]
4533 );
4534
4535 // Toggles for Media Items
4536 // $this->add_control(
4537 // 'mediaitemsAspectRatio',
4538 // [
4539 // 'label' => __('Keep Aspect Ratio', 'embedpress'),
4540 // 'type' => \Elementor\Controls_Manager::SWITCHER,
4541 // 'default' => 'yes',
4542 // ]
4543 // );
4544
4545 // $this->add_control(
4546 // 'mediaitemsEnlarge',
4547 // [
4548 // 'label' => __('Enlarge', 'embedpress'),
4549 // 'type' => \Elementor\Controls_Manager::SWITCHER,
4550 // 'default' => 'no',
4551 // ]
4552 // );
4553
4554 // $this->add_control(
4555 // 'mediaitemsStretch',
4556 // [
4557 // 'label' => __('Stretch', 'embedpress'),
4558 // 'type' => \Elementor\Controls_Manager::SWITCHER,
4559 // 'default' => 'no',
4560 // ]
4561 // );
4562
4563 // $this->add_control(
4564 // 'mediaitemsCover',
4565 // [
4566 // 'label' => __('Cover', 'embedpress'),
4567 // 'type' => \Elementor\Controls_Manager::SWITCHER,
4568 // 'default' => 'no',
4569 // ]
4570 // );
4571
4572 // Background Color
4573 $this->add_control(
4574 'backgroundColor',
4575 [
4576 'label' => __('Background Color', 'embedpress'),
4577 'type' => \Elementor\Controls_Manager::COLOR,
4578 'default' => '#000000',
4579 ]
4580 );
4581
4582 // Expiration
4583 $this->add_control(
4584 'expiration',
4585 [
4586 'label' => __('Sync after (minutes)', 'embedpress'),
4587 'type' => \Elementor\Controls_Manager::NUMBER,
4588 'min' => 0,
4589 'max' => 1440,
4590 'default' => 60,
4591 ]
4592 );
4593
4594 // Photos Link
4595 $this->add_control(
4596 'photos_link',
4597 [
4598 'label' => __('Enable Visit Google Photos Link', 'embedpress'),
4599 'type' => \Elementor\Controls_Manager::SWITCHER,
4600 'label_on' => __('Yes', 'embedpress'),
4601 'label_off' => __('No', 'embedpress'),
4602 'default' => 'yes',
4603 'description' => __('Enable an external link icon to visit the original Google Photos album', 'embedpress'),
4604 'condition' => [
4605 'mode' => ['carousel', 'gallery-player'],
4606 ],
4607 ]
4608 );
4609
4610 $this->end_controls_section();
4611 }
4612
4613 /**
4614 * Meetup Controls
4615 */
4616 public function init_meetup_control_section()
4617 {
4618 $condition = [
4619 'embedpress_pro_embeded_source' => 'meetup',
4620 ];
4621
4622 $this->start_controls_section(
4623 'meetup_controls_section',
4624 [
4625 'label' => __('Meetup Settings', 'embedpress'),
4626 'condition' => $condition,
4627 ]
4628 );
4629
4630 $this->add_control(
4631 'meetup_rss_feed_note',
4632 [
4633 'type' => \Elementor\Controls_Manager::RAW_HTML,
4634 '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'),
4635 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
4636 ]
4637 );
4638
4639 $this->add_control(
4640 'meetup_orderby',
4641 [
4642 'label' => __('Order By', 'embedpress'),
4643 'type' => Controls_Manager::SELECT,
4644 'options' => [
4645 'date' => __('Date', 'embedpress'),
4646 'title' => __('Title', 'embedpress'),
4647 'attendees' => __('Attendees', 'embedpress'),
4648 ],
4649 'default' => 'date',
4650 'description' => __('Choose how to sort the events (RSS feeds only)', 'embedpress'),
4651 ]
4652 );
4653
4654 $this->add_control(
4655 'meetup_order',
4656 [
4657 'label' => __('Order', 'embedpress'),
4658 'type' => Controls_Manager::SELECT,
4659 'options' => [
4660 'ASC' => __('Ascending', 'embedpress'),
4661 'DESC' => __('Descending', 'embedpress'),
4662 ],
4663 'default' => 'ASC',
4664 'description' => __('Sort direction (RSS feeds only)', 'embedpress'),
4665 ]
4666 );
4667
4668 $this->add_control(
4669 'meetup_per_page',
4670 [
4671 'label' => __('Events Per Page', 'embedpress'),
4672 'type' => Controls_Manager::NUMBER,
4673 'min' => 1,
4674 'max' => 50,
4675 'default' => 10,
4676 'description' => __('Number of events to show per page (RSS feeds only)', 'embedpress'),
4677 ]
4678 );
4679
4680 $this->add_control(
4681 'meetup_enable_pagination',
4682 [
4683 'label' => __('Enable Load More', 'embedpress'),
4684 'type' => Controls_Manager::SWITCHER,
4685 'label_on' => __('Yes', 'embedpress'),
4686 'label_off' => __('No', 'embedpress'),
4687 'default' => 'yes',
4688 'description' => __('Show a "Load More" button to load additional events (RSS feeds only)', 'embedpress'),
4689 ]
4690 );
4691
4692 $this->add_control(
4693 'meetup_timezone',
4694 [
4695 'label' => __('Timezone', 'embedpress'),
4696 'type' => Controls_Manager::SELECT,
4697 'options' => [
4698 'visitor_timezone' => __('Visitor Timezone (Auto-detect)', 'embedpress'),
4699 'wp_timezone' => __('WordPress Site Timezone', 'embedpress'),
4700 'UTC' => __('UTC', 'embedpress'),
4701 'America/New_York' => __('America/New_York (EST/EDT)', 'embedpress'),
4702 'America/Chicago' => __('America/Chicago (CST/CDT)', 'embedpress'),
4703 'America/Denver' => __('America/Denver (MST/MDT)', 'embedpress'),
4704 'America/Los_Angeles' => __('America/Los_Angeles (PST/PDT)', 'embedpress'),
4705 'Europe/London' => __('Europe/London (GMT/BST)', 'embedpress'),
4706 'Europe/Paris' => __('Europe/Paris (CET/CEST)', 'embedpress'),
4707 'Asia/Tokyo' => __('Asia/Tokyo (JST)', 'embedpress'),
4708 'Australia/Sydney' => __('Australia/Sydney (AEST/AEDT)', 'embedpress'),
4709 ],
4710 'default' => 'visitor_timezone',
4711 'description' => __('Select timezone for displaying event dates and times. Visitor timezone will auto-detect based on their browser.', 'embedpress'),
4712 ]
4713 );
4714
4715 $this->add_control(
4716 'meetup_date_format',
4717 [
4718 'label' => __('Date Format', 'embedpress'),
4719 'type' => Controls_Manager::SELECT,
4720 'options' => [
4721 'wp_date_format' => __('WordPress Date Format', 'embedpress'),
4722 'm/d/Y' => __('MM/DD/YYYY', 'embedpress'),
4723 'd/m/Y' => __('DD/MM/YYYY', 'embedpress'),
4724 'Y-m-d' => __('YYYY-MM-DD', 'embedpress'),
4725 'F j, Y' => __('Month DD, YYYY', 'embedpress'),
4726 'j F Y' => __('DD Month YYYY', 'embedpress'),
4727 ],
4728 'default' => 'wp_date_format',
4729 'description' => __('Select date format for event dates', 'embedpress'),
4730 ]
4731 );
4732
4733 $this->add_control(
4734 'meetup_time_format',
4735 [
4736 'label' => __('Time Format', 'embedpress'),
4737 'type' => Controls_Manager::SELECT,
4738 'options' => [
4739 'wp_time_format' => __('WordPress Time Format', 'embedpress'),
4740 'g:i A' => __('12-hour (h:mm AM/PM)', 'embedpress'),
4741 'H:i' => __('24-hour (HH:mm)', 'embedpress'),
4742 ],
4743 'default' => 'wp_time_format',
4744 'description' => __('Select time format for event times', 'embedpress'),
4745 ]
4746 );
4747
4748 $this->end_controls_section();
4749 }
4750
4751 /**
4752 * End Spreaker Controls
4753 */
4754
4755 /**
4756 * Performance Settings Section
4757 */
4758 public function init_performance_controls()
4759 {
4760 // Get global lazy load setting
4761 $g_settings = get_option(EMBEDPRESS_PLG_NAME, []);
4762 $lazy_load_default = isset($g_settings['g_lazyload']) && $g_settings['g_lazyload'] == 1 ? 'yes' : '';
4763
4764 $this->start_controls_section(
4765 'embedpress_performance_section',
4766 [
4767 'label' => __('Performance', 'embedpress'),
4768 ]
4769 );
4770
4771 $this->add_control(
4772 'enable_lazy_load',
4773 [
4774 'label' => sprintf(__('Enable Lazy Loading %s', 'embedpress'), $this->pro_text),
4775 'type' => \Elementor\Controls_Manager::SWITCHER,
4776 'label_on' => __('Yes', 'embedpress'),
4777 'label_off' => __('No', 'embedpress'),
4778 'return_value' => 'yes',
4779 'default' => $lazy_load_default,
4780 'description' => __('Load iframe only when it enters the viewport for better performance', 'embedpress'),
4781 'classes' => $this->pro_class,
4782 ]
4783 );
4784
4785 $this->end_controls_section();
4786 }
4787
4788 public function init_style_controls()
4789 {
4790 $this->start_controls_section(
4791 'embedpress_style_section',
4792 [
4793 'label' => __('General', 'embedpress'),
4794 'tab' => Controls_Manager::TAB_STYLE,
4795 'condition' => [
4796 'embedpress_pro_embeded_source!' => 'opensea',
4797 ]
4798
4799 ]
4800 );
4801 $this->add_responsive_control(
4802 'width',
4803 [
4804 'label' => __('Width', 'embedpress'),
4805 'type' => Controls_Manager::SLIDER,
4806 'size_units' => ['px'],
4807 'range' => [
4808 'px' => [
4809 'min' => 0,
4810 'max' => 1500,
4811 'step' => 1,
4812 ],
4813 ],
4814 'devices' => ['desktop', 'tablet', 'mobile'],
4815 'default' => [
4816 'size' => !empty($value = intval(Helper::get_options_value('enableEmbedResizeWidth'))) ? $value : 600,
4817 'unit' => 'px',
4818 ],
4819 'desktop_default' => [
4820 'size' => 600,
4821 'unit' => 'px',
4822 ],
4823 'tablet_default' => [
4824 'size' => 600,
4825 'unit' => 'px',
4826 ],
4827 'mobile_default' => [
4828 'size' => 600,
4829 'unit' => 'px',
4830 ],
4831 'selectors' => [
4832 '{{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive>iframe,{{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive, {{WRAPPER}} .sponsored-youtube-video > iframe,
4833 {{WRAPPER}} .plyr--video:not(.plyr--fullscreen-fallback),
4834 {{WRAPPER}} .ose-giphy img,
4835 {{WRAPPER}} .embera-embed-responsive-provider-gettyimages,
4836 {{WRAPPER}} .embera-embed-responsive-provider-gettyimages iframe,
4837 {{WRAPPER}} .getty,
4838 {{WRAPPER}} .jx-gallery-player-widget' => 'width: {{size}}{{UNIT}}!important; max-width: 100%!important;',
4839 ],
4840 ]
4841 );
4842
4843 $this->add_responsive_control(
4844 'height',
4845 [
4846 'label' => __('Height', 'embedpress'),
4847 'type' => Controls_Manager::SLIDER,
4848 'size_units' => ['px', '%'],
4849 'range' => [
4850 'px' => [
4851 'min' => 0,
4852 'max' => 1500,
4853 'step' => 1,
4854 ],
4855 ],
4856 'devices' => ['desktop', 'tablet', 'mobile'],
4857 'desktop_default' => [
4858 'size' => 400,
4859 'unit' => 'px',
4860 ],
4861 'default' => [
4862 'size' => !empty($value = intval(Helper::get_options_value('enableEmbedResizeHeight'))) ? $value : 600,
4863 'unit' => 'px',
4864 ],
4865 'tablet_default' => [
4866 'size' => 400,
4867 'unit' => 'px',
4868 ],
4869 'mobile_default' => [
4870 'size' => 400,
4871 'unit' => 'px',
4872 ],
4873 'selectors' => [
4874 '{{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive iframe, {{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive,{{WRAPPER}} .sponsored-youtube-video > iframe,
4875 {{WRAPPER}} .plyr--video:not(.plyr--fullscreen-fallback),
4876 {{WRAPPER}} .ose-giphy img,
4877 {{WRAPPER}} .embera-embed-responsive-provider-gettyimages,
4878 {{WRAPPER}} .embera-embed-responsive-provider-gettyimages iframe,
4879 {{WRAPPER}} .getty,
4880 {{WRAPPER}} .jx-gallery-player-widget' => 'height: {{size}}{{UNIT}}!important;max-height: 100%!important',
4881 '{{WRAPPER}} .ep-youtube-channel .ose-youtube' => 'height: 100%!important;max-height: 100%!important',
4882 ],
4883 'conditions' => [
4884 'relation' => 'or',
4885 'terms' => [
4886 [
4887 'relation' => 'and',
4888 'terms' => [
4889 [
4890 'name' => 'embedpress_pro_embeded_source',
4891 'operator' => '===',
4892 'value' => 'google_photos',
4893 ],
4894 [
4895 'relation' => 'or',
4896 'terms' => [
4897 [
4898 'name' => 'mode',
4899 'operator' => '==',
4900 'value' => 'carousel',
4901 ],
4902 [
4903 'name' => 'mode',
4904 'operator' => '==',
4905 'value' => 'gallery-player',
4906 ],
4907 ],
4908 ]
4909
4910 ],
4911 ],
4912 [
4913 'name' => 'embedpress_pro_embeded_source',
4914 'operator' => 'in',
4915 'value' => ['default', 'youtube', 'vimeo', 'twitch', 'soundcloud', 'dailymotion', 'wistia', 'calendly', 'opensea', 'spreaker', 'selfhosted_video', 'selfhosted_audio'],
4916 ],
4917
4918 ],
4919
4920 ],
4921 ]
4922 );
4923
4924 $this->add_control(
4925 'width_height_important_note',
4926 [
4927 'type' => \Elementor\Controls_Manager::RAW_HTML,
4928 'raw' => esc_html__('Note: The maximum width and height are set to 100%.', 'embedpress'),
4929 'content_classes' => 'elementor-panel-alert elementor-panel-warning-info',
4930 ]
4931 );
4932 $this->add_responsive_control(
4933 'margin',
4934 [
4935 'label' => __('Margin', 'embedpress'),
4936 'type' => Controls_Manager::DIMENSIONS,
4937 'size_units' => ['px', '%', 'em'],
4938 'selectors' => [
4939 '{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4940 ],
4941 ]
4942 );
4943 $this->add_responsive_control(
4944 'padding',
4945 [
4946 'label' => __('Padding', 'embedpress'),
4947 'type' => Controls_Manager::DIMENSIONS,
4948 'size_units' => ['px', '%', 'em'],
4949 'selectors' => [
4950 '{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4951 ],
4952 ]
4953 );
4954 $this->add_responsive_control(
4955 'align',
4956 [
4957 'label' => esc_html__('Alignment', 'embedpress'),
4958 'type' => Controls_Manager::CHOOSE,
4959 'options' => [
4960 'left' => [
4961 'title' => esc_html__('Left', 'embedpress'),
4962 'icon' => 'eicon-text-align-left',
4963 ],
4964 'center' => [
4965 'title' => esc_html__('Center', 'embedpress'),
4966 'icon' => 'eicon-text-align-center',
4967 ],
4968 'right' => [
4969 'title' => esc_html__('Right', 'embedpress'),
4970 'icon' => 'eicon-text-align-right',
4971 ],
4972 ],
4973 'prefix_class' => 'elementor%s-align-',
4974 'default' => '',
4975 ]
4976 );
4977 $this->end_controls_section();
4978 }
4979
4980 public function render_plain_content()
4981 {
4982 $args = "";
4983 $settings = $this->get_settings_for_display();
4984
4985 $_settings = $this->convert_settings($settings);
4986 foreach ($_settings as $key => $value) {
4987 $args .= "$key='" . esc_attr($value) . "' ";
4988 }
4989
4990 $args = trim($args);
4991 $embed_code = sprintf("[embedpress %s]%s[/embedpress]", $args, esc_url($settings['embedpress_embeded_link']));
4992 echo $embed_code;
4993 }
4994
4995
4996 public function get_custom_player_options($settings)
4997 {
4998
4999 $_player_options = '';
5000
5001 if (!empty($settings['emberpress_custom_player'])) {
5002
5003 $player_preset = !empty($settings['custom_payer_preset']) ? sanitize_text_field($settings['custom_payer_preset']) : 'preset-default';
5004
5005 $player_color = !empty($settings['embedpress_player_color']) ? sanitize_hex_color($settings['embedpress_player_color']) : '';
5006
5007 $poster_thumbnail = !empty($settings['embedpress_player_poster_thumbnail']['url']) ? esc_url($settings['embedpress_player_poster_thumbnail']['url']) : '';
5008
5009
5010 $is_self_hosted = Helper::check_media_format($settings['embedpress_embeded_link']);
5011
5012
5013 $player_pip = !empty($settings['embepress_player_always_on_top']) ? true : false;
5014 $player_restart = !empty($settings['embepress_player_restart']) ? true : false;
5015 $player_rewind = !empty($settings['embepress_player_rewind']) ? true : false;
5016 $player_fastForward = !empty($settings['embepress_player_fast_forward']) ? true : false;
5017 $player_tooltip = !empty($settings['embepress_player_tooltip']) ? true : false;
5018 $player_hide_controls = !empty($settings['embepress_player_hide_controls']) ? true : false;
5019 $player_download = !empty($settings['embepress_player_download']) ? true : false;
5020 $player_fullscreen = !empty($settings['embedpress_pro_youtube_enable_fullscreen_button']) ? true : false;
5021
5022 $playerOptions = [
5023 'rewind' => $player_rewind,
5024 'restart' => $player_restart,
5025 'pip' => $player_pip,
5026 'poster_thumbnail' => $poster_thumbnail,
5027 'player_color' => $player_color,
5028 'player_preset' => $player_preset,
5029 'fast_forward' => $player_fastForward,
5030 'player_tooltip' => $player_tooltip,
5031 'hide_controls' => $player_hide_controls,
5032 'download' => $player_download,
5033 'fullscreen' => $player_fullscreen,
5034 ];
5035
5036
5037 //Youtube options
5038 if (!empty($settings['embedpress_pro_video_start_time'])) {
5039 $playerOptions['start'] = $settings['embedpress_pro_video_start_time'];
5040 }
5041 if (!empty($settings['embedpress_pro_youtube_end_time'])) {
5042 $playerOptions['end'] = $settings['embedpress_pro_youtube_end_time'];
5043 }
5044 if (!empty($settings['embedpress_pro_youtube_display_related_videos'])) {
5045 $playerOptions['rel'] = true;
5046 } else {
5047 $playerOptions['rel'] = false;
5048 }
5049
5050 //vimeo options
5051 if (!empty($settings['embedpress_pro_vimeo_start_time'])) {
5052 $playerOptions['t'] = $settings['embedpress_pro_vimeo_start_time'];
5053 }
5054 if (!empty($settings['embedpress_pro_vimeo_auto_play'])) {
5055 $playerOptions['vautoplay'] = true;
5056 } else {
5057 $playerOptions['vautoplay'] = false;
5058 }
5059 if (!empty($settings['embedpress_pro_vimeo_autopause'])) {
5060 $playerOptions['autopause'] = true;
5061 } else {
5062 $playerOptions['autopause'] = false;
5063 }
5064
5065 if (!empty($settings['embedpress_pro_vimeo_dnt'])) {
5066 $playerOptions['dnt'] = true;
5067 } else {
5068 $playerOptions['dnt'] = false;
5069 }
5070
5071 if (!empty($is_self_hosted['selhosted'])) {
5072 $playerOptions['self_hosted'] = $is_self_hosted['selhosted'];
5073 $playerOptions['hosted_format'] = $is_self_hosted['format'];
5074 }
5075
5076 // ─── Card 81243 — Embed Custom Player advanced features (Pro). ───
5077 $playerOptions = array_merge(
5078 $playerOptions,
5079 apply_filters('embedpress/elementor/advanced_player_options', [], $settings)
5080 );
5081
5082 $playerOptionsString = json_encode($playerOptions);
5083 // Wrap in quotes — htmlentities(..., ENT_QUOTES) already encoded `"` as
5084 // `&quot;`, but values like email-capture headlines can contain spaces,
5085 // which would terminate an unquoted attribute mid-JSON and break
5086 // initplyr.js's JSON.parse, silently disabling the custom player.
5087 $_player_options = 'data-options="' . htmlentities($playerOptionsString, ENT_QUOTES) . '"';
5088 }
5089
5090 return $_player_options;
5091 }
5092
5093
5094
5095
5096
5097 public function get_instafeed_carousel_options($settings)
5098 {
5099 $_carousel_options = '';
5100
5101 if (!empty($settings['instaLayout']) && $settings['instaLayout'] === 'insta-carousel') {
5102 $_carousel_id = 'data-carouselid=' . esc_attr($this->get_id()) . '';
5103
5104 $layout = $settings['instaLayout'];
5105 $embedpress_instafeed_slide_show = !empty($settings['embedpress_instafeed_slide_show']) ? $settings['embedpress_instafeed_slide_show'] : 5;
5106 $embedpress_carousel_autoplay = !empty($settings['embedpress_carousel_autoplay']) ? $settings['embedpress_carousel_autoplay'] : 0;
5107 $embedpress_carousel_autoplay_speed = !empty($settings['embedpress_carousel_autoplay_speed']) ? $settings['embedpress_carousel_autoplay_speed'] : 3000;
5108 $embedpress_carousel_transition_speed = !empty($settings['embedpress_carousel_transition_speed']) ? $settings['embedpress_carousel_transition_speed'] : 1000;
5109 $embedpress_carousel_loop = !empty($settings['embedpress_carousel_loop']) ? $settings['embedpress_carousel_loop'] : 0;
5110 $embedpress_carousel_arrows = !empty($settings['embedpress_carousel_arrows']) ? $settings['embedpress_carousel_arrows'] : 0;
5111 $spacing = !empty($settings['embedpress_carousel_spacing']) ? $settings['embedpress_carousel_spacing'] : 0;
5112
5113 // print_r($settings);
5114
5115 $carousel_options = [
5116 'layout' => $layout,
5117 'slideshow' => $embedpress_instafeed_slide_show,
5118 'autoplay' => $embedpress_carousel_autoplay,
5119 'autoplayspeed' => $embedpress_carousel_autoplay_speed,
5120 'transitionspeed' => $embedpress_carousel_transition_speed,
5121 'loop' => $embedpress_carousel_loop,
5122 'arrows' => $embedpress_carousel_arrows,
5123 'spacing' => $spacing
5124 ];
5125
5126 $carousel_options_string = json_encode($carousel_options);
5127 $_carousel_options = 'data-carousel-options=' . htmlentities($carousel_options_string, ENT_QUOTES) . '';
5128 }
5129 return $_carousel_options;
5130 }
5131
5132 public function get_instafeed_layout($settings)
5133 {
5134 $insta_layout = '';
5135 if ($settings['embedpress_pro_embeded_source'] == 'instafeed') {
5136 $insta_layout = ' ' . $settings['instaLayout'];
5137 }
5138
5139 return $insta_layout;
5140 }
5141
5142 protected function convert_settings($settings)
5143 {
5144 $_settings = [];
5145 foreach ($settings as $key => $value) {
5146 if (empty($value)) {
5147 $_settings[$key] = 'false';
5148 } else if (!empty($value['size'])) {
5149 $_settings[$key] = $value['size'];
5150 } else if (!empty($value['url'])) {
5151 $_settings[$key] = $value['url'];
5152 } else if (\is_scalar($value)) {
5153 $_settings[$key] = $value;
5154 }
5155 }
5156
5157 return $_settings;
5158 }
5159
5160 public function validUserAccountUrl($url)
5161 {
5162 $pattern = '/^(?:https?:\/\/)?(?:www\.)?instagram\.com\/(?:[a-zA-Z0-9_\.]+\/?)$/';
5163 return (bool) preg_match($pattern, $url);
5164 }
5165
5166 function validInstagramTagUrl($url)
5167 {
5168 $pattern = '/^(?:https?:\/\/)?(?:www\.)?instagram\.com\/explore\/tags\/[a-zA-Z0-9_\-]+\/?$/';
5169 return (bool) preg_match($pattern, $url);
5170 }
5171
5172 protected function render()
5173 {
5174 $settings = $this->get_settings_for_display();
5175 Helper::get_enable_settings_data_for_scripts($settings);
5176
5177 add_filter('embedpress_should_modify_spotify', '__return_false');
5178 $embed_link = isset($settings['embedpress_embeded_link']) ? $settings['embedpress_embeded_link'] : '';
5179
5180 if (!apply_filters('embedpress/is_allow_rander', false) && ($settings['mode'] === 'gallery-grid' || $settings['mode'] === 'gallery-masonary' || $settings['mode'] === 'gallery-justify')) {
5181 echo '<div class="pro__alert__wrap" style="display: block;">
5182 <div class="pro__alert__card">
5183 <h2>Opps...</h2>
5184 <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>
5185 </div>
5186 </div>';
5187 return '';
5188 }
5189
5190 if ($settings['instafeedFeedType'] === 'mixed_type' || $settings['instafeedFeedType'] === 'tagged_type') {
5191 echo 'Comming Soon.';
5192 return '';
5193 }
5194
5195 if ($settings['instafeedFeedType'] === 'hashtag_type' && !$this->validInstagramTagUrl($embed_link)) {
5196 echo 'Please add valid hashtag link url';
5197 return '';
5198 }
5199
5200 if ($settings['instafeedFeedType'] === 'user_account_type' && !$this->validUserAccountUrl($embed_link)) {
5201 echo 'Please add valid user account link url';
5202 return '';
5203 }
5204
5205 if (!apply_filters('embedpress/is_allow_rander', false) && ($settings['instaLayout'] === 'insta-masonry' || $settings['instaLayout'] === 'insta-carousel' || $settings['instafeedFeedType'] === 'hashtag_type')) {
5206 echo '<div class="pro__alert__wrap" style="display: block;">
5207 <div class="pro__alert__card">
5208 <h2>Opps...</h2>
5209 <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>
5210 </div>
5211 </div>';
5212 return '';
5213 }
5214
5215 if (!apply_filters('embedpress/is_allow_rander', false) && ($settings['ytChannelLayout'] === 'carousel' || $settings['ytChannelLayout'] === 'grid')) {
5216 echo '<div class="pro__alert__wrap" style="display: block; position: static; background: none;">
5217 <div class="pro__alert__card" style="position: static; transform: none; margin: 0 auto;text-align: left; align-items: flex-start;">
5218 <h2>Opps...</h2>
5219 <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>
5220 </div>
5221 </div>';
5222 return '';
5223 }
5224
5225 if ($settings['instafeedFeedType'] === 'mixed_type' || $settings['instafeedFeedType'] === 'tagged_type') {
5226 echo 'Comming Soon.';
5227 return '';
5228 }
5229
5230 if ($settings['instafeedFeedType'] === 'hashtag_type' && !$this->validInstagramTagUrl($embed_link)) {
5231 echo 'Please add valid hashtag link url';
5232 return '';
5233 }
5234
5235 if ($settings['instafeedFeedType'] === 'user_account_type' && !$this->validUserAccountUrl($embed_link)) {
5236 echo 'Please add valid user account link url';
5237 return '';
5238 }
5239
5240 $is_editor_view = Plugin::$instance->editor->is_edit_mode();
5241 $link = $settings['embedpress_embeded_link'];
5242 $is_apple_podcast = (strpos($link, 'podcasts.apple.com') !== false);
5243
5244 // conditionaly convert settings data
5245 $_settings = [];
5246 $source = isset($settings['embedpress_pro_embeded_source']) ? esc_attr($settings['embedpress_pro_embeded_source']) : 'default';
5247 $embed_link = isset($settings['embedpress_embeded_link']) ? esc_url($settings['embedpress_embeded_link']) : '';
5248 $pass_hash_key = isset($settings['embedpress_lock_content_password']) ? md5($settings['embedpress_lock_content_password']) : '';
5249
5250
5251
5252 Helper::get_source_data(md5($this->get_id()) . '_eb_elementor', esc_url($embed_link), 'elementor_source_data', 'elementor_temp_source_data');
5253
5254 if (!(($source === 'default' || !empty($source[0]) && $source[0] === 'default') && strpos($embed_link, 'opensea.io') !== false)) {
5255 $_settings = $this->convert_settings($settings);
5256 }
5257
5258 if (strpos($embed_link, 'opensea.io') !== false) {
5259 $source = 'opensea';
5260 }
5261
5262 $_settings = Helper::removeQuote($_settings);
5263
5264
5265
5266 // Map Meetup-specific settings to shortcode attributes
5267 if (strpos($embed_link, 'meetup.com') !== false) {
5268 if (isset($settings['meetup_orderby'])) {
5269 $_settings['orderby'] = $settings['meetup_orderby'];
5270 }
5271 if (isset($settings['meetup_order'])) {
5272 $_settings['order'] = $settings['meetup_order'];
5273 }
5274 if (isset($settings['meetup_per_page'])) {
5275 $_settings['per_page'] = $settings['meetup_per_page'];
5276 }
5277 if (isset($settings['meetup_enable_pagination'])) {
5278 $_settings['enable_pagination'] = ($settings['meetup_enable_pagination'] === 'yes');
5279 }
5280 if (isset($settings['meetup_timezone'])) {
5281 $_settings['timezone'] = $settings['meetup_timezone'];
5282 }
5283 if (isset($settings['meetup_date_format'])) {
5284 $_settings['date_format'] = $settings['meetup_date_format'];
5285 }
5286 if (isset($settings['meetup_time_format'])) {
5287 $_settings['time_format'] = $settings['meetup_time_format'];
5288 }
5289 }
5290
5291 $embed_content = Shortcode::parseContent($settings['embedpress_embeded_link'], true, $_settings);
5292 $embed_content = $this->onAfterEmbedSpotify($embed_content, $settings);
5293 $embed = apply_filters('embedpress_elementor_embed', $embed_content, $settings);
5294 $content = is_object($embed) ? $embed->embed : $embed;
5295
5296 // Pro: Country Restriction (4.9). Filter returns rendered HTML to
5297 // short-circuit, or false to render normally. Pro plugin attaches
5298 // the implementation; with Pro disabled this is a no-op.
5299 $restricted = apply_filters('embedpress/elementor/country_restriction_html', false, $settings);
5300 if ($restricted !== false) {
5301 echo $restricted;
5302 return;
5303 }
5304
5305 // Pro: CDN Offloading (4.12) and Advanced Privacy Mode (4.10).
5306 // Filters are no-ops without Pro; gating on the toggle settings
5307 // happens inside the Pro callbacks.
5308 $content = apply_filters('embedpress/elementor/cdn_rewrite_html', $content, $settings);
5309 $content = apply_filters('embedpress/elementor/privacy_mode_html', $content, $settings);
5310
5311 // Used downstream to add the `ep-privacy-pending` wrapper class so
5312 // the click-to-load overlay renders. Mirrors the Pro callback's gate.
5313 $ep_privacy_active = !empty($settings['emberpress_custom_player'])
5314 && $settings['emberpress_custom_player'] === 'yes'
5315 && !empty($settings['embepress_player_privacy_mode'])
5316 && $settings['embepress_player_privacy_mode'] === 'yes';
5317
5318 // Track Elementor widget usage for analytics
5319 $this->track_elementor_usage($settings, $content);
5320
5321
5322
5323 $embed_settings = [];
5324 $embed_settings['customThumbnail'] = !empty($settings['embedpress_content_share_custom_thumbnail']['url']) ? esc_url($settings['embedpress_content_share_custom_thumbnail']['url']) : '';
5325
5326 $embed_settings['customTitle'] = !empty($settings['embedpress_content_title']) ? sanitize_text_field($settings['embedpress_content_title']) : Helper::get_file_title($embed_link);
5327
5328 $embed_settings['customDescription'] = !empty($settings['embedpress_content_descripiton']) ? sanitize_text_field($settings['embedpress_content_descripiton']) : Helper::get_file_title($embed_link);
5329
5330 $embed_settings['sharePosition'] = !empty($settings['embedpress_content_share_position']) ? sanitize_text_field($settings['embedpress_content_share_position']) : 'right';
5331
5332 // Add social share platform settings
5333 $embed_settings['shareFacebook'] = !empty($settings['embedpress_share_facebook']) ? true : false;
5334 $embed_settings['shareTwitter'] = !empty($settings['embedpress_share_twitter']) ? true : false;
5335 $embed_settings['sharePinterest'] = !empty($settings['embedpress_share_pinterest']) ? true : false;
5336 $embed_settings['shareLinkedin'] = !empty($settings['embedpress_share_linkedin']) ? true : false;
5337
5338 $embed_settings['lockHeading'] = !empty($settings['embedpress_lock_content_heading']) ? sanitize_text_field($settings['embedpress_lock_content_heading']) : '';
5339
5340 $embed_settings['lockSubHeading'] = !empty($settings['embedpress_lock_content_sub_heading']) ? sanitize_text_field($settings['embedpress_lock_content_sub_heading']) : '';
5341
5342 $embed_settings['passwordPlaceholder'] = !empty($settings['embedpress_password_placeholder']) ? sanitize_text_field($settings['embedpress_password_placeholder']) : '';
5343
5344 $embed_settings['submitButtonText'] = !empty($settings['embedpress_submit_button_text']) ? sanitize_text_field($settings['embedpress_submit_button_text']) : '';
5345
5346 $embed_settings['submitUnlockingText'] = !empty($settings['embedpress_submit_Unlocking_text']) ? sanitize_text_field($settings['embedpress_submit_Unlocking_text']) : '';
5347
5348 $embed_settings['lockErrorMessage'] = !empty($settings['embedpress_lock_content_error_message']) ? sanitize_text_field($settings['embedpress_lock_content_error_message']) : '';
5349
5350 $embed_settings['enableFooterMessage'] = !empty($settings['embedpress_enable_footer_message']) ? sanitize_text_field($settings['embedpress_enable_footer_message']) : '';
5351
5352 $embed_settings['footerMessage'] = !empty($settings['embedpress_lock_content_footer_message']) ? sanitize_text_field($settings['embedpress_lock_content_footer_message']) : '';
5353
5354 $embed_settings['userRole'] = !empty($settings['embedpress_select_roles']) ? $settings['embedpress_select_roles'] : [];
5355
5356 $embed_settings['protectionMessage'] = !empty($settings['embedpress_protection_message']) ? $settings['embedpress_protection_message'] : '';
5357
5358
5359 $client_id = $this->get_id();
5360 $hash_pass = hash('sha256', wp_salt(32) . md5($settings['embedpress_lock_content_password'] ? sanitize_text_field($settings['embedpress_lock_content_password']) : ''));
5361
5362 $password_correct = isset($_COOKIE['password_correct_' . $client_id]) ? sanitize_text_field($_COOKIE['password_correct_' . $client_id]) : '';
5363
5364 $ispagination = 'flex';
5365
5366 if ($settings['pagination'] != 'show') {
5367 $ispagination = 'none';
5368 }
5369
5370 $calVal = '';
5371
5372 if (!empty($settings['columns']) && is_numeric($settings['columns']) && (int) $settings['columns'] > 0) {
5373 $columns = (int) $settings['columns'];
5374 $gap_size = isset($settings['gapbetweenvideos']['size']) ? absint($settings['gapbetweenvideos']['size']) : 0;
5375 $calVal = 'calc(' . (100 / $columns) . '% - ' . $gap_size . 'px)';
5376 } else {
5377 $calVal = 'auto';
5378 }
5379
5380
5381 $content_share_class = '';
5382 $share_position_class = '';
5383 $share_position = isset($settings['embedpress_content_share_position']) ? esc_attr($settings['embedpress_content_share_position']) : 'right';
5384
5385 if (!empty($settings['embedpress_content_share'])) {
5386 $content_share_class = 'ep-content-share-enabled';
5387 $share_position_class = 'ep-share-position-' . $share_position;
5388 }
5389
5390 $content_protection_class = 'ep-content-protection-enabled';
5391 if (empty($settings['embedpress_lock_content']) || empty($settings['embedpress_lock_content_password']) || $hash_pass === $password_correct) {
5392 $content_protection_class = 'ep-content-protection-disabled';
5393 }
5394
5395 $data_playerid = '';
5396 if (!empty($settings['embedpress_custom_player'])) {
5397 $data_playerid = 'data-playerid="' . esc_attr($this->get_id()) . '"';
5398 // $data_playerid = 'data-playerid='.esc_attr($this->get_id());
5399 }
5400
5401 $data_carouselid = '';
5402 if (!empty($settings['instaLayout']) && $settings['instaLayout'] === 'insta-carousel') {
5403 $data_carouselid = 'data-carouselid="' . esc_attr($this->get_id()) . '"';
5404 }
5405
5406 $cEmbedType = !empty($settings['cEmbedType']) ? sanitize_text_field($settings['cEmbedType']) : '';
5407
5408 $adsAtts = '';
5409
5410 if (!empty($settings['adManager'])) {
5411 $ad = base64_encode(json_encode($settings)); // Using WordPress JSON encoding function
5412 $adsAtts = 'data-sponsored-id="' . esc_attr($client_id) . '" data-sponsored-attrs="' . esc_attr($ad) . '" class="sponsored-mask"';
5413 }
5414
5415 $data_player_id = '';
5416
5417 if (!empty($settings['emberpress_custom_player']) && $settings['emberpress_custom_player'] === 'yes') {
5418 $data_player_id = "data-playerid='" . esc_attr($this->get_id()) . "'";
5419 }
5420
5421 $hosted_format = '';
5422 if (!empty($settings['emberpress_custom_player'])) {
5423 $self_hosted = Helper::check_media_format($settings['embedpress_embeded_link']);
5424 $hosted_format = isset($self_hosted['format']) ? $self_hosted['format'] : '';
5425 }
5426
5427 $autoPause = '';
5428 if (!empty($settings['embedpress_audio_video_auto_pause'])) {
5429 $autoPause = ' enabled-auto-pause';
5430 }
5431
5432 $youtube_channel_classes = Helper::is_youtube_channel($settings['embedpress_embeded_link']) ? 'ep-youtube-channel' : '';
5433
5434 ?>
5435
5436 <div class="embedpress-elements-wrapper <?php echo esc_attr($youtube_channel_classes); ?> <?php echo !empty($settings['embedpress_elementor_aspect_ratio']) ? 'embedpress-fit-aspect-ratio' : '';
5437 echo esc_attr($cEmbedType); ?>" id="ep-elements-id-<?php echo esc_attr($this->get_id()); ?>">
5438
5439 <?php if (!apply_filters('embedpress/is_allow_rander', false) && $is_editor_view && $is_apple_podcast) : ?>
5440
5441 <p><?php esc_html_e('You need EmbedPress Pro to Embed Apple Podcast. Note. This message is only visible to you.', 'embedpress'); ?></p>
5442 <?php else: ?>
5443 <div id="ep-elementor-content-<?php echo esc_attr($client_id) ?>"
5444 class="ep-elementor-content
5445 <?php
5446 if (!empty($settings['embedpress_content_share'])) :
5447 echo esc_attr('position-' . $settings['embedpress_content_share_position'] . '-wraper');
5448 endif;
5449 ?>
5450 <?php echo esc_attr($content_share_class . ' ' . $share_position_class . ' ' . $content_protection_class); ?>
5451 <?php echo esc_attr('source-' . $source); ?>
5452 <?php echo esc_attr($autoPause); ?>">
5453
5454 <div id="<?php echo esc_attr($this->get_id()); ?>"
5455 class="ep-embed-content-wrapper
5456 <?php echo isset($settings['custom_player_preset']) ? esc_attr($settings['custom_player_preset']) : ''; ?>
5457 <?php echo esc_attr($this->get_instafeed_layout($settings)); ?>
5458 <?php echo esc_attr('ep-google-photos-' . $settings['mode']); ?>
5459 <?php echo 'data-show-title="' . (isset($settings['showTitle']) ? $settings['showTitle'] : 'yes') . '"'; ?>
5460 <?php echo esc_attr($hosted_format); ?>"
5461 <?php echo $data_playerid; ?>
5462 <?php echo $data_carouselid; ?>
5463 <?php echo $this->get_custom_player_options($settings); ?>
5464 <?php echo $this->get_instafeed_carousel_options($settings); ?>>
5465
5466 <div id="ep-elementor-content-<?php echo esc_attr($client_id) ?>"
5467 class="ep-elementor-content
5468 <?php
5469 if (!empty($settings['embedpress_content_share'])) :
5470 echo esc_attr('position-' . $settings['embedpress_content_share_position'] . '-wraper');
5471 endif;
5472 ?>
5473 <?php echo esc_attr($content_share_class . ' ' . $share_position_class . ' ' . $content_protection_class); ?>
5474 <?php echo esc_attr('source-' . $source); ?>">
5475
5476 <div <?php echo $adsAtts; ?>>
5477 <div id="<?php echo esc_attr($this->get_id()); ?>"
5478 class="ep-embed-content-wraper
5479 <?php echo esc_attr($settings['custom_payer_preset']); ?>
5480 <?php echo $ep_privacy_active ? 'ep-privacy-pending' : ''; ?>"
5481 <?php echo $data_player_id; ?>
5482 <?php echo $this->get_custom_player_options($settings); ?>>
5483
5484 <?php
5485 $content_id = $client_id;
5486 if (
5487 (empty($settings['embedpress_lock_content']) || ($settings['embedpress_protection_type'] == 'password' && empty($settings['embedpress_lock_content_password'])) || $settings['embedpress_lock_content'] == 'no') ||
5488 ($settings['embedpress_protection_type'] == 'password' && !empty(Helper::is_password_correct($client_id)) && ($hash_pass === $password_correct)) ||
5489 !apply_filters('embedpress/is_allow_rander', false) ||
5490 ($settings['embedpress_protection_type'] == 'user-role' && Helper::has_allowed_roles($embed_settings['userRole']))
5491 ) {
5492 if (!empty($settings['embedpress_content_share'])) {
5493 $content .= Helper::embed_content_share($content_id, $embed_settings);
5494 }
5495
5496 // Apply lazy loading if enabled (but not when custom player is active or in editor mode)
5497 $custom_player_enabled = !empty($settings['emberpress_custom_player']) && $settings['emberpress_custom_player'] === 'yes';
5498 if (!empty($settings['enable_lazy_load']) && $settings['enable_lazy_load'] === 'yes' && !$custom_player_enabled && !$is_editor_view) {
5499 $content = preg_replace_callback(
5500 '/<iframe([^>]*)src=["\']([^"\']+)["\']([^>]*)>/i',
5501 function ($matches) {
5502 $before = $matches[1];
5503 $src = $matches[2];
5504 $after = $matches[3];
5505
5506 // Extract style attribute if exists
5507 $style = '';
5508 if (preg_match('/style=["\']([^"\']+)["\']/i', $before . $after, $style_match)) {
5509 $style = $style_match[1];
5510 }
5511
5512 return sprintf(
5513 '<div class="ep-lazy-iframe-placeholder" data-ep-lazy-src="%s" data-ep-iframe-style="%s" %s %s style="%s"></div>',
5514 esc_attr($src),
5515 esc_attr($style),
5516 $before,
5517 $after,
5518 esc_attr($style)
5519 );
5520 },
5521 $content
5522 );
5523 }
5524
5525 echo $content;
5526 } else {
5527 if (!empty($settings['embedpress_content_share'])) {
5528 $content .= Helper::embed_content_share($content_id, $embed_settings);
5529 }
5530
5531 // Apply lazy loading if enabled (but not when custom player is active or in editor mode)
5532 $custom_player_enabled = !empty($settings['emberpress_custom_player']) && $settings['emberpress_custom_player'] === 'yes';
5533 if (!empty($settings['enable_lazy_load']) && $settings['enable_lazy_load'] === 'yes' && !$custom_player_enabled && !$is_editor_view) {
5534 $content = preg_replace_callback(
5535 '/<iframe([^>]*)src=["\']([^"\']+)["\']([^>]*)>/i',
5536 function ($matches) {
5537 $before = $matches[1];
5538 $src = $matches[2];
5539 $after = $matches[3];
5540
5541 // Extract style attribute if exists
5542 $style = '';
5543 if (preg_match('/style=["\']([^"\']+)["\']/i', $before . $after, $style_match)) {
5544 $style = $style_match[1];
5545 }
5546
5547 return sprintf(
5548 '<div class="ep-lazy-iframe-placeholder" data-ep-lazy-src="%s" data-ep-iframe-style="%s" %s %s style="%s"></div>',
5549 esc_attr($src),
5550 esc_attr($style),
5551 $before,
5552 $after,
5553 esc_attr($style)
5554 );
5555 },
5556 $content
5557 );
5558 }
5559
5560 if ($settings['embedpress_protection_type'] == 'password') {
5561 do_action('embedpress/display_password_form', $client_id, $content, $pass_hash_key, $embed_settings);
5562 } else {
5563 do_action('embedpress/content_protection_content', $client_id, $embed_settings['protectionMessage'], $embed_settings['userRole']);
5564 }
5565 }
5566 ?>
5567 </div>
5568
5569 <?php
5570 $isAdEnabled = !empty($settings['adManager']);
5571 $isContentUnlocked = empty($settings['embedpress_lock_content']);
5572 $isPasswordCorrect = Helper::is_password_correct($client_id) && ($hash_pass === $password_correct);
5573
5574 if ($isAdEnabled && ($isContentUnlocked || $isPasswordCorrect)) {
5575 $content = apply_filters('embedpress/generate_ad_template', $content, $client_id, $settings, 'elementor');
5576 }
5577 ?>
5578
5579 </div>
5580 </div>
5581 </div>
5582 </div>
5583
5584 <?php endif; ?>
5585
5586 </div>
5587
5588
5589 <?php if ($settings['embedpress_pro_embeded_source'] === 'youtube') : ?>
5590 <style>
5591 #ep-elements-id-<?php echo esc_html($this->get_id()); ?>.ep-youtube__content__block .youtube__content__body .content__wrap {
5592 grid-template-columns: repeat(auto-fit, minmax(<?php echo esc_html($calVal); ?>, 1fr)) !important;
5593 }
5594
5595 #ep-elements-id-<?php echo esc_html($this->get_id()); ?>.ep-youtube__content__pagination {
5596 display: <?php echo esc_html($ispagination); ?> !important;
5597 }
5598 </style>
5599 <?php endif; ?>
5600
5601 <?php
5602 }
5603 public function onAfterEmbedSpotify($embed, $setting)
5604 {
5605 if (!isset($embed->provider_name) || strtolower($embed->provider_name) !== 'spotify' || !isset($embed->embed)) {
5606 return $embed;
5607 }
5608 $match = array();
5609 preg_match('/src=\"(.+?)\"/', $embed->embed, $match);
5610 if (empty($match)) {
5611 return $embed;
5612 }
5613 $url_full = $match[1];
5614 $modified_url = str_replace('playlist-v2', 'playlist', $url_full);
5615 if (isset($setting['spotify_theme'])) {
5616 if (strpos($modified_url, '?') !== false) {
5617 $modified_url .= '&theme=' . sanitize_text_field($setting['spotify_theme']);
5618 } else {
5619 $modified_url .= '?theme=' . sanitize_text_field($setting['spotify_theme']);
5620 }
5621 }
5622 $embed->embed = str_replace($url_full, $modified_url, $embed->embed);
5623 return $embed;
5624 }
5625
5626 /**
5627 * Track Elementor widget usage for analytics
5628 *
5629 * @param array $settings
5630 * @param string $content
5631 * @return void
5632 */
5633 protected function track_elementor_usage($settings, &$content)
5634 {
5635 // Only track if analytics is enabled and we have the necessary classes
5636 if (class_exists('EmbedPress\Includes\Classes\Analytics\Analytics_Manager')) {
5637 $url = isset($settings['embedpress_embeded_link']) ? $settings['embedpress_embeded_link'] : '';
5638
5639 if (empty($url)) {
5640 return;
5641 }
5642
5643 $content_id = md5($url . 'elementor');
5644 $provider_name = $this->get_provider_from_url($url);
5645
5646 $tracking_data = [
5647 'embed_type' => $provider_name,
5648 'embed_url' => $url,
5649 'post_id' => get_the_ID(),
5650 'page_url' => get_permalink(),
5651 'title' => get_the_title()
5652 ];
5653
5654 // Add data attribute for frontend tracking
5655 $content = str_replace(
5656 'class="ep-embed-content-wraper',
5657 'data-embedpress-content="' . esc_attr($content_id) . '" data-embed-type="' . esc_attr($provider_name) . '" class="ep-embed-content-wraper',
5658 $content
5659 );
5660
5661 // Track content creation
5662 do_action('embedpress_content_embedded', $content_id, 'elementor', $tracking_data);
5663 }
5664 }
5665
5666 /**
5667 * Get provider name from URL
5668 *
5669 * @param string $url
5670 * @return string
5671 */
5672 protected function get_provider_from_url($url)
5673 {
5674 $providers = [
5675 'youtube.com' => 'YouTube',
5676 'youtu.be' => 'YouTube',
5677 'vimeo.com' => 'Vimeo',
5678 'twitter.com' => 'Twitter',
5679 'instagram.com' => 'Instagram',
5680 'facebook.com' => 'Facebook',
5681 'tiktok.com' => 'TikTok',
5682 'spotify.com' => 'Spotify',
5683 'soundcloud.com' => 'SoundCloud',
5684 'twitch.tv' => 'Twitch',
5685 'docs.google.com' => 'Google Docs',
5686 'drive.google.com' => 'Google Drive',
5687 'calendly.com' => 'Calendly',
5688 'wistia.com' => 'Wistia'
5689 ];
5690
5691 foreach ($providers as $domain => $provider) {
5692 if (strpos($url, $domain) !== false) {
5693 return $provider;
5694 }
5695 }
5696
5697 return 'Unknown';
5698 }
5699 }
5700