Premium Addons for Elementor - Version 3.2.1

Version Description

  • Tweak: Added Minimum Number of Images option for load more button in Grid widget.
  • Tweak: Added Images to Show option for load more button in Grid widget.
Download this release

Release Info

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

Code changes from version 3.2.0 to 3.2.1

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 3.1.8</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 3.2.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>
assets/js/premium-addons.js CHANGED
@@ -66,10 +66,10 @@
66
/****** Premium Grid Handler ******/
67
var PremiumGridWidgetHandler = function($scope, $) {
68
var galleryElement = $scope.find(".premium-gallery-container"),
69
- isotopeOptions = galleryElement.data("settings"),
70
- layout = isotopeOptions['img_size'],
71
deviceType = $("body").data("elementor-device-mode"),
72
- loadMore = isotopeOptions['load_more'],
73
columnWidth = null;
74
75
if( layout === 'metro' ) {
@@ -109,7 +109,7 @@
109
duration: 750,
110
easing: "linear"
111
},
112
- filter: isotopeOptions["active_cat"],
113
layoutMode: layout,
114
masonry: {
115
columnWidth: columnWidth
@@ -118,12 +118,16 @@
118
});
119
120
if ( loadMore ) {
121
galleryElement.parent().find('.premium-gallery-load-more div').hide();
122
- if ( galleryElement.find(".premium-gallery-item").length > 6 ) {
123
galleryElement.parent().find('.premium-gallery-load-more').removeClass('premium-gallery-btn-hidden');
124
- galleryElement.find(".premium-gallery-item:gt(5)").hide();
125
function appendItems() {
126
- var itemsToShow = galleryElement.find(".premium-gallery-item").filter(':hidden').slice(0, 6);
127
if ( itemsToShow.length > 0 ) {
128
itemsToShow.show();
129
galleryElement.isotope('layout');
@@ -136,7 +140,7 @@
136
galleryElement.parent().find('.premium-gallery-load-more div').show();
137
},
138
success: function() {
139
- var itemsLeft = galleryElement.find(".premium-gallery-item").filter(':hidden').slice(0, 6);
140
if ( itemsLeft.length > 0 ) {
141
galleryElement.parent().find('.premium-gallery-load-more div').hide();
142
} else {
@@ -165,7 +169,7 @@
165
opacity: 0.7,
166
show_title: false,
167
deeplinking: false,
168
- overlay_gallery: isotopeOptions['overlay_gallery'],
169
custom_markup: "",
170
default_width: 900,
171
default_height: 506,
66
/****** Premium Grid Handler ******/
67
var PremiumGridWidgetHandler = function($scope, $) {
68
var galleryElement = $scope.find(".premium-gallery-container"),
69
+ gridSettings = galleryElement.data("settings"),
70
+ layout = gridSettings['img_size'],
71
deviceType = $("body").data("elementor-device-mode"),
72
+ loadMore = gridSettings['load_more'],
73
columnWidth = null;
74
75
if( layout === 'metro' ) {
109
duration: 750,
110
easing: "linear"
111
},
112
+ filter: gridSettings["active_cat"],
113
layoutMode: layout,
114
masonry: {
115
columnWidth: columnWidth
118
});
119
120
if ( loadMore ) {
121
+
122
+ var minimum = gridSettings['minimum'],
123
+ imageToShow = gridSettings['click_images'];
124
+
125
galleryElement.parent().find('.premium-gallery-load-more div').hide();
126
+ if ( galleryElement.find(".premium-gallery-item").length > minimum ) {
127
galleryElement.parent().find('.premium-gallery-load-more').removeClass('premium-gallery-btn-hidden');
128
+ galleryElement.find(".premium-gallery-item:gt(" + ( minimum - 1 ) + ")").hide();
129
function appendItems() {
130
+ var itemsToShow = galleryElement.find(".premium-gallery-item").filter(':hidden').slice( 0, imageToShow );
131
if ( itemsToShow.length > 0 ) {
132
itemsToShow.show();
133
galleryElement.isotope('layout');
140
galleryElement.parent().find('.premium-gallery-load-more div').show();
141
},
142
success: function() {
143
+ var itemsLeft = galleryElement.find(".premium-gallery-item").filter(':hidden').slice( 0, imageToShow );
144
if ( itemsLeft.length > 0 ) {
145
galleryElement.parent().find('.premium-gallery-load-more div').hide();
146
} else {
169
opacity: 0.7,
170
show_title: false,
171
deeplinking: false,
172
+ overlay_gallery: gridSettings['overlay_gallery'],
173
custom_markup: "",
174
default_width: 900,
175
default_height: 506,
premium-addons-for-elementor.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: Premium Addons for Elementor
4
Description: Premium Addons Plugin Includes 22+ premium widgets for Elementor Page Builder.
5
Plugin URI: https://premiumaddons.com
6
- Version: 3.2.0
7
Author: Leap13
8
Author URI: http://leap13.com/
9
Text Domain: premium-addons-for-elementor
@@ -14,12 +14,12 @@ License: GNU General Public License v3.0
14
if ( ! defined('ABSPATH') ) exit; // No access of directly access
15
16
// Define Constants
17
- define('PREMIUM_ADDONS_VERSION', '3.2.0');
18
define('PREMIUM_ADDONS_URL', plugins_url('/', __FILE__));
19
define('PREMIUM_ADDONS_PATH', plugin_dir_path(__FILE__));
20
define('PREMIUM_ADDONS_FILE', __FILE__);
21
define('PREMIUM_ADDONS_BASENAME', plugin_basename(PREMIUM_ADDONS_FILE));
22
- define('PREMIUM_ADDONS_STABLE_VERSION', '3.1.9');
23
24
if( ! class_exists('Premium_Addons_Elementor') ) {
25
/*
3
Plugin Name: Premium Addons for Elementor
4
Description: Premium Addons Plugin Includes 22+ premium widgets for Elementor Page Builder.
5
Plugin URI: https://premiumaddons.com
6
+ Version: 3.2.1
7
Author: Leap13
8
Author URI: http://leap13.com/
9
Text Domain: premium-addons-for-elementor
14
if ( ! defined('ABSPATH') ) exit; // No access of directly access
15
16
// Define Constants
17
+ define('PREMIUM_ADDONS_VERSION', '3.2.1');
18
define('PREMIUM_ADDONS_URL', plugins_url('/', __FILE__));
19
define('PREMIUM_ADDONS_PATH', plugin_dir_path(__FILE__));
20
define('PREMIUM_ADDONS_FILE', __FILE__);
21
define('PREMIUM_ADDONS_BASENAME', plugin_basename(PREMIUM_ADDONS_FILE));
22
+ define('PREMIUM_ADDONS_STABLE_VERSION', '3.2.0');
23
24
if( ! class_exists('Premium_Addons_Elementor') ) {
25
/*
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
- === Premium Addons for Elementor ===
2
Contributors: leap13
3
Tags: Elementor, Elementor Page Builder, Elements, Elementor Addons, Add-ons, page builder, widgets, Elementor widgets
4
Donate link: http://premiumaddons.com
5
Requires at least: 4.5
6
Tested up to: 5.1.1
7
Requires PHP: 5.4
8
- Stable tag: 3.2.0
9
License: GPL v3.0
10
License URI: https://opensource.org/licenses/GPL-3.0
11
@@ -139,6 +139,11 @@ Premium Addons for Elementor is 100% Ads Free, Ads can only be detected from You
139
140
== Changelog ==
141
142
= 3.2.0 =
143
144
- Fixed: `Fatal error: call to undefined function` in v3.1.9
1
+ === Premium Addons for Elementor ===
2
Contributors: leap13
3
Tags: Elementor, Elementor Page Builder, Elements, Elementor Addons, Add-ons, page builder, widgets, Elementor widgets
4
Donate link: http://premiumaddons.com
5
Requires at least: 4.5
6
Tested up to: 5.1.1
7
Requires PHP: 5.4
8
+ Stable tag: 3.2.1
9
License: GPL v3.0
10
License URI: https://opensource.org/licenses/GPL-3.0
11
139
140
== Changelog ==
141
142
+ = 3.2.1 =
143
+
144
+ - Tweak: Added `Minimum Number of Images` option for load more button in Grid widget.
145
+ - Tweak: Added `Images to Show` option for load more button in Grid widget.
146
+
147
= 3.2.0 =
148
149
- Fixed: `Fatal error: call to undefined function` in v3.1.9
widgets/premium-grid.php CHANGED
@@ -123,30 +123,57 @@ class Premium_Grid extends Widget_Base {
123
]
124
);
125
126
$this->add_responsive_control('premium_gallery_load_more_align',
127
- [
128
- 'label' => __( 'Button Alignment', 'premium-addons-for-elementor' ),
129
- 'type' => Controls_Manager::CHOOSE,
130
- 'options' => [
131
- 'left' => [
132
- 'title'=> __( 'Left', 'premium-addons-for-elementor' ),
133
- 'icon' => 'fa fa-align-left',
134
- ],
135
- 'center' => [
136
- 'title'=> __( 'Center', 'premium-addons-for-elementor' ),
137
- 'icon' => 'fa fa-align-center',
138
- ],
139
- 'right' => [
140
- 'title'=> __( 'Right', 'premium-addons-for-elementor' ),
141
- 'icon' => 'fa fa-align-right',
142
- ],
143
- ],
144
- 'default' => 'center',
145
- 'selectors' => [
146
- '{{WRAPPER}} .premium-gallery-load-more' => 'text-align: {{VALUE}};',
147
- ],
148
- ]
149
- );
150
151
$this->end_controls_section();
152
@@ -1440,13 +1467,20 @@ class Premium_Grid extends Widget_Base {
1440
$settings['premium_gallery_img_size_select'] = 'fitRows';
1441
}
1442
1443
$grid_settings = [
1444
'img_size' => $settings['premium_gallery_img_size_select'],
1445
'filter' => $settings['premium_gallery_filter'],
1446
'light_box' => $settings['premium_gallery_light_box'],
1447
- 'overlay_gallery'=> 'yes' == $settings['premium_gallery_overlay_gallery'] ? true : false,
1448
'active_cat' => $category_formatted,
1449
- 'load_more' => 'yes' == $settings['premium_gallery_load_more'] ? true : false,
1450
];
1451
1452
$this->add_render_attribute( 'grid', [
123
]
124
);
125
126
+ $this->add_control( 'premium_gallery_load_minimum',
127
+ [
128
+ 'label' => __('Minimum Number of Images', 'premium-addons-for-elementor'),
129
+ 'type' => Controls_Manager::NUMBER,
130
+ 'description' => __('Set the minimum number of images before showing load more button', 'premium-addons-for-elementor'),
131
+ 'default' => 6,
132
+ 'condition' => [
133
+ 'premium_gallery_load_more' => 'yes'
134
+ ]
135
+ ]
136
+ );
137
+
138
+ $this->add_control( 'premium_gallery_load_click_number',
139
+ [
140
+ 'label' => __('Images to Show', 'premium-addons-for-elementor'),
141
+ 'type' => Controls_Manager::NUMBER,
142
+ 'description' => __('Set the minimum number of images to show with each click', 'premium-addons-for-elementor'),
143
+ 'default' => 6,
144
+ 'condition' => [
145
+ 'premium_gallery_load_more' => 'yes'
146
+ ]
147
+ ]
148
+ );
149
+
150
$this->add_responsive_control('premium_gallery_load_more_align',
151
+ [
152
+ 'label' => __( 'Button Alignment', 'premium-addons-for-elementor' ),
153
+ 'type' => Controls_Manager::CHOOSE,
154
+ 'options' => [
155
+ 'left' => [
156
+ 'title'=> __( 'Left', 'premium-addons-for-elementor' ),
157
+ 'icon' => 'fa fa-align-left',
158
+ ],
159
+ 'center' => [
160
+ 'title'=> __( 'Center', 'premium-addons-for-elementor' ),
161
+ 'icon' => 'fa fa-align-center',
162
+ ],
163
+ 'right' => [
164
+ 'title'=> __( 'Right', 'premium-addons-for-elementor' ),
165
+ 'icon' => 'fa fa-align-right',
166
+ ],
167
+ ],
168
+ 'default' => 'center',
169
+ 'selectors' => [
170
+ '{{WRAPPER}} .premium-gallery-load-more' => 'text-align: {{VALUE}};',
171
+ ],
172
+ 'condition' => [
173
+ 'premium_gallery_load_more' => 'yes'
174
+ ]
175
+ ]
176
+ );
177
178
$this->end_controls_section();
179
1467
$settings['premium_gallery_img_size_select'] = 'fitRows';
1468
}
1469
1470
+ $load_more = 'yes' === $settings['premium_gallery_load_more'] ? true : false;
1471
+ $minimum = ! empty ( $settings['premium_gallery_load_minimum'] ) ? $settings['premium_gallery_load_minimum'] : 6;
1472
+ $click_number = ! empty ( $settings['premium_gallery_load_click_number'] ) ? $settings['premium_gallery_load_click_number'] : 6;
1473
+
1474
+
1475
$grid_settings = [
1476
'img_size' => $settings['premium_gallery_img_size_select'],
1477
'filter' => $settings['premium_gallery_filter'],
1478
'light_box' => $settings['premium_gallery_light_box'],
1479
+ 'overlay_gallery'=> 'yes' === $settings['premium_gallery_overlay_gallery'] ? true : false,
1480
'active_cat' => $category_formatted,
1481
+ 'load_more' => $load_more,
1482
+ 'minimum' => $minimum,
1483
+ 'click_images' => $click_number
1484
];
1485
1486
$this->add_render_attribute( 'grid', [