Premium Addons for Elementor - Version 2.9.2

Version Description

  • Tweak: Unnecessary functions removed from Counter, Modal Box widgets to enhance performance.
Download this release

Release Info

Developer leap13
Plugin Icon 128x128 Premium Addons for Elementor
Version 2.9.2
Comparing to
See all releases

Code changes from version 2.9.1 to 2.9.2

admin/includes/notices.php CHANGED
@@ -10,6 +10,8 @@ class Premium_Admin_Notices {
10
11
private static $elementor = 'elementor';
12
13
private static $pbg = 'premium-blocks-for-gutenberg';
14
15
/**
@@ -27,6 +29,7 @@ class Premium_Admin_Notices {
27
public function init(){
28
$this->handle_review_notice();
29
$this->handle_pbg_notice();
30
}
31
32
/**
@@ -36,6 +39,7 @@ class Premium_Admin_Notices {
36
$this->required_plugins_check();
37
$this->get_review_notice();
38
$this->get_pbg_notice();
39
}
40
41
/**
@@ -79,6 +83,28 @@ class Premium_Admin_Notices {
79
exit;
80
}
81
82
/**
83
* Shows an admin notice when Elementor is missing.
84
* @since 1.0.0
@@ -207,6 +233,46 @@ class Premium_Admin_Notices {
207
208
}
209
210
/**
211
* Returns the active theme slug
212
*/
10
11
private static $elementor = 'elementor';
12
13
+ private static $papro = 'premium-addons-pro';
14
+
15
private static $pbg = 'premium-blocks-for-gutenberg';
16
17
/**
29
public function init(){
30
$this->handle_review_notice();
31
$this->handle_pbg_notice();
32
+ $this->handle_xmas_notice();
33
}
34
35
/**
39
$this->required_plugins_check();
40
$this->get_review_notice();
41
$this->get_pbg_notice();
42
+ $this->get_xmas_notice();
43
}
44
45
/**
83
exit;
84
}
85
86
+ /**
87
+ * Checks if get Christmas sale message is dismissed.
88
+ * @access public
89
+ * @return void
90
+ */
91
+ public function handle_xmas_notice() {
92
+
93
+ if ( ! isset( $_GET['get_pro_xmas'] ) ) {
94
+ return;
95
+ }
96
+
97
+ if ( 'opt_out' === $_GET['get_pro_xmas'] ) {
98
+ check_admin_referer( 'opt_out' );
99
+
100
+ update_option( 'get_pro_xmas_notice', '1' );
101
+ }
102
+
103
+ wp_redirect( remove_query_arg( 'get_pro_xmas' ) );
104
+ exit;
105
+ }
106
+
107
+
108
/**
109
* Shows an admin notice when Elementor is missing.
110
* @since 1.0.0
233
234
}
235
236
+ /**
237
+ * Shows an admin notice when PAPRO is not installed.
238
+ * @since 2.6.8
239
+ * @return void
240
+ */
241
+ public function get_xmas_notice() {
242
+
243
+ $pro_path = sprintf( '%1$s/%1$s-for-elementor.php', self::$papro);
244
+
245
+ $theme = self::get_installed_theme();
246
+
247
+ $notice_url = sprintf( 'https://premiumaddons.com/christmas?utm_source=christmas-2018-notification&utm_medium=wp-dash&utm_campaign=get-pro&utm_term=%s', $theme );
248
+
249
+ if ( ! self::is_plugin_installed( $pro_path ) && current_user_can( 'install_plugins' ) ) {
250
+
251
+ $get_xmas = get_option( 'get_pro_xmas_notice' );
252
+
253
+ if ( '1' === $get_xmas ) {
254
+ return;
255
+ } else if ( '1' !== $get_xmas ) {
256
+ $optout_url = wp_nonce_url( add_query_arg( 'get_pro_xmas', 'opt_out' ), 'opt_out' );
257
+ ?>
258
+ <div class="error pa-notice-wrap pa-black-notice">
259
+ <div class="pa-img-wrap">
260
+ <img src="<?php echo esc_attr( PREMIUM_ADDONS_URL .'admin/images/premium-addons-logo.png' ); ?>">
261
+ </div>
262
+ <div class="pa-text-wrap">
263
+ <p><strong><?php echo __('Premium Addons for Elementor', 'premium-addons-for-elementor'); ?></strong></p>
264
+ <p>
265
+ <strong><?php echo __('Christmas Sale!', 'premium-addons-for-elementor'); ?></strong> <?php echo __('Get Premium Addons PRO with 15% Discount. ','premium-addons-for-elementor'); ?><a href="<?php echo esc_url( $notice_url ); ?>" target="_blank"><?php echo __('Check it Out','premium-addons-for-elementor'); ?></a>
266
+ </p>
267
+ </div>
268
+ <div class="pa-notice-close"><a href="<?php echo esc_url( $optout_url ); ?>"><span class="dashicons dashicons-dismiss"></span></a></div>
269
+ </div>
270
+ <?php
271
+ }
272
+ }
273
+ }
274
+
275
+
276
/**
277
* Returns the active theme slug
278
*/
admin/settings/version-control.php CHANGED
@@ -79,7 +79,7 @@ class PA_Version_Control {
79
<tr class="pa-roll-row">
80
<th>Rollback Version</th>
81
<td>
82
- <div><?php echo sprintf( '<a target="_blank" href="%s" class="button pa-btn pa-rollback-button elementor-button-spinner">Reinstall Version 2.9.0</a>', wp_nonce_url( admin_url( 'admin-post.php?action=premium_addons_rollback' ), 'premium_addons_rollback' ) ); ?> </div>
83
<p class="pa-roll-desc"><span>Warning: Please backup your database before making the rollback.</span></p>
84
</td>
85
</tr>
79
<tr class="pa-roll-row">
80
<th>Rollback Version</th>
81
<td>
82
+ <div><?php echo sprintf( '<a target="_blank" href="%s" class="button pa-btn pa-rollback-button elementor-button-spinner">Reinstall Version 2.9.1</a>', wp_nonce_url( admin_url( 'admin-post.php?action=premium_addons_rollback' ), 'premium_addons_rollback' ) ); ?> </div>
83
<p class="pa-roll-desc"><span>Warning: Please backup your database before making the rollback.</span></p>
84
</td>
85
</tr>
assets/css/premium-addons.css CHANGED
@@ -1189,7 +1189,7 @@ button.premium-modal-box-modal-close {
1189
width: 100% !important;
1190
}
1191
/*Open Modal Button Style*/
1192
- .premium-modal-box-selector-container .btn-info {
1193
border: none;
1194
-webkit-transition: all 0.3s ease-in-out;
1195
-moz-transition: all 0.3s ease-in-out;
1189
width: 100% !important;
1190
}
1191
/*Open Modal Button Style*/
1192
+ .premium-modal-box-selector-container .premium-modal-box-button-selector {
1193
border: none;
1194
-webkit-transition: all 0.3s ease-in-out;
1195
-moz-transition: all 0.3s ease-in-out;
premium-addons-for-elementor.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: Premium Addons for Elementor
4
Description: Premium Addons Plugin Includes 21+ premium widgets for Elementor Page Builder.
5
Plugin URI: https://premiumaddons.com
6
- Version: 2.9.1
7
Author: Leap13
8
Author URI: http://leap13.com/
9
Text Domain: premium-addons-for-elementor
@@ -22,12 +22,12 @@ if (! function_exists('add_action')) {
22
if ( ! defined('ABSPATH') ) exit; // No access of directly access
23
24
25
- define('PREMIUM_ADDONS_VERSION', '2.9.1');
26
define('PREMIUM_ADDONS_URL', plugins_url('/', __FILE__));
27
define('PREMIUM_ADDONS_PATH', plugin_dir_path(__FILE__));
28
define('PREMIUM_ADDONS_FILE', __FILE__);
29
define('PREMIUM_ADDONS_BASENAME', plugin_basename(__FILE__));
30
- define('PREMIUM_ADDONS_STABLE_VERSION', '2.9.0');
31
32
if( ! class_exists('Premium_Addons_Elementor') ) {
33
/*
3
Plugin Name: Premium Addons for Elementor
4
Description: Premium Addons Plugin Includes 21+ premium widgets for Elementor Page Builder.
5
Plugin URI: https://premiumaddons.com
6
+ Version: 2.9.2
7
Author: Leap13
8
Author URI: http://leap13.com/
9
Text Domain: premium-addons-for-elementor
22
if ( ! defined('ABSPATH') ) exit; // No access of directly access
23
24
25
+ define('PREMIUM_ADDONS_VERSION', '2.9.2');
26
define('PREMIUM_ADDONS_URL', plugins_url('/', __FILE__));
27
define('PREMIUM_ADDONS_PATH', plugin_dir_path(__FILE__));
28
define('PREMIUM_ADDONS_FILE', __FILE__);
29
define('PREMIUM_ADDONS_BASENAME', plugin_basename(__FILE__));
30
+ define('PREMIUM_ADDONS_STABLE_VERSION', '2.9.1');
31
32
if( ! class_exists('Premium_Addons_Elementor') ) {
33
/*
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: http://premiumaddons.com
5
Requires at least: 4.5
6
Tested up to: 5.0.1
7
Requires PHP: 5.4
8
- Stable tag: 2.9.1
9
License: GPL v3.0
10
License URI: https://opensource.org/licenses/GPL-3.0
11
@@ -137,6 +137,10 @@ Premium Addons for Elementor is 100% Ads Free, Ads can only be detected from You
137
138
== Changelog ==
139
140
= 2.9.1 =
141
142
- Tweak: Ability to change default active category with `First Category` option enabled in Premium Grid widget.
5
Requires at least: 4.5
6
Tested up to: 5.0.1
7
Requires PHP: 5.4
8
+ Stable tag: 2.9.2
9
License: GPL v3.0
10
License URI: https://opensource.org/licenses/GPL-3.0
11
137
138
== Changelog ==
139
140
+ = 2.9.2 =
141
+
142
+ - Tweak: Unnecessary functions removed from Counter, Modal Box widgets to enhance performance.
143
+
144
= 2.9.1 =
145
146
- Tweak: Ability to change default active category with `First Category` option enabled in Premium Grid widget.
widgets/premium-counter.php CHANGED
@@ -482,19 +482,65 @@ class Premium_Counter extends Widget_Base {
482
$this->end_controls_section();
483
484
}
485
486
protected function render() {
487
$settings = $this->get_settings_for_display();
488
489
$this->add_inline_editing_attributes('premium_counter_title');
490
491
- if( $sep = $settings['premium_counter_t_separator'] ) {
492
- $separator = $sep;
493
- }
494
- if( $dec = $settings['premium_counter_t_separator'] ) {
495
- $decimal = $dec;
496
- }
497
-
498
if( $settings['premium_counter_icon_image'] == 'icon' ) {
499
$icon_image = '<i class="' . $settings['premium_counter_icon'] .'"></i>';
500
} else {
@@ -502,27 +548,15 @@ class Premium_Counter extends Widget_Base {
502
$icon_image = '<img class="custom-image" src="'.$settings['premium_counter_image_upload']['url'] . '" alt="' . $alt . '">';
503
}
504
505
- $icon_style = $settings['premium_counter_icon_style'] != 'simple' ? ' icon-bg ' . $settings['premium_counter_icon_style'] : '';
506
-
507
- $animation = $settings['premium_counter_icon_animation'];
508
-
509
$position = $settings['premium_counter_icon_position'];
510
511
- if($position == 'top') {
512
- $center = ' center';
513
- } else {
514
- $center = '';
515
- }
516
- if($position == 'left'){
517
- $left = ' left';
518
- } else {
519
- $left = '';
520
- }
521
522
$d_after = intval( $settings['premium_counter_d_after'] );
523
- $d_s = $settings['premium_counter_d_separator'];
524
- $t_s = $settings['premium_counter_t_separator'];
525
- $exact_value = number_format( $settings['premium_counter_value'] , $d_after, $d_s, $t_s );
526
$flex_width = '';
527
if( $settings['premium_counter_icon_image'] == 'custom' && $settings['premium_counter_icon_style'] == 'simple' ) {
528
$flex_width = ' flex-width ';
@@ -536,49 +570,32 @@ class Premium_Counter extends Widget_Base {
536
'separator' => $separator,
537
'decimal' => $decimal,
538
];
539
540
?>
541
- <div id="counter-wrapper-<?php echo esc_attr($this->get_id()); ?>" class="premium-counter premium-counter-area<?php echo $center; ?>" data-settings='<?php echo wp_json_encode($counter_settings); ?>'>
542
- <?php if( $settings['premium_counter_icon_position'] == 'right' ) : ?>
543
- <div class="premium-init-wrapper <?php echo $settings['premium_counter_icon_position']; ?>">
544
-
545
- <?php if (!empty( $settings['premium_counter_preffix'] ) ) : ?><span id="prefix" class="counter-su-pre"><?php echo $settings['premium_counter_preffix']; ?></span><?php endif; ?>
546
-
547
- <span class="premium-counter-init" id="counter-<?php echo esc_attr($this->get_id()); ?>"><?php echo $exact_value; ?></span>
548
-
549
- <?php if (!empty( $settings['premium_counter_suffix'] ) ) : ?><span id="suffix" class="counter-su-pre"><?php echo $settings['premium_counter_suffix']; ?></span><?php endif; ?>
550
-
551
- <?php if (!empty( $settings['premium_counter_title'] ) ) : ?><h4 class="premium-counter-title"><div <?php echo $this->get_render_attribute_string('premium_counter_title'); ?>><?php echo $settings['premium_counter_title'];?></div></h4><?php endif; ?>
552
- </div>
553
-
554
- <?php if( !empty( $settings['premium_counter_icon'] ) || !empty( $settings['premium_counter_image_upload'] ) ) : ?>
555
- <div class="premium-counter-icon <?php echo $settings['premium_counter_icon_position']; ?>">
556
- <span data-animation="<?php echo $animation; ?>" class="icon<?php echo $flex_width; ?><?php echo $icon_style; ?>"><?php echo $icon_image; ?></span>
557
- </div>
558
- <?php endif; ?>
559
-
560
- <?php else: ?>
561
-
562
- <?php if( !empty( $settings['premium_counter_icon'] ) || !empty( $settings['premium_counter_image_upload'] ) ) : ?>
563
- <div class="premium-counter-icon<?php echo $left; ?>">
564
- <span data-animation="<?php echo $animation; ?>" class="icon<?php echo $flex_width; ?><?php echo $icon_style; ?>"><?php echo $icon_image; ?></span>
565
- </div>
566
- <?php endif; ?>
567
-
568
- <div class="premium-init-wrapper<?php echo $left; ?>">
569
-
570
- <?php if (!empty( $settings['premium_counter_preffix'] ) ) : ?><span id="prefix" class="counter-su-pre"><?php echo $settings['premium_counter_preffix']; ?></span><?php endif; ?>
571
-
572
- <span class="premium-counter-init" id="counter-<?php echo esc_attr($this->get_id()); ?>"><?php echo $exact_value; ?></span>
573
-
574
- <?php if (!empty( $settings['premium_counter_suffix'] ) ) : ?><span id="suffix" class="counter-su-pre"><?php echo $settings['premium_counter_suffix']; ?></span><?php endif; ?>
575
-
576
- <?php if (!empty( $settings['premium_counter_title'] ) ) : ?><h4 class="premium-counter-title"><div <?php echo $this->get_render_attribute_string('premium_counter_title'); ?>><?php echo $settings['premium_counter_title'];?></div></h4><?php endif; ?>
577
- </div>
578
-
579
- <?php endif; ?>
580
-
581
- </div>
582
583
<?php
584
}
482
$this->end_controls_section();
483
484
}
485
+
486
+ public function get_counter_content($settings, $direction) {
487
+
488
+ $d_after = intval( $settings['premium_counter_d_after'] );
489
+ $d_s = $settings['premium_counter_d_separator'];
490
+ $t_s = $settings['premium_counter_t_separator'];
491
+ $exact_value = number_format( $settings['premium_counter_value'] , $d_after, $d_s, $t_s );
492
+
493
+ ?>
494
+
495
+ <div class="premium-init-wrapper <?php echo $direction; ?>">
496
+
497
+ <?php if ( ! empty( $settings['premium_counter_preffix'] ) ) : ?><span id="prefix" class="counter-su-pre"><?php echo $settings['premium_counter_preffix']; ?></span><?php endif; ?>
498
+
499
+ <span class="premium-counter-init" id="counter-<?php echo esc_attr($this->get_id()); ?>"><?php echo $exact_value; ?></span>
500
+
501
+ <?php if (!empty( $settings['premium_counter_suffix'] ) ) : ?><span id="suffix" class="counter-su-pre"><?php echo $settings['premium_counter_suffix']; ?></span><?php endif; ?>
502
+
503
+ <?php if ( ! empty( $settings['premium_counter_title'] ) ) : ?><h4 class="premium-counter-title"><div <?php echo $this->get_render_attribute_string('premium_counter_title'); ?>><?php echo $settings['premium_counter_title'];?></div></h4><?php endif; ?>
504
+ </div>
505
+
506
+ <?php
507
+ }
508
+
509
+ public function get_counter_icon($settings, $direction) {
510
+
511
+ $icon_style = $settings['premium_counter_icon_style'] != 'simple' ? ' icon-bg ' . $settings['premium_counter_icon_style'] : '';
512
+
513
+ $animation = $settings['premium_counter_icon_animation'];
514
+
515
+ $flex_width = '';
516
+ if( $settings['premium_counter_icon_image'] == 'custom' && $settings['premium_counter_icon_style'] == 'simple' ) {
517
+ $flex_width = ' flex-width ';
518
+ }
519
+
520
+ if( $settings['premium_counter_icon_image'] == 'icon' ) {
521
+ $icon_image = '<i class="' . $settings['premium_counter_icon'] .'"></i>';
522
+ } else {
523
+ $alt = esc_attr( Control_Media::get_image_alt( $settings['premium_counter_image_upload'] ) );
524
+ $icon_image = '<img class="custom-image" src="'.$settings['premium_counter_image_upload']['url'] . '" alt="' . $alt . '">';
525
+ }
526
+ ?>
527
+
528
+ <div class="premium-counter-icon <?php echo $direction; ?>">
529
+ <span data-animation="<?php echo $animation; ?>" class="icon<?php echo $flex_width; ?><?php echo $icon_style; ?>"><?php echo $icon_image; ?></span>
530
+ </div>
531
+
532
+ <?php
533
+ }
534
535
protected function render() {
536
$settings = $this->get_settings_for_display();
537
538
$this->add_inline_editing_attributes('premium_counter_title');
539
+
540
+ $separator = $settings['premium_counter_t_separator'];
541
542
+ $decimal = $settings['premium_counter_d_separator'];
543
+
544
if( $settings['premium_counter_icon_image'] == 'icon' ) {
545
$icon_image = '<i class="' . $settings['premium_counter_icon'] .'"></i>';
546
} else {
548
$icon_image = '<img class="custom-image" src="'.$settings['premium_counter_image_upload']['url'] . '" alt="' . $alt . '">';
549
}
550
551
$position = $settings['premium_counter_icon_position'];
552
553
+ $center = $position == 'top' ? ' center' : '';
554
+
555
+ $left = $position == 'left' ? ' left' : '';
556
+
557
558
$d_after = intval( $settings['premium_counter_d_after'] );
559
+
560
$flex_width = '';
561
if( $settings['premium_counter_icon_image'] == 'custom' && $settings['premium_counter_icon_style'] == 'simple' ) {
562
$flex_width = ' flex-width ';
570
'separator' => $separator,
571
'decimal' => $decimal,
572
];
573
+
574
+ $this->add_render_attribute( 'counter', 'id', 'counter-wrapper-'. $this->get_id() );
575
+
576
+ $this->add_render_attribute( 'counter', 'class', [ 'premium-counter', 'premium-counter-area' . $center ] );
577
+
578
+ $this->add_render_attribute( 'counter', 'data-settings', wp_json_encode( $counter_settings ) );
579
580
?>
581
+
582
+ <div <?php echo $this->get_render_attribute_string('counter'); ?>>
583
+ <?php if( $position == 'right' ) {
584
+ $this->get_counter_content($settings, $position);
585
+ if( ! empty( $settings['premium_counter_icon'] ) || !empty( $settings['premium_counter_image_upload'] ) ) {
586
+ $this->get_counter_icon($settings, $position);
587
+ }
588
+
589
+ } else {
590
+ if( !empty( $settings['premium_counter_icon'] ) || !empty( $settings['premium_counter_image_upload'] ) ) {
591
+ $this->get_counter_icon($settings, $left);
592
+ }
593
+ $this->get_counter_content($settings, $left);
594
+ ?>
595
+
596
+ <?php } ?>
597
+
598
+ </div>
599
600
<?php
601
}
widgets/premium-modalbox.php CHANGED
@@ -1263,75 +1263,102 @@ class Premium_Modalbox extends Widget_Base {
1263
1264
$button_icon = $settings['premium_modal_box_button_icon_selection'];
1265
1266
-
1267
$elementor_post_id = $settings['premium_modal_box_content_temp'];
1268
$premium_elements_frontend = new Frontend;
1269
$modal_settings = [
1270
'trigger' => $settings['premium_modal_box_display_on'],
1271
'delay' => $settings['premium_modal_box_popup_delay'],
1272
];
1273
?>
1274
1275
1276
- <div class="container premium-modal-box-container" data-settings='<?php echo wp_json_encode($modal_settings); ?>'>
1277
- <!-- Trigger The Modal Box -->
1278
- <div class="premium-modal-box-selector-container">
1279
- <?php
1280
- if ( $settings['premium_modal_box_display_on'] === 'button' ) : ?>
1281
- <button type="button" class="premium-modal-box-button-selector btn btn-info <?php
1282
- if( $settings['premium_modal_box_button_size'] === 'sm' ) : echo "premium-btn-sm";
1283
- elseif( $settings['premium_modal_box_button_size'] === 'md' ) : echo "premium-btn-md";
1284
- elseif( $settings['premium_modal_box_button_size'] === 'lg' ) : echo "premium-btn-lg";
1285
- elseif( $settings['premium_modal_box_button_size'] === 'block' ) : echo "premium-btn-block"; endif; ?>" data-toggle="premium-modal" data-target="#premium-modal-<?php echo esc_attr( $this->get_id() ); ?>"><?php if($settings['premium_modal_box_icon_switcher'] && $settings['premium_modal_box_icon_position'] == 'before' && !empty($settings['premium_modal_box_button_icon_selection'])) : ?><i class="fa <?php echo esc_attr($button_icon); ?>"></i><?php endif; ?><span><?php echo $settings['premium_modal_box_button_text']; ?></span><?php if($settings['premium_modal_box_icon_switcher'] && $settings['premium_modal_box_icon_position'] == 'after' &&!empty($settings['premium_modal_box_button_icon_selection'])) : ?><i class="fa <?php echo esc_attr($button_icon); ?>"></i><?php endif; ?></button>
1286
- <?php elseif ( $settings['premium_modal_box_display_on'] === 'image' ) : ?>
1287
- <img class="premium-modal-box-img-selector" data-toggle="premium-modal" data-target="#premium-modal-<?php echo esc_attr( $this->get_id() ); ?>" src="<?php echo $settings['premium_modal_box_image_src']['url'];?>">
1288
- <?php elseif($settings['premium_modal_box_display_on'] === 'text') : ?>
1289
- <span class="premium-modal-box-text-selector" data-toggle="premium-modal" data-target="#premium-modal-<?php echo esc_attr( $this->get_id() ); ?>"><div <?php echo $this->get_render_attribute_string('premium_modal_box_selector_text'); ?>><?php echo $settings['premium_modal_box_selector_text'];?></div></span>
1290
- <?php endif; ?>
1291
- </div>
1292
-
1293
- <!-- Modal -->
1294
- <div id="premium-modal-<?php echo $this->get_id(); ?>" class="premium-modal-box-modal premium-modal-fade" role="dialog">
1295
- <div class="premium-modal-box-modal-dialog">
1296
-
1297
- <!-- Modal content-->
1298
- <div class="premium-modal-box-modal-content">
1299
- <?php if($settings['premium_modal_box_header_switcher'] == 'yes'): ?>
1300
- <div class="premium-modal-box-modal-header">
1301
- <?php if ( $settings['premium_modal_box_upper_close'] === 'yes' ) : ?>
1302
- <div class="premium-modal-box-close-button-container">
1303
- <button type="button" class="premium-modal-box-modal-close" data-dismiss="premium-modal">&times;</button>
1304
</div>
1305
<?php endif; ?>
1306
- <h3 class="premium-modal-box-modal-title">
1307
- <?php if($settings['premium_modal_box_icon_selection'] === 'fonticon') : ?>
1308
- <i class="fa <?php echo $settings['premium_modal_box_font_icon'];?>"></i>
1309
- <?php elseif( $settings['premium_modal_box_icon_selection'] === 'image' ) : ?>
1310
- <img src="<?php echo $settings['premium_modal_box_image_icon']['url'];?>">
1311
- <?php endif; ?><?php echo $settings['premium_modal_box_title'];?></h3>
1312
</div>
1313
- <?php endif; ?>
1314
- <div class="premium-modal-box-modal-body">
1315
- <?php if($settings['premium_modal_box_content_type'] == 'editor') : echo $this->parse_text_editor($settings['premium_modal_box_content']); else: echo $premium_elements_frontend->get_builder_content($elementor_post_id, true); endif; ?>
1316
- </div>
1317
- <?php if ( $settings['premium_modal_box_lower_close'] === 'yes' ) : ?>
1318
- <div class="premium-modal-box-modal-footer">
1319
- <button type="button" class="btn premium-modal-box-modal-lower-close" data-dismiss="premium-modal"><?php echo $settings['premium_modal_close_text']; ?></button>
1320
- </div>
1321
- <?php endif; ?>
1322
- </div>
1323
</div>
1324
- </div>
1325
</div>
1326
<style>
1327
-
1328
- <?php if( !empty($settings['premium_modal_box_modal_size']['size'] ) ) :
1329
echo '@media (min-width:992px) {'; ?>
1330
#premium-modal-<?php echo $this->get_id(); ?> .premium-modal-box-modal-dialog {
1331
width: <?php echo $settings['premium_modal_box_modal_size']['size'] . $settings['premium_modal_box_modal_size']['unit']; ?>
1332
}
1333
<?php echo '}'; endif; ?>
1334
-
1335
</style>
1336
1337
<?php
1263
1264
$button_icon = $settings['premium_modal_box_button_icon_selection'];
1265
1266
$elementor_post_id = $settings['premium_modal_box_content_temp'];
1267
$premium_elements_frontend = new Frontend;
1268
$modal_settings = [
1269
'trigger' => $settings['premium_modal_box_display_on'],
1270
'delay' => $settings['premium_modal_box_popup_delay'],
1271
];
1272
+
1273
+ $this->add_render_attribute('modal', 'class', [ 'container', 'premium-modal-box-container' ] );
1274
+
1275
+ $this->add_render_attribute('modal', 'data-settings', wp_json_encode($modal_settings) );
1276
+
1277
+ $this->add_render_attribute('button', 'type', 'button' );
1278
+
1279
+ $this->add_render_attribute('button', 'class', [ 'premium-modal-box-button-selector', 'premium-btn-' . $settings['premium_modal_box_button_size'] ] );
1280
+
1281
+ $this->add_render_attribute('button', 'data-toggle', 'premium-modal' );
1282
+
1283
+ $this->add_render_attribute('button', 'data-target', '#premium-modal-' . $this->get_id() );
1284
+
1285
+ $this->add_render_attribute('image', 'class', 'premium-modal-box-img-selector' );
1286
+
1287
+ $this->add_render_attribute('image', 'data-toggle', 'premium-modal' );
1288
+
1289
+ $this->add_render_attribute('image', 'data-target', '#premium-modal-' . $this->get_id() );
1290
+
1291
+ $this->add_render_attribute('image', 'src', $settings['premium_modal_box_image_src']['url'] );
1292
+
1293
+ $this->add_render_attribute('text', 'class', 'premium-modal-box-text-selector' );
1294
+
1295
+ $this->add_render_attribute('text', 'data-toggle', 'premium-modal' );
1296
+
1297
+ $this->add_render_attribute('text', 'data-target', '#premium-modal-' . $this->get_id() );
1298
+
1299
?>
1300
1301
+ <div <?php echo $this->get_render_attribute_string('modal') ?>>
1302
+ <div class="premium-modal-box-selector-container">
1303
+ <?php
1304
+ if ( $settings['premium_modal_box_display_on'] === 'button' ) : ?>
1305
+ <button <?php echo $this->get_render_attribute_string('button'); ?>>
1306
+ <?php if( $settings['premium_modal_box_icon_switcher'] && $settings['premium_modal_box_icon_position'] == 'before' && ! empty( $settings['premium_modal_box_button_icon_selection'] ) ) : ?>
1307
+ <i class="fa <?php echo esc_attr( $button_icon ); ?>"></i>
1308
+ <?php endif; ?>
1309
+ <span><?php echo $settings['premium_modal_box_button_text']; ?></span>
1310
+ <?php if( $settings['premium_modal_box_icon_switcher'] && $settings['premium_modal_box_icon_position'] == 'after' && ! empty( $settings['premium_modal_box_button_icon_selection'] ) ) : ?>
1311
+ <i class="fa <?php echo esc_attr( $button_icon ); ?>"></i>
1312
+ <?php endif; ?>
1313
+ </button>
1314
+ <?php elseif ( $settings['premium_modal_box_display_on'] === 'image' ) : ?>
1315
+ <img <?php echo $this->get_render_attribute_string('image'); ?>>
1316
+ <?php elseif($settings['premium_modal_box_display_on'] === 'text') : ?>
1317
+ <span <?php echo $this->get_render_attribute_string('text'); ?>><div <?php echo $this->get_render_attribute_string('premium_modal_box_selector_text'); ?>><?php echo $settings['premium_modal_box_selector_text'];?></div></span>
1318
+ <?php endif; ?>
1319
+ </div>
1320
1321
+ <div id="premium-modal-<?php echo $this->get_id(); ?>" class="premium-modal-box-modal premium-modal-fade" role="dialog">
1322
+ <div class="premium-modal-box-modal-dialog">
1323
+ <div class="premium-modal-box-modal-content">
1324
+ <?php if($settings['premium_modal_box_header_switcher'] == 'yes') : ?>
1325
+ <div class="premium-modal-box-modal-header">
1326
+ <?php if ( $settings['premium_modal_box_upper_close'] === 'yes' ) : ?>
1327
+ <div class="premium-modal-box-close-button-container">
1328
+ <button type="button" class="premium-modal-box-modal-close" data-dismiss="premium-modal">&times;</button>
1329
+ </div>
1330
+ <?php endif; ?>
1331
+ <h3 class="premium-modal-box-modal-title">
1332
+ <?php if( $settings['premium_modal_box_icon_selection'] === 'fonticon' ) : ?>
1333
+ <i class="fa <?php echo $settings['premium_modal_box_font_icon'];?>"></i>
1334
+ <?php elseif( $settings['premium_modal_box_icon_selection'] === 'image' ) : ?>
1335
+ <img src="<?php echo $settings['premium_modal_box_image_icon']['url'];?>">
1336
+ <?php endif;
1337
+ echo $settings['premium_modal_box_title']; ?>
1338
+ </h3>
1339
+ </div>
1340
+ <?php endif; ?>
1341
+ <div class="premium-modal-box-modal-body">
1342
+ <?php if( $settings['premium_modal_box_content_type'] == 'editor' ) : echo $this->parse_text_editor( $settings['premium_modal_box_content'] ); else: echo $premium_elements_frontend->get_builder_content( $elementor_post_id, true ); endif; ?>
1343
</div>
1344
+ <?php if ( $settings['premium_modal_box_lower_close'] === 'yes' ) : ?>
1345
+ <div class="premium-modal-box-modal-footer">
1346
+ <button type="button" class="premium-modal-box-modal-lower-close" data-dismiss="premium-modal">
1347
+ <?php echo $settings['premium_modal_close_text']; ?>
1348
+ </button>
1349
+ </div>
1350
<?php endif; ?>
1351
+ </div>
1352
</div>
1353
</div>
1354
</div>
1355
<style>
1356
+ <?php if( ! empty($settings['premium_modal_box_modal_size']['size'] ) ) :
1357
echo '@media (min-width:992px) {'; ?>
1358
#premium-modal-<?php echo $this->get_id(); ?> .premium-modal-box-modal-dialog {
1359
width: <?php echo $settings['premium_modal_box_modal_size']['size'] . $settings['premium_modal_box_modal_size']['unit']; ?>
1360
}
1361
<?php echo '}'; endif; ?>
1362
</style>
1363
1364
<?php
widgets/premium-videobox.php CHANGED
@@ -98,7 +98,7 @@ class Premium_Videobox extends Widget_Base {
98
$this->add_control('premium_video_box_video_embed',
99
[
100
'label' => esc_html__('Embed URL', 'premium-addons-for-elementor'),
101
- 'description' => esc_html__('Enter your YouTube/Vimeo video link. For example, https://www.youtube.com/embed/z1hQgVpfTKU.', 'premium-addons-for-elementor'),
102
'type' => Controls_Manager::TEXT,
103
'condition' => [
104
'premium_video_box_video_type!' => 'self',
98
$this->add_control('premium_video_box_video_embed',
99
[
100
'label' => esc_html__('Embed URL', 'premium-addons-for-elementor'),
101
+ 'description' => esc_html__('Enter your YouTube/Vimeo video link. For example, https://www.youtube.com/embed/z1hQgVpfTKU', 'premium-addons-for-elementor'),
102
'type' => Controls_Manager::TEXT,
103
'condition' => [
104
'premium_video_box_video_type!' => 'self',