Premium Addons for Elementor - Version 3.1.6

Version Description

  • Tweak: Metro layout improved in Grid widget.
  • Tweak: Get Modal Box imagesAlt` attribute from media library to enhance SEO.
  • Fixed: Animation issues with multiple Carousel widgets used.
Download this release

Release Info

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

Code changes from version 3.1.5 to 3.1.6

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.4</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.1.5</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
@@ -3125,24 +3125,6 @@ button.premium-modal-box-modal-close {
3125
align-items: center;
3126
justify-content: center;
3127
}
3128
- /*.premium-grid-50 .premium-gallery-item:nth-child(2n+1) {
3129
- clear: left;
3130
- }*/
3131
- /*.premium-grid-33330 .premium-gallery-item:nth-child(3n+1) {
3132
- clear: left;
3133
- }*/
3134
- /*.premium-grid-25 .premium-gallery-item:nth-child(4n+1) {
3135
- clear: left;
3136
- }*/
3137
- /*.premium-grid-20 .premium-gallery-item:nth-child(5n+1) {
3138
- clear: left;
3139
- }
3140
- .premium-grid-1666 .premium-gallery-item:nth-child(6n+1) {
3141
- clear: left;
3142
- }
3143
- .premium-grid-8333 .premium-gallery-item:nth-child(12n+1) {
3144
- clear: left;
3145
- }*/
3146
.premium-img-gallery {
3147
clear: both;
3148
overflow: hidden;
@@ -3152,7 +3134,7 @@ button.premium-modal-box-modal-close {
3152
float: left; /* Google Chrome isotope issue */
3153
}
3154
.premium-gallery-container .grid-sizer {
3155
- width: 25%;
3156
}
3157
.premium-img-gallery-filter .premium-gallery-cats-container li a.category {
3158
border-radius: 75px;
@@ -3372,6 +3354,25 @@ button.premium-modal-box-modal-close {
3372
.premium-gallery-container .pa-gallery-item {
3373
padding: 10px;
3374
}
3375
/************ Premium Vertical Scroll ************/
3376
/*************************************************/
3377
.premium-vscroll-inner {
3125
align-items: center;
3126
justify-content: center;
3127
}
3128
.premium-img-gallery {
3129
clear: both;
3130
overflow: hidden;
3134
float: left; /* Google Chrome isotope issue */
3135
}
3136
.premium-gallery-container .grid-sizer {
3137
+ width: 33.33%;
3138
}
3139
.premium-img-gallery-filter .premium-gallery-cats-container li a.category {
3140
border-radius: 75px;
3354
.premium-gallery-container .pa-gallery-item {
3355
padding: 10px;
3356
}
3357
+ /**
3358
+ * Metro Style
3359
+ */
3360
+ .premium-img-gallery-metro .premium-gallery-item {
3361
+ overflow: hidden
3362
+ }
3363
+ /*.premium-img-gallery-metro .pa-gallery-img-container {
3364
+ height: 100%;
3365
+ object-fit: fill;
3366
+ }*/
3367
+ .premium-img-gallery-metro .pa-gallery-img,
3368
+ .premium-img-gallery-metro .pa-gallery-img-container {
3369
+ height: 100%;
3370
+ }
3371
+ .premium-img-gallery-metro .pa-gallery-image {
3372
+ min-height: 100%;
3373
+ width: 100%;
3374
+ object-fit: fill;
3375
+ }
3376
/************ Premium Vertical Scroll ************/
3377
/*************************************************/
3378
.premium-vscroll-inner {
assets/js/premium-addons.js CHANGED
@@ -68,11 +68,36 @@
68
var galleryElement = $scope.find(".premium-gallery-container"),
69
isotopeOptions = galleryElement.data("settings"),
70
layout = isotopeOptions['img_size'],
71
columnWidth = null;
72
-
73
if( layout === 'metro' ) {
74
layout = 'masonry';
75
- columnWidth = ".grid-sizer";
76
}
77
var grid = galleryElement.imagesLoaded(function() {
78
grid.isotope({
@@ -327,39 +352,29 @@
327
if (slidesScrolled == 1) {
328
if (centerMode == true) {
329
animate = slideToAnimate - 2;
330
- $inViewPort = $(
331
- "#" + $currentParent + " [data-slick-index='" + animate + "']"
332
- );
333
- $inViewPort.addClass($inViewPort.data("animation"));
334
} else {
335
- $inViewPort = $(
336
- "#" +
337
- $currentParent +
338
- " [data-slick-index='" +
339
- slideToAnimate +
340
- "']"
341
- );
342
- if( undefined != $inViewPort.data("animation") ) {
343
- $inViewPort.find('p, h1, h2, h3, h4, h5, h6, span, a, img, i, button').addClass($inViewPort.data("animation")).removeClass("premium-carousel-content-hidden");
344
}
345
346
}
347
} else {
348
for (var i = slidesScrolled + currentSlide; i >= 0; i--) {
349
- $inViewPort = $(
350
- "#" + $currentParent + " [data-slick-index='" + i + "']"
351
);
352
- if( undefined != $inViewPort.data("animation") ) {
353
- $inViewPort.find('p, h1, h2,h3,h4,h5,h6,span, img, i, button').addClass($inViewPort.data("animation")).removeClass("premium-carousel-content-hidden");
354
}
355
}
356
}
357
});
358
$(this).on("beforeChange", function(event, slick, currentSlide) {
359
- $inViewPort = $("[data-slick-index='" + currentSlide + "']");
360
- console.log('' !== $inViewPort.data("animation"));
361
- if( undefined != $inViewPort.data("animation") ) {
362
- $inViewPort.siblings().find('p, h1, h2, h3, h4, h5,h6, span, a, img, i, button').removeClass($inViewPort.data("animation")).addClass("premium-carousel-content-hidden");
363
}
364
});
365
if (carouselSettings["vertical"]) {
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
columnWidth = null;
73
+
74
if( layout === 'metro' ) {
75
+ var suffix = "";
76
+
77
+ if ( "tablet" === deviceType ) {
78
+ suffix = "_tablet";
79
+ } else if ( "mobile" === deviceType ) {
80
+ suffix = "_mobile";
81
+ }
82
+ var gridWidth = galleryElement.width(),
83
+ cellSize = Math.floor( ( gridWidth / 12 ) );
84
+ galleryElement.find(".premium-gallery-item").each(function(index, item ) {
85
+ var cells = $(item).data("metro")[ "cells" + suffix],
86
+ vCells = $(item).data("metro")[ "vcells" + suffix];
87
+ if ( '' == cells || undefined == cells ) {
88
+ var cells = $(item).data("metro")[ "cells" ];
89
+ }
90
+ if ( '' == vCells || undefined == vCells ) {
91
+ var vCells = $(item).data("metro")[ "vcells" ];
92
+ }
93
+ $(item).css({
94
+ "width": Math.ceil( cells * cellSize ),
95
+ "height": Math.ceil( vCells * cellSize )
96
+ } );
97
+ });
98
+
99
layout = 'masonry';
100
+ columnWidth = cellSize;
101
}
102
var grid = galleryElement.imagesLoaded(function() {
103
grid.isotope({
352
if (slidesScrolled == 1) {
353
if (centerMode == true) {
354
animate = slideToAnimate - 2;
355
+ $inViewPort = $(this).find("[data-slick-index='" + animate + "']");
356
+ //$inViewPort.addClass($inViewPort.data("animation"));
357
} else {
358
+ $inViewPort = $(this).find("[data-slick-index='" +slideToAnimate +"']");
359
+ if( 'null' != carouselSettings["animation"] ) {
360
+ $inViewPort.find('p, h1, h2, h3, h4, h5, h6, span, a, img, i, button').addClass(carouselSettings["animation"]).removeClass("premium-carousel-content-hidden");
361
}
362
363
}
364
} else {
365
for (var i = slidesScrolled + currentSlide; i >= 0; i--) {
366
+ $inViewPort = $(this).find("[data-slick-index='" + i + "']"
367
);
368
+ if( 'null' != carouselSettings["animation"] ) {
369
+ $inViewPort.find('p, h1, h2, h3, h4, h5, h6, span, a, img, i, button').addClass(carouselSettings["animation"]).removeClass("premium-carousel-content-hidden");
370
}
371
}
372
}
373
});
374
$(this).on("beforeChange", function(event, slick, currentSlide) {
375
+ $inViewPort = $(this).find("[data-slick-index='" + currentSlide + "']");
376
+ if( 'null' != carouselSettings["animation"] ) {
377
+ $inViewPort.siblings().find('p, h1, h2, h3, h4, h5, h6, span, a, img, i, button').removeClass(carouselSettings["animation"]).addClass("premium-carousel-content-hidden");
378
}
379
});
380
if (carouselSettings["vertical"]) {
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.1.5
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.1.5');
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.4');
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.1.6
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.1.6');
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.5');
23
24
if( ! class_exists('Premium_Addons_Elementor') ) {
25
/*
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: http://premiumaddons.com
5
Requires at least: 4.5
6
Tested up to: 5.1
7
Requires PHP: 5.4
8
- Stable tag: 3.1.5
9
License: GPL v3.0
10
License URI: https://opensource.org/licenses/GPL-3.0
11
@@ -139,6 +139,12 @@ Premium Addons for Elementor is 100% Ads Free, Ads can only be detected from You
139
140
== Changelog ==
141
142
= 3.1.5 =
143
144
- Tweak: Added `2/3 Column` option for `Metro Layout Image Width` in Grid widget.
5
Requires at least: 4.5
6
Tested up to: 5.1
7
Requires PHP: 5.4
8
+ Stable tag: 3.1.6
9
License: GPL v3.0
10
License URI: https://opensource.org/licenses/GPL-3.0
11
139
140
== Changelog ==
141
142
+ = 3.1.6 =
143
+
144
+ - Tweak: `Metro` layout improved in Grid widget.
145
+ - Tweak: Get Modal Box images` `Alt` attribute from media library to enhance SEO.
146
+ - Fixed: Animation issues with multiple Carousel widgets used.
147
+
148
= 3.1.5 =
149
150
- Tweak: Added `2/3 Column` option for `Metro Layout Image Width` in Grid widget.
widgets/premium-carousel.php CHANGED
@@ -302,6 +302,76 @@ class Premium_Carousel extends Widget_Base {
302
);
303
304
$this->end_controls_section();
305
306
$this->start_controls_section('premium_carousel_navigation_arrows',
307
[
@@ -689,74 +759,6 @@ class Premium_Carousel extends Widget_Base {
689
690
$this->end_controls_section();
691
692
- $this->start_controls_section('premium-carousel-advance-settings',
693
- [
694
- 'label' => __( 'Additional Settings' , 'premium-addons-for-elementor' ),
695
- 'tab' => Controls_Manager::TAB_STYLE
696
- ]
697
- );
698
-
699
- $this->add_control('premium_carousel_draggable_effect',
700
- [
701
- 'label' => __( 'Draggable Effect', 'premium-addons-for-elementor' ),
702
- 'description' => __( 'Allow the slides to be dragged by mouse click', 'premium-addons-for-elementor' ),
703
- 'type' => Controls_Manager::SWITCHER,
704
- 'default' => 'yes'
705
- ]
706
- );
707
-
708
- $this->add_control('premium_carousel_touch_move',
709
- [
710
- 'label' => __( 'Touch Move', 'premium-addons-for-elementor' ),
711
- 'description' => __( 'Enable slide moving with touch', 'premium-addons-for-elementor' ),
712
- 'type' => Controls_Manager::SWITCHER,
713
- 'default' => 'yes'
714
- ]
715
- );
716
-
717
- $this->add_control('premium_carousel_RTL_Mode',
718
- [
719
- 'label' => __( 'RTL Mode', 'premium-addons-for-elementor' ),
720
- 'description' => __( 'Turn on RTL mode if your language starts from right to left', 'premium-addons-for-elementor' ),
721
- 'type' => Controls_Manager::SWITCHER,
722
- 'condition' => [
723
- 'premium_carousel_slider_type!' => 'vertical'
724
- ]
725
- ]
726
- );
727
-
728
- $this->add_control('premium_carousel_adaptive_height',
729
- [
730
- 'label' => __( 'Adaptive Height', 'premium-addons-for-elementor' ),
731
- 'description' => __( 'Adaptive height setting gives each slide a fixed height to avoid huge white space gaps', 'premium-addons-for-elementor' ),
732
- 'type' => Controls_Manager::SWITCHER,
733
- ]
734
- );
735
-
736
- $this->add_control('premium_carousel_pausehover',
737
- [
738
- 'label' => __( 'Pause on Hover', 'premium-addons-for-elementor' ),
739
- 'description' => __( 'Pause the slider when mouse hover', 'premium-addons-for-elementor' ),
740
- 'type' => Controls_Manager::SWITCHER,
741
- ]
742
- );
743
-
744
- $this->add_control('premium_carousel_center_mode',
745
- [
746
- 'label' => __( 'Center Mode', 'premium-addons-for-elementor' ),
747
- 'description' => __( 'Center mode enables a centered view with partial next/previous slides. Animations and all visible scroll type doesn\'t work with this mode', 'premium-addons-for-elementor' ),
748
- 'type' => Controls_Manager::SWITCHER,
749
- ]
750
- );
751
-
752
- $this->add_control('premium_carousel_space_btw_items',
753
- [
754
- 'label' => __( 'Slides\' Spacing', 'premium-addons-for-elementor' ),
755
- 'description' => __('Set a spacing value in pixels (px)', 'premium-addons-for-elementor'),
756
- 'type' => Controls_Manager::NUMBER,
757
- 'default' => '15'
758
- ]
759
- );
760
}
761
762
protected function render() {
@@ -949,7 +951,7 @@ class Premium_Carousel extends Widget_Base {
949
$extra_class = $settings['premium_carousel_extra_class'] !== '' ? ' '.$settings['premium_carousel_extra_class'] : '';
950
951
$animation_class = $settings['premium_carousel_animation_list'];
952
- $animation = ! empty( $animation_class ) ? 'class="item-wrapper" data-animation="animated ' . $animation_class .'"' : '';
953
954
$dot_anim = $settings['premium_carousel_navigation_effect'] == 'yes' ? 'hvr-ripple-out' : '';
955
@@ -978,6 +980,7 @@ class Premium_Carousel extends Widget_Base {
978
'slidesDesk' => $slides_on_desk,
979
'slidesTab' => $slides_on_tabs,
980
'slidesMob' => $slides_on_mob,
981
];
982
983
$premium_elements_page_id = array();
@@ -1019,7 +1022,7 @@ class Premium_Carousel extends Widget_Base {
1019
<?php
1020
foreach( $premium_elements_page_id as $elementor_post_id ) :
1021
?>
1022
- <div <?php echo $animation; ?>>
1023
<?php echo $premium_elements_frontend->get_builder_content( $elementor_post_id, true ); ?>
1024
</div>
1025
<?php endforeach; ?>
302
);
303
304
$this->end_controls_section();
305
+
306
+ $this->start_controls_section('premium-carousel-advance-settings',
307
+ [
308
+ 'label' => __( 'Additional Settings' , 'premium-addons-for-elementor' ),
309
+ ]
310
+ );
311
+
312
+ $this->add_control('premium_carousel_draggable_effect',
313
+ [
314
+ 'label' => __( 'Draggable Effect', 'premium-addons-for-elementor' ),
315
+ 'description' => __( 'Allow the slides to be dragged by mouse click', 'premium-addons-for-elementor' ),
316
+ 'type' => Controls_Manager::SWITCHER,
317
+ 'default' => 'yes'
318
+ ]
319
+ );
320
+
321
+ $this->add_control('premium_carousel_touch_move',
322
+ [
323
+ 'label' => __( 'Touch Move', 'premium-addons-for-elementor' ),
324
+ 'description' => __( 'Enable slide moving with touch', 'premium-addons-for-elementor' ),
325
+ 'type' => Controls_Manager::SWITCHER,
326
+ 'default' => 'yes'
327
+ ]
328
+ );
329
+
330
+ $this->add_control('premium_carousel_RTL_Mode',
331
+ [
332
+ 'label' => __( 'RTL Mode', 'premium-addons-for-elementor' ),
333
+ 'description' => __( 'Turn on RTL mode if your language starts from right to left', 'premium-addons-for-elementor' ),
334
+ 'type' => Controls_Manager::SWITCHER,
335
+ 'condition' => [
336
+ 'premium_carousel_slider_type!' => 'vertical'
337
+ ]
338
+ ]
339
+ );
340
+
341
+ $this->add_control('premium_carousel_adaptive_height',
342
+ [
343
+ 'label' => __( 'Adaptive Height', 'premium-addons-for-elementor' ),
344
+ 'description' => __( 'Adaptive height setting gives each slide a fixed height to avoid huge white space gaps', 'premium-addons-for-elementor' ),
345
+ 'type' => Controls_Manager::SWITCHER,
346
+ ]
347
+ );
348
+
349
+ $this->add_control('premium_carousel_pausehover',
350
+ [
351
+ 'label' => __( 'Pause on Hover', 'premium-addons-for-elementor' ),
352
+ 'description' => __( 'Pause the slider when mouse hover', 'premium-addons-for-elementor' ),
353
+ 'type' => Controls_Manager::SWITCHER,
354
+ ]
355
+ );
356
+
357
+ $this->add_control('premium_carousel_center_mode',
358
+ [
359
+ 'label' => __( 'Center Mode', 'premium-addons-for-elementor' ),
360
+ 'description' => __( 'Center mode enables a centered view with partial next/previous slides. Animations and all visible scroll type doesn\'t work with this mode', 'premium-addons-for-elementor' ),
361
+ 'type' => Controls_Manager::SWITCHER,
362
+ ]
363
+ );
364
+
365
+ $this->add_control('premium_carousel_space_btw_items',
366
+ [
367
+ 'label' => __( 'Slides\' Spacing', 'premium-addons-for-elementor' ),
368
+ 'description' => __('Set a spacing value in pixels (px)', 'premium-addons-for-elementor'),
369
+ 'type' => Controls_Manager::NUMBER,
370
+ 'default' => '15'
371
+ ]
372
+ );
373
+
374
+ $this->end_controls_section();
375
376
$this->start_controls_section('premium_carousel_navigation_arrows',
377
[
759
760
$this->end_controls_section();
761
762
}
763
764
protected function render() {
951
$extra_class = $settings['premium_carousel_extra_class'] !== '' ? ' '.$settings['premium_carousel_extra_class'] : '';
952
953
$animation_class = $settings['premium_carousel_animation_list'];
954
+ $animation = ! empty( $animation_class ) ? 'animated ' . $animation_class : 'null';
955
956
$dot_anim = $settings['premium_carousel_navigation_effect'] == 'yes' ? 'hvr-ripple-out' : '';
957
980
'slidesDesk' => $slides_on_desk,
981
'slidesTab' => $slides_on_tabs,
982
'slidesMob' => $slides_on_mob,
983
+ 'animation' => $animation
984
];
985
986
$premium_elements_page_id = array();
1022
<?php
1023
foreach( $premium_elements_page_id as $elementor_post_id ) :
1024
?>
1025
+ <div class="item-wrapper">
1026
<?php echo $premium_elements_frontend->get_builder_content( $elementor_post_id, true ); ?>
1027
</div>
1028
<?php endforeach; ?>
widgets/premium-grid.php CHANGED
@@ -93,12 +93,12 @@ class Premium_Grid extends Widget_Base {
93
'16.66%' => __( '6 Columns', 'premium-addons-for-elementor' ),
94
'8.33%' => __( '12 Columns', 'premium-addons-for-elementor' ),
95
],
96
- 'selectors' => [
97
- '{{WRAPPER}} .premium-gallery-container div.premium-gallery-item' => 'width: {{VALUE}};',
98
- ],
99
'condition' => [
100
- 'premium_gallery_img_size_select!' => 'metro'
101
],
102
'render_type' => 'template'
103
]
104
);
@@ -206,29 +206,42 @@ class Premium_Grid extends Widget_Base {
206
],
207
]);
208
209
- $img_repeater->add_responsive_control('premium_gallery_image_width',
210
[
211
'label' => __( 'Width', 'premium-addons-for-elementor' ),
212
'description' => __('Works only when layout set to \'Metro\'', 'premium-addons-for-elementor'),
213
'label_block' => true,
214
- 'type' => Controls_Manager::SELECT,
215
- 'desktop_default' => '50%',
216
- 'tablet_default' => '100%',
217
- 'mobile_default' => '100%',
218
- 'options' => [
219
- '100%' => __( 'Full Column', 'premium-addons-for-elementor' ),
220
- '75%' => __( '3/4 Column', 'premium-addons-for-elementor' ),
221
- '50%' => __( '1/2 Column', 'premium-addons-for-elementor' ),
222
- '33.330%' => __( '1/3 Column', 'premium-addons-for-elementor' ),
223
- '66.66%' => __( '2/3 Column', 'premium-addons-for-elementor' ),
224
- '25%' => __( '1/4 Column', 'premium-addons-for-elementor' ),
225
- '20%' => __( '1/5 Column', 'premium-addons-for-elementor' ),
226
- '16.66%' => __( '1/6 Column', 'premium-addons-for-elementor' ),
227
- '8.33%' => __( '1/12 Column', 'premium-addons-for-elementor' ),
228
- ],
229
- 'selectors' => [
230
- '{{WRAPPER}} .premium-gallery-container {{CURRENT_ITEM}}' => 'width: {{VALUE}};',
231
- ],
232
'render_type' => 'template'
233
]
234
);
@@ -1140,7 +1153,7 @@ class Premium_Grid extends Widget_Base {
1140
$settings = $this->get_settings_for_display();
1141
$filter = $settings['premium_gallery_filter'];
1142
1143
- $number_columns = str_replace(array('%','.'),'', 'premium-grid-'.$settings['premium_gallery_column_number'] );
1144
1145
$layout = $settings['premium_gallery_img_style'];
1146
$min_size = $settings['premium_gallery_min_range'].'px';
@@ -1161,16 +1174,21 @@ class Premium_Grid extends Widget_Base {
1161
}
1162
1163
$grid_settings = [
1164
- 'img_size' => $settings['premium_gallery_img_size_select'],
1165
- 'filter' => $settings['premium_gallery_filter'],
1166
- 'light_box' => $settings['premium_gallery_light_box'],
1167
- 'overlay_gallery' => 'yes' == $settings['premium_gallery_overlay_gallery'] ? true : false,
1168
- 'active_cat'=> $category_formatted
1169
];
1170
1171
- $this->add_render_attribute( 'grid', 'id', 'premium-img-gallery-' . esc_attr( $this->get_id() ) );
1172
-
1173
- $this->add_render_attribute( 'grid', 'class', 'premium-img-gallery' );
1174
1175
$active_category_index = $settings['premium_gallery_first_cat_switcher'] == 'yes' ? $settings['premium_gallery_active_cat'] - 1 : $settings['premium_gallery_active_cat'];
1176
@@ -1218,7 +1236,7 @@ class Premium_Grid extends Widget_Base {
1218
</div>
1219
<?php endif; ?>
1220
1221
- <div class="premium-gallery-container js-isotope <?php echo esc_attr( $number_columns ); ?>" data-settings='<?php echo wp_json_encode($grid_settings); ?>'>
1222
<?php if ( 'metro' === $settings['premium_gallery_img_size_select'] ) : ?>
1223
<div class="grid-sizer"></div>
1224
<?php endif;
@@ -1235,6 +1253,20 @@ class Premium_Grid extends Widget_Base {
1235
]
1236
]
1237
);
1238
1239
?>
1240
<div <?php echo $this->get_render_attribute_string($key); ?>>
93
'16.66%' => __( '6 Columns', 'premium-addons-for-elementor' ),
94
'8.33%' => __( '12 Columns', 'premium-addons-for-elementor' ),
95
],
96
'condition' => [
97
+ 'premium_gallery_img_size_select!' => 'metro'
98
],
99
+ 'selectors' => [
100
+ '{{WRAPPER}} .premium-img-gallery-masonry div.premium-gallery-item, {{WRAPPER}} .premium-img-gallery-fitRows div.premium-gallery-item' => 'width: {{VALUE}};',
101
+ ],
102
'render_type' => 'template'
103
]
104
);
206
],
207
]);
208
209
+ $img_repeater->add_responsive_control('premium_gallery_image_cell',
210
[
211
'label' => __( 'Width', 'premium-addons-for-elementor' ),
212
'description' => __('Works only when layout set to \'Metro\'', 'premium-addons-for-elementor'),
213
'label_block' => true,
214
+ 'default' => [
215
+ 'unit' => 'px',
216
+ 'size' => 4
217
+ ],
218
+ 'type' => Controls_Manager::SLIDER,
219
+ 'range' => [
220
+ 'px' => [
221
+ 'min' => 1,
222
+ 'max' => 12,
223
+ ],
224
+ ],
225
+ 'render_type' => 'template'
226
+ ]
227
+ );
228
+
229
+ $img_repeater->add_responsive_control('premium_gallery_image_vcell',
230
+ [
231
+ 'label' => __( 'Height', 'premium-addons-for-elementor' ),
232
+ 'description' => __('Works only when layout set to \'Metro\'', 'premium-addons-for-elementor'),
233
+ 'label_block' => true,
234
+ 'type' => Controls_Manager::SLIDER,
235
+ 'default' => [
236
+ 'unit' => 'px',
237
+ 'size' => 4
238
+ ],
239
+ 'range' => [
240
+ 'px' => [
241
+ 'min' => 1,
242
+ 'max' => 12,
243
+ ],
244
+ ],
245
'render_type' => 'template'
246
]
247
);
1153
$settings = $this->get_settings_for_display();
1154
$filter = $settings['premium_gallery_filter'];
1155
1156
+ // $number_columns = intval ( 100 / substr( $settings['premium_gallery_column_number'], 0, strpos( $settings['premium_gallery_column_number'], '%') ) );
1157
1158
$layout = $settings['premium_gallery_img_style'];
1159
$min_size = $settings['premium_gallery_min_range'].'px';
1174
}
1175
1176
$grid_settings = [
1177
+ 'img_size' => $settings['premium_gallery_img_size_select'],
1178
+ 'filter' => $settings['premium_gallery_filter'],
1179
+ 'light_box' => $settings['premium_gallery_light_box'],
1180
+ 'overlay_gallery'=> 'yes' == $settings['premium_gallery_overlay_gallery'] ? true : false,
1181
+ 'active_cat' => $category_formatted
1182
];
1183
1184
+ $this->add_render_attribute( 'grid', [
1185
+ 'id' => 'premium-img-gallery-' . esc_attr( $this->get_id() ),
1186
+ 'class' => [
1187
+ 'premium-img-gallery',
1188
+ 'premium-img-gallery-' . $settings['premium_gallery_img_size_select']
1189
+ ]
1190
+ ]
1191
+ );
1192
1193
$active_category_index = $settings['premium_gallery_first_cat_switcher'] == 'yes' ? $settings['premium_gallery_active_cat'] - 1 : $settings['premium_gallery_active_cat'];
1194
1236
</div>
1237
<?php endif; ?>
1238
1239
+ <div class="premium-gallery-container js-isotope" data-settings='<?php echo wp_json_encode($grid_settings); ?>'>
1240
<?php if ( 'metro' === $settings['premium_gallery_img_size_select'] ) : ?>
1241
<div class="grid-sizer"></div>
1242
<?php endif;
1253
]
1254
]
1255
);
1256
+
1257
+ if ( 'metro' === $settings['premium_gallery_img_size_select'] ) {
1258
+
1259
+ $cells = [
1260
+ 'cells' => $image['premium_gallery_image_cell']['size'],
1261
+ 'vcells' => $image['premium_gallery_image_vcell']['size'],
1262
+ 'cells_tablet' => $image['premium_gallery_image_cell_tablet']['size'],
1263
+ 'vcells_tablet' => $image['premium_gallery_image_vcell_tablet']['size'],
1264
+ 'cells_mobile' => $image['premium_gallery_image_cell_mobile']['size'],
1265
+ 'vcells_mobile' => $image['premium_gallery_image_vcell_mobile']['size'],
1266
+ ];
1267
+
1268
+ $this->add_render_attribute( $key, 'data-metro', wp_json_encode( $cells ) );
1269
+ }
1270
1271
?>
1272
<div <?php echo $this->get_render_attribute_string($key); ?>>
widgets/premium-modalbox.php CHANGED
@@ -12,7 +12,7 @@ class Premium_Modalbox extends Widget_Base {
12
return 'premium-addon-modal-box';
13
}
14
15
- public function check_rtl(){
16
return is_rtl();
17
}
18
@@ -24,9 +24,11 @@ class Premium_Modalbox extends Widget_Base {
24
return 'pa-modal-box';
25
}
26
27
- public function get_script_depends()
28
- {
29
- return ['premium-addons-js','modal-js'];
30
}
31
32
public function get_categories() {
@@ -1313,12 +1315,31 @@ class Premium_Modalbox extends Widget_Base {
1313
1314
$this->add_render_attribute('image', 'src', $settings['premium_modal_box_image_src']['url'] );
1315
1316
$this->add_render_attribute('text', 'class', 'premium-modal-box-text-selector' );
1317
1318
$this->add_render_attribute('text', 'data-toggle', 'premium-modal' );
1319
1320
$this->add_render_attribute('text', 'data-target', '#premium-modal-' . $this->get_id() );
1321
1322
?>
1323
1324
<div <?php echo $this->get_render_attribute_string('modal') ?>>
@@ -1351,12 +1372,12 @@ class Premium_Modalbox extends Widget_Base {
1351
<button type="button" class="premium-modal-box-modal-close" data-dismiss="premium-modal">&times;</button>
1352
</div>
1353
<?php endif; ?>
1354
- <?php if ( !empty( $settings['premium_modal_box_title'] ) ) : ?>
1355
<h3 class="premium-modal-box-modal-title">
1356
- <?php if( $settings['premium_modal_box_icon_selection'] === 'fonticon' ) : ?>
1357
- <i class="fa <?php echo $settings['premium_modal_box_font_icon'];?>"></i>
1358
- <?php elseif( $settings['premium_modal_box_icon_selection'] === 'image' ) : ?>
1359
- <img src="<?php echo $settings['premium_modal_box_image_icon']['url'];?>">
1360
<?php endif;
1361
echo $settings['premium_modal_box_title']; ?>
1362
</h3>
12
return 'premium-addon-modal-box';
13
}
14
15
+ public function check_rtl() {
16
return is_rtl();
17
}
18
24
return 'pa-modal-box';
25
}
26
27
+ public function get_script_depends() {
28
+ return [
29
+ 'premium-addons-js',
30
+ 'modal-js'
31
+ ];
32
}
33
34
public function get_categories() {
1315
1316
$this->add_render_attribute('image', 'src', $settings['premium_modal_box_image_src']['url'] );
1317
1318
+ if ( 'image' === $settings['premium_modal_box_display_on'] ) {
1319
+
1320
+ $alt = Control_Media::get_image_alt( $settings['premium_modal_box_image_src'] );
1321
+ $this->add_render_attribute('image', 'alt', $alt );
1322
+
1323
+ }
1324
+
1325
$this->add_render_attribute('text', 'class', 'premium-modal-box-text-selector' );
1326
1327
$this->add_render_attribute('text', 'data-toggle', 'premium-modal' );
1328
1329
$this->add_render_attribute('text', 'data-target', '#premium-modal-' . $this->get_id() );
1330
1331
+ if ( 'fonticon' === $settings['premium_modal_box_icon_selection'] ) {
1332
+
1333
+ $this->add_render_attribute('title_icon', 'class', $settings['premium_modal_box_font_icon'] );
1334
+
1335
+ } else {
1336
+
1337
+ $this->add_render_attribute('title_icon', 'src', $settings['premium_modal_box_image_icon']['url'] );
1338
+ $alt = Control_Media::get_image_alt( $settings['premium_modal_box_image_icon'] );
1339
+ $this->add_render_attribute('title_icon', 'alt', $alt );
1340
+
1341
+ }
1342
+
1343
?>
1344
1345
<div <?php echo $this->get_render_attribute_string('modal') ?>>
1372
<button type="button" class="premium-modal-box-modal-close" data-dismiss="premium-modal">&times;</button>
1373
</div>
1374
<?php endif; ?>
1375
+ <?php if ( ! empty( $settings['premium_modal_box_title'] ) ) : ?>
1376
<h3 class="premium-modal-box-modal-title">
1377
+ <?php if( 'fonticon' === $settings['premium_modal_box_icon_selection'] ) : ?>
1378
+ <i <?php echo $this->get_render_attribute_string('title_icon'); ?>></i>
1379
+ <?php elseif( 'image' === $settings['premium_modal_box_icon_selection'] ) : ?>
1380
+ <img <?php echo $this->get_render_attribute_string('title_icon'); ?>>
1381
<?php endif;
1382
echo $settings['premium_modal_box_title']; ?>
1383
</h3>