Premium Addons for Elementor - Version 2.9.0

Version Description

  • Tweak: CSS files loaded only when required to enhance plugin performance.
  • Tweak: Unnecessary functions removed from Banner, Dual Heading and Title widgets to enhance performance.
Download this release

Release Info

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

Code changes from version 2.8.9 to 2.9.0

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.8.7</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.8.9</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/ajax-loader.gif DELETED
Binary file
assets/css/premium-addons.css CHANGED
@@ -1238,6 +1238,7 @@ button.premium-modal-box-modal-close {
1238
/* prevent Scroll on body */
1239
.premium-modal-open {
1240
overflow: hidden;
1241
}
1242
@media (min-width:768px) {
1243
.premium-modal-box-modal-dialog {
1238
/* prevent Scroll on body */
1239
.premium-modal-open {
1240
overflow: hidden;
1241
+ height: 100vh;
1242
}
1243
@media (min-width:768px) {
1244
.premium-modal-box-modal-dialog {
assets/images/premium-addons-logo.png DELETED
Binary file
includes/class-addons-integration.php CHANGED
@@ -14,15 +14,20 @@ class Premium_Addons_Integration {
14
* @return void
15
*/
16
public function __construct() {
17
add_action( 'elementor/editor/before_enqueue_styles', array( $this, 'premium_font_setup' ) );
18
-
19
- add_action( 'elementor/frontend/after_enqueue_styles', array( $this, 'premium_required_assets' ) );
20
21
add_action( 'elementor/widgets/widgets_registered', array( $this, 'premium_widgets_area' ) );
22
23
- add_action( 'elementor/frontend/after_register_scripts', array( $this, 'premium_register_scripts' ) );
24
25
- add_action('elementor/editor/before_enqueue_scripts', array($this,'premium_maps_get_address'));
26
27
add_action('wp_enqueue_scripts', array($this, 'premium_maps_required_script'));
28
}
@@ -38,14 +43,44 @@ class Premium_Addons_Integration {
38
'premium-addons-font',
39
PREMIUM_ADDONS_URL . 'admin/assets/pa-elements-font/css/pa-elements.css'
40
);
41
}
42
43
/**
44
- * Enqueue required CSS files
45
- * @since 1.0.0
46
* @access public
47
*/
48
- public function premium_required_assets() {
49
wp_enqueue_style(
50
'premium-addons',
51
PREMIUM_ADDONS_URL . 'assets/css/premium-addons.css',
@@ -54,11 +89,6 @@ class Premium_Addons_Integration {
54
'all'
55
);
56
57
- $check_grid_active = PA_admin_settings::get_enabled_keys()['premium-grid'];
58
- if( $check_grid_active ){
59
- wp_enqueue_style('pa-prettyphoto', PREMIUM_ADDONS_URL . 'assets/css/prettyphoto.css', array(), PREMIUM_ADDONS_VERSION, 'all');
60
- }
61
-
62
}
63
64
/** Load widgets require function
@@ -94,20 +124,18 @@ class Premium_Addons_Integration {
94
* @since 1.0.0
95
* @access public
96
*/
97
- public function premium_register_scripts() {
98
99
$check_component_active = PA_admin_settings::get_enabled_keys();
100
wp_register_script('waypoints-js', PREMIUM_ADDONS_URL . 'assets/js/lib/jquery.waypoints.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
101
- if ( $check_component_active['premium-progressbar'] || $check_component_active['premium-videobox'] || $check_component_active['premium-grid'] || $check_component_active['premium-fancytext'] || $check_component_active['premium-countdown'] || $check_component_active['premium-carousel'] || $check_component_active['premium-banner'] || $check_component_active['premium-maps'] || $check_component_active['premium-modalbox'] || $check_component_active['premium-blog'] || $check_component_active['premium-counter'] ) {
102
103
- wp_register_script('premium-addons-js', PREMIUM_ADDONS_URL . 'assets/js/premium-addons.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
104
- }
105
106
if ( $check_component_active['premium-counter'] ) {
107
wp_register_script('counter-up-js', PREMIUM_ADDONS_URL . 'assets/js/lib/countUpmin.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
108
}
109
110
- if ( $check_component_active['premium-grid']) {
111
wp_register_script('isotope-js', PREMIUM_ADDONS_URL . 'assets/js/lib/isotope.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
112
wp_register_script('prettyPhoto-js', PREMIUM_ADDONS_URL . 'assets/js/lib/prettyPhoto.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
113
}
14
* @return void
15
*/
16
public function __construct() {
17
+
18
add_action( 'elementor/editor/before_enqueue_styles', array( $this, 'premium_font_setup' ) );
19
20
add_action( 'elementor/widgets/widgets_registered', array( $this, 'premium_widgets_area' ) );
21
22
+ add_action('elementor/editor/before_enqueue_scripts', array( $this,'premium_maps_get_address') );
23
+
24
+ add_action( 'elementor/preview/enqueue_styles', array( $this, 'premium_enqueue_preview_styles' ) );
25
+
26
+ add_action( 'elementor/frontend/after_register_styles', array( $this, 'premium_register_frontend_styles' ) );
27
28
+ add_action( 'elementor/frontend/after_enqueue_styles', array( $this, 'premium_enqueue_frontend_styles' ) );
29
+
30
+ add_action( 'elementor/frontend/after_register_scripts', array( $this, 'premium_register_frontend_scripts' ) );
31
32
add_action('wp_enqueue_scripts', array($this, 'premium_maps_required_script'));
33
}
43
'premium-addons-font',
44
PREMIUM_ADDONS_URL . 'admin/assets/pa-elements-font/css/pa-elements.css'
45
);
46
+
47
}
48
49
/**
50
+ * Register Frontend CSS files
51
+ * @since 2.9.0
52
+ * @access public
53
+ */
54
+ public function premium_register_frontend_styles() {
55
+
56
+ wp_register_style(
57
+ 'pa-prettyphoto',
58
+ PREMIUM_ADDONS_URL . 'assets/css/prettyphoto.css',
59
+ array(),
60
+ PREMIUM_ADDONS_VERSION,
61
+ 'all'
62
+ );
63
+
64
+ }
65
+
66
+ /**
67
+ * Enqueue Preview CSS files
68
+ * @since 2.9.0
69
+ * @access public
70
+ */
71
+ public function premium_enqueue_preview_styles() {
72
+
73
+ wp_enqueue_style('pa-prettyphoto');
74
+
75
+ }
76
+
77
+ /**
78
+ * Enqueue Widgets` CSS file
79
+ * @since 2.9.0
80
* @access public
81
*/
82
+ public function premium_enqueue_frontend_styles() {
83
+
84
wp_enqueue_style(
85
'premium-addons',
86
PREMIUM_ADDONS_URL . 'assets/css/premium-addons.css',
89
'all'
90
);
91
92
}
93
94
/** Load widgets require function
124
* @since 1.0.0
125
* @access public
126
*/
127
+ public function premium_register_frontend_scripts() {
128
129
$check_component_active = PA_admin_settings::get_enabled_keys();
130
wp_register_script('waypoints-js', PREMIUM_ADDONS_URL . 'assets/js/lib/jquery.waypoints.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
131
132
+ wp_register_script('premium-addons-js', PREMIUM_ADDONS_URL . 'assets/js/premium-addons.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
133
134
if ( $check_component_active['premium-counter'] ) {
135
wp_register_script('counter-up-js', PREMIUM_ADDONS_URL . 'assets/js/lib/countUpmin.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
136
}
137
138
+ if ( $check_component_active['premium-grid'] ) {
139
wp_register_script('isotope-js', PREMIUM_ADDONS_URL . 'assets/js/lib/isotope.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
140
wp_register_script('prettyPhoto-js', PREMIUM_ADDONS_URL . 'assets/js/lib/prettyPhoto.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
141
}
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.8.9
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.8.9');
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.8.7');
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.0
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.0');
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.8.9');
31
32
if( ! class_exists('Premium_Addons_Elementor') ) {
33
/*
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: leap13
3
Tags: Elementor, Elementor Page Builder, Elements, Elementor Addons, Add-ons, page builder
4
Donate link: http://premiumaddons.com
5
Requires at least: 4.5
6
- Tested up to: 5.0.0
7
Requires PHP: 5.4
8
- Stable tag: 2.8.9
9
License: GPL v3.0
10
License URI: https://opensource.org/licenses/GPL-3.0
11
@@ -137,6 +137,11 @@ Premium Addons for Elementor is 100% Ads Free, Ads can only be detected from You
137
138
== Changelog ==
139
140
= 2.8.9 =
141
142
- Fixed: Notice: Undefined property: PremiumAddons\Plugin::$settings
3
Tags: Elementor, Elementor Page Builder, Elements, Elementor Addons, Add-ons, page builder
4
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.0
9
License: GPL v3.0
10
License URI: https://opensource.org/licenses/GPL-3.0
11
137
138
== Changelog ==
139
140
+ = 2.9.0 =
141
+
142
+ - Tweak: CSS files loaded only when required to enhance plugin performance.
143
+ - Tweak: Unnecessary functions removed from Banner, Dual Heading and Title widgets to enhance performance.
144
+
145
= 2.8.9 =
146
147
- Fixed: Notice: Undefined property: PremiumAddons\Plugin::$settings
widgets/premium-banner.php CHANGED
@@ -1,4 +1,5 @@
1
- <?php
2
namespace Elementor;
3
4
if ( ! defined( 'ABSPATH' ) ) exit; // If this file is called directly, abort.
@@ -36,15 +37,13 @@ class Premium_Banner extends Widget_Base {
36
// This will controls the animation, colors and background, dimensions etc
37
protected function _register_controls() {
38
39
- $this->start_controls_section(
40
- 'premium_banner_global_settings',
41
[
42
- 'label' => esc_html__( 'Image', 'premium-addons-for-elementor' )
43
]
44
);
45
46
- $this->add_control(
47
- 'premium_banner_image',
48
[
49
'label' => esc_html__( 'Upload Image', 'premium-addons-for-elementor' ),
50
'description' => esc_html__( 'Select an image for the Banner', 'premium-addons-for-elementor' ),
@@ -58,18 +57,16 @@ class Premium_Banner extends Widget_Base {
58
);
59
60
$this->add_control('premium_banner_link_url_switch',
61
- [
62
- 'label' => esc_html__('Link', 'premium-addons-for-elementor'),
63
- 'type' => Controls_Manager::SWITCHER,
64
- ]
65
- );
66
67
- $this->add_control(
68
- 'premium_banner_image_link_switcher',
69
[
70
'label' => esc_html__( 'Custom Link', 'premium-addons-for-elementor' ),
71
'type' => Controls_Manager::SWITCHER,
72
- 'default' => '',
73
'description' => esc_html__( 'Add a custom link to the banner', 'premium-addons-for-elementor' ),
74
'condition' => [
75
'premium_banner_link_url_switch' => 'yes',
@@ -77,63 +74,56 @@ class Premium_Banner extends Widget_Base {
77
]
78
);
79
80
- $this->add_control(
81
- 'premium_banner_image_custom_link',
82
[
83
'label' => esc_html__( 'Set custom Link', 'premium-addons-for-elementor' ),
84
'type' => Controls_Manager::URL,
85
'description' => esc_html__( 'What custom link you want to set to banner?', 'premium-addons-for-elementor' ),
86
'condition' => [
87
'premium_banner_image_link_switcher' => 'yes',
88
- 'premium_banner_link_url_switch' => 'yes',
89
],
90
- 'show_external' => false,
91
]
92
);
93
94
- $this->add_control(
95
- 'premium_banner_image_existing_page_link',
96
[
97
'label' => esc_html__( 'Existing Page', 'premium-addons-for-elementor' ),
98
'type' => Controls_Manager::SELECT2,
99
'description' => esc_html__( 'Link the banner with an existing page', 'premium-addons-for-elementor' ),
100
'condition' => [
101
'premium_banner_image_link_switcher!' => 'yes',
102
- 'premium_banner_link_url_switch' => 'yes',
103
],
104
'multiple' => false,
105
'options' => $this->getTemplateInstance()->get_all_post()
106
]
107
);
108
109
- $this->add_control(
110
- 'premium_banner_image_link_open_new_tab',
111
[
112
'label' => esc_html__( 'New Tab', 'premium-addons-for-elementor' ),
113
'type' => Controls_Manager::SWITCHER,
114
- 'default' => '',
115
'description' => esc_html__( 'Choose if you want the link be opened in a new tab or not', 'premium-addons-for-elementor' ),
116
'condition' => [
117
- 'premium_banner_link_url_switch' => 'yes',
118
- ],
119
]
120
);
121
122
- $this->add_control(
123
- 'premium_banner_image_link_add_nofollow',
124
[
125
'label' => esc_html__( 'Nofollow Option', 'premium-addons-for-elementor' ),
126
'type' => Controls_Manager::SWITCHER,
127
- 'default' => '',
128
'description' => esc_html__('if you choose yes, the link will not be counted in search engines', 'premium-addons-for-elementor' ),
129
'condition' => [
130
- 'premium_banner_link_url_switch' => 'yes',
131
- ],
132
]
133
);
134
135
- $this->add_control(
136
- 'premium_banner_image_animation',
137
[
138
'label' => esc_html__( 'Effect', 'premium-addons-for-elementor' ),
139
'type' => Controls_Manager::SELECT,
@@ -150,52 +140,46 @@ class Premium_Banner extends Widget_Base {
150
]
151
);
152
153
- $this->add_control(
154
- 'premium_banner_active',
155
[
156
'label' => esc_html__( 'Always Hovered', 'premium-addons-for-elementor' ),
157
'type' => Controls_Manager::SWITCHER,
158
- 'description' => esc_html__( 'Choose if you want the effect to be always triggered', 'premium-addons-for-elementor' ),
159
-
160
]
161
);
162
163
- $this->add_control(
164
- 'premium_banner_hover_effect',
165
- [
166
- 'label' => esc_html__('Hover Effect', 'premium-addons-for-elementor'),
167
- 'type' => Controls_Manager::SELECT,
168
- 'options' => [
169
- 'none' => esc_html__('None', 'premium-addons-for-elementor'),
170
- 'zoomin' => esc_html__('Zoom In', 'premium-addons-for-elementor'),
171
- 'zoomout' => esc_html__('Zoom Out', 'premium-addons-for-elementor'),
172
- 'scale' => esc_html__('Scale', 'premium-addons-for-elementor'),
173
- 'grayscale' => esc_html__('Grayscale', 'premium-addons-for-elementor'),
174
- 'blur' => esc_html__('Blur', 'premium-addons-for-elementor'),
175
- 'bright' => esc_html__('Bright', 'premium-addons-for-elementor'),
176
- 'sepia' => esc_html__('Sepia', 'premium-addons-for-elementor'),
177
- ],
178
- 'default' => 'none',
179
- ]
180
- );
181
182
- $this->add_control(
183
- 'premium_banner_height',
184
[
185
'label' => esc_html__( 'Height', 'premium-addons-for-elementor' ),
186
'type' => Controls_Manager::SELECT,
187
'options' => [
188
'default' => 'Default',
189
- 'custom' => 'Custom',
190
],
191
'default' => 'default',
192
- 'description' => esc_html__( 'Choose if you want to set a custom height for the banner or keep it as it is', 'premium-addons-for-elementor' ),
193
-
194
]
195
);
196
197
- $this->add_responsive_control(
198
- 'premium_banner_custom_height',
199
[
200
'label' => esc_html__( 'Min Height', 'premium-addons-for-elementor' ),
201
'type' => Controls_Manager::NUMBER,
@@ -209,8 +193,7 @@ class Premium_Banner extends Widget_Base {
209
]
210
);
211
212
- $this->add_responsive_control(
213
- 'premium_banner_img_vertical_align',
214
[
215
'label' => esc_html__( 'Vertical Align', 'premium-addons-for-elementor' ),
216
'type' => Controls_Manager::SELECT,
@@ -221,7 +204,7 @@ class Premium_Banner extends Widget_Base {
221
'flex-start' => esc_html__('Top', 'premium-addons-for-elementor'),
222
'center' => esc_html__('Middle', 'premium-addons-for-elementor'),
223
'flex-end' => esc_html__('Bottom', 'premium-addons-for-elementor'),
224
- 'inherit' => esc_html__('Full', 'premium-addons-for-elementor'),
225
],
226
'default' => 'flex-start',
227
'selectors' => [
@@ -230,31 +213,27 @@ class Premium_Banner extends Widget_Base {
230
]
231
);
232
233
- $this->add_control(
234
- 'premium_banner_extra_class',
235
[
236
'label' => esc_html__( 'Extra Class', 'premium-addons-for-elementor' ),
237
'type' => Controls_Manager::TEXT,
238
- 'description' => esc_html__( 'Add extra class name that will be applied to the banner, and you can use this class for your customizations.', 'premium-addons-for-elementor' ),
239
]
240
);
241
242
243
$this->end_controls_section();
244
245
- $this->start_controls_section(
246
- 'premium_banner_image_section',
247
[
248
'label' => esc_html__( 'Content', 'premium-addons-for-elementor' )
249
]
250
);
251
252
- $this->add_control(
253
- 'premium_banner_title',
254
[
255
'label' => esc_html__( 'Title', 'premium-addons-for-elementor' ),
256
'placeholder' => esc_html__( 'Give a title to this banner', 'premium-addons-for-elementor' ),
257
- 'description' => esc_html__( 'Give a title to this banner', 'premium-addons-for-elementor' ),
258
'type' => Controls_Manager::TEXT,
259
'dynamic' => [ 'active' => true ],
260
'default' => esc_html__( 'Premium Banner', 'premium-addons-for-elementor' ),
@@ -262,36 +241,33 @@ class Premium_Banner extends Widget_Base {
262
]
263
);
264
265
- $this->add_control(
266
- 'premium_banner_title_tag',
267
[
268
'label' => esc_html__( 'HTML Tag', 'premium-addons-for-elementor' ),
269
'description' => esc_html__( 'Select a heading tag for the title. Headings are defined with H1 to H6 tags', 'premium-addons-for-elementor' ),
270
'type' => Controls_Manager::SELECT,
271
'default' => 'h3',
272
'options' => [
273
- 'h1' => 'H1',
274
- 'h2' => 'H2',
275
- 'h3' => 'H3',
276
- 'h4' => 'H4',
277
- 'h5' => 'H5',
278
- 'h6' => 'H6',
279
- ],
280
'label_block' => true,
281
]
282
);
283
284
285
- $this->add_control(
286
- 'premium_banner_description_hint',
287
[
288
'label' => esc_html__( 'Description', 'premium-addons-for-elementor' ),
289
'type' => Controls_Manager::HEADING,
290
]
291
);
292
293
- $this->add_control(
294
- 'premium_banner_description',
295
[
296
'label' => esc_html__( 'Description', 'premium-addons-for-elementor' ),
297
'description' => esc_html__( 'Give the description to this banner', 'premium-addons-for-elementor' ),
@@ -302,8 +278,7 @@ class Premium_Banner extends Widget_Base {
302
]
303
);
304
305
- $this->add_control(
306
- 'premium_banner_link_switcher',
307
[
308
'label' => esc_html__('Button', 'premium-addons-for-elementor'),
309
'type' => Controls_Manager::SWITCHER,
@@ -314,8 +289,7 @@ class Premium_Banner extends Widget_Base {
314
);
315
316
317
- $this->add_control(
318
- 'premium_banner_more_text',
319
[
320
'label' => esc_html__('Text','premium-addons-for-elementor'),
321
'type' => Controls_Manager::TEXT,
@@ -328,8 +302,7 @@ class Premium_Banner extends Widget_Base {
328
]
329
);
330
331
- $this->add_control(
332
- 'premium_banner_link_selection',
333
[
334
'label' => esc_html__('Link Type', 'premium-addons-for-elementor'),
335
'type' => Controls_Manager::SELECT,
@@ -346,14 +319,13 @@ class Premium_Banner extends Widget_Base {
346
]
347
);
348
349
- $this->add_control(
350
- 'premium_banner_link',
351
[
352
'label' => esc_html__('Link', 'premium-addons-for-elementor'),
353
'type' => Controls_Manager::URL,
354
'default' => [
355
'url' => '#',
356
- ],
357
'placeholder' => 'https://premiumaddons.com/',
358
'label_block' => true,
359
'condition' => [
@@ -364,8 +336,7 @@ class Premium_Banner extends Widget_Base {
364
]
365
);
366
367
- $this->add_control(
368
- 'premium_banner_existing_link',
369
[
370
'label' => esc_html__('Existing Page', 'premium-addons-for-elementor'),
371
'type' => Controls_Manager::SELECT2,
@@ -376,7 +347,7 @@ class Premium_Banner extends Widget_Base {
376
'premium_banner_link_switcher' => 'yes',
377
'premium_banner_link_url_switch!' => 'yes'
378
],
379
- 'label_block' => true,
380
]
381
);
382
@@ -405,21 +376,23 @@ class Premium_Banner extends Widget_Base {
405
'{{WRAPPER}} .premium_addons-banner-ib-title, {{WRAPPER}} .premium_addons-banner-ib-content, {{WRAPPER}} .premium-banner-read-more' => 'text-align: {{VALUE}};',
406
]
407
]
408
- );
409
410
$this->end_controls_section();
411
412
$this->start_controls_section('premium_banner_responsive_section',
413
[
414
'label' => esc_html__('Responsive', 'premium-addons-for-elementor'),
415
- ]);
416
417
$this->add_control('premium_banner_responsive_switcher',
418
[
419
'label' => esc_html__('Responsive Controls', 'premium-addons-for-elementor'),
420
'type' => Controls_Manager::SWITCHER,
421
'description' => esc_html__('If the description text is not suiting well on specific screen sizes, you may enable this option which will hide the description text.', 'premium-addons-for-elementor')
422
- ]);
423
424
$this->add_control('premium_banner_min_range',
425
[
@@ -430,7 +403,8 @@ class Premium_Banner extends Widget_Base {
430
'condition' => [
431
'premium_banner_responsive_switcher' => 'yes'
432
],
433
- ]);
434
435
$this->add_control('premium_banner_max_range',
436
[
@@ -441,79 +415,76 @@ class Premium_Banner extends Widget_Base {
441
'condition' => [
442
'premium_banner_responsive_switcher' => 'yes'
443
],
444
- ]);
445
446
$this->end_controls_section();
447
448
- $this->start_controls_section(
449
- 'premium_banner_opacity_style',
450
[
451
'label' => esc_html__( 'Image', 'premium-addons-for-elementor' ),
452
'tab' => Controls_Manager::TAB_STYLE
453
]
454
);
455
456
- $this->add_control(
457
- 'premium_banner_image_bg_color',
458
[
459
'label' => esc_html__( 'Background Color', 'premium-addons-for-elementor' ),
460
'type' => Controls_Manager::COLOR,
461
'selectors' => [
462
- '{{WRAPPER}} .premium_addons-banner-ib' => 'background: {{VALUE}};',
463
]
464
]
465
);
466
467
- $this->add_control(
468
- 'premium_banner_image_opacity',
469
[
470
'label' => esc_html__( 'Image Opacity', 'premium-addons-for-elementor' ),
471
'type' => Controls_Manager::SLIDER,
472
'default' => [
473
- 'size' => 1,
474
],
475
'range' => [
476
'px' => [
477
'min' => 0,
478
'max' => 1,
479
- 'step' => .1,
480
]
481
],
482
'selectors' => [
483
- '{{WRAPPER}} .premium_addons-banner-ib .premium_addons-banner-ib-img' => 'opacity: {{SIZE}};',
484
- ],
485
]
486
);
487
488
489
- $this->add_control(
490
- 'premium_banner_image_hover_opacity',
491
[
492
'label' => esc_html__( 'Hover Opacity', 'premium-addons-for-elementor' ),
493
'type' => Controls_Manager::SLIDER,
494
'default' => [
495
- 'size' => 1,
496
],
497
'range' => [
498
'px' => [
499
'min' => 0,
500
'max' => 1,
501
- 'step' => .1,
502
]
503
],
504
'selectors' => [
505
- '{{WRAPPER}} .premium_addons-banner-ib .premium_addons-banner-ib-img.active' => 'opacity: {{SIZE}};',
506
- ],
507
]
508
);
509
510
$this->add_group_control(
511
Group_Control_Border::get_type(),
512
- [
513
- 'name' => 'premium_banner_image_border',
514
- 'selector' => '{{WRAPPER}} .premium_addons-banner-ib',
515
- ]
516
- );
517
518
$this->add_responsive_control(
519
'premium_banner_image_border_radius',
@@ -522,38 +493,35 @@ class Premium_Banner extends Widget_Base {
522
'type' => Controls_Manager::SLIDER,
523
'size_units' => ['px', '%' ,'em'],
524
'selectors' => [
525
- '{{WRAPPER}} .premium_addons-banner-ib' => 'border-radius: {{SIZE}}{{UNIT}};',
526
- ],
527
]
528
);
529
530
$this->end_controls_section();
531
532
- $this->start_controls_section(
533
- 'premium_banner_title_style',
534
[
535
'label' => esc_html__( 'Title', 'premium-addons-for-elementor' ),
536
'tab' => Controls_Manager::TAB_STYLE
537
]
538
);
539
540
- $this->add_control(
541
- 'premium_banner_color_of_title',
542
[
543
'label' => esc_html__( 'Color', 'premium-addons-for-elementor' ),
544
'type' => Controls_Manager::COLOR,
545
'scheme' => [
546
'type' => Scheme_Color::get_type(),
547
- 'value' => Scheme_Color::COLOR_1,
548
],
549
'selectors' => [
550
'{{WRAPPER}} .premium_addons-banner-ib-desc .premium_banner_title' => 'color: {{VALUE}};'
551
- ],
552
]
553
);
554
555
- $this->add_control(
556
- 'premium_banner_style2_title_bg',
557
[
558
'label' => esc_html__( 'Title Background', 'premium-addons-for-elementor' ),
559
'type' => Controls_Manager::COLOR,
@@ -564,7 +532,7 @@ class Premium_Banner extends Widget_Base {
564
],
565
'selectors' => [
566
'{{WRAPPER}} .premium_banner_animation5 .premium_addons-banner-ib-desc' => 'background: {{VALUE}};',
567
- ],
568
]
569
);
570
@@ -573,7 +541,7 @@ class Premium_Banner extends Widget_Base {
573
[
574
'name' => 'premium_banner_title_typography',
575
'selector' => '{{WRAPPER}} .premium_addons-banner-ib-desc .premium_banner_title',
576
- 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
577
]
578
);
579
@@ -582,28 +550,26 @@ class Premium_Banner extends Widget_Base {
582
[
583
'label' => esc_html__('Shadow','premium-addons-for-elementor'),
584
'name' => 'premium_banner_title_shadow',
585
- 'selector' => '{{WRAPPER}} .premium_addons-banner-ib-desc .premium_banner_title',
586
]
587
- );
588
589
$this->end_controls_section();
590
591
- $this->start_controls_section(
592
- 'premium_banner_styles_of_content',
593
[
594
'label' => esc_html__( 'Description', 'premium-addons-for-elementor' ),
595
'tab' => Controls_Manager::TAB_STYLE
596
]
597
);
598
599
- $this->add_control(
600
- 'premium_banner_color_of_content',
601
[
602
'label' => esc_html__( 'Color', 'premium-addons-for-elementor' ),
603
'type' => Controls_Manager::COLOR,
604
'scheme' => [
605
'type' => Scheme_Color::get_type(),
606
- 'value' => Scheme_Color::COLOR_3,
607
],
608
'selectors' => [
609
'{{WRAPPER}} .premium_banner .premium_banner_content' => 'color: {{VALUE}};'
@@ -627,12 +593,11 @@ class Premium_Banner extends Widget_Base {
627
'name' => 'premium_banner_description_shadow',
628
'selector' => '{{WRAPPER}} .premium_banner .premium_banner_content',
629
]
630
- );
631
632
$this->end_controls_section();
633
634
- $this->start_controls_section(
635
- 'premium_banner_styles_of_button',
636
[
637
'label' => esc_html__( 'Button', 'premium-addons-for-elementor' ),
638
'tab' => Controls_Manager::TAB_STYLE,
@@ -643,23 +608,21 @@ class Premium_Banner extends Widget_Base {
643
]
644
);
645
646
- $this->add_control(
647
- 'premium_banner_color_of_button',
648
[
649
'label' => esc_html__( 'Color', 'premium-addons-for-elementor' ),
650
'type' => Controls_Manager::COLOR,
651
'scheme' => [
652
'type' => Scheme_Color::get_type(),
653
- 'value' => Scheme_Color::COLOR_3,
654
],
655
'selectors' => [
656
'{{WRAPPER}} .premium_banner .premium-banner-link' => 'color: {{VALUE}};'
657
- ],
658
]
659
);
660
661
- $this->add_control(
662
- 'premium_banner_hover_color_of_button',
663
[
664
'label' => esc_html__( 'Hover Color', 'premium-addons-for-elementor' ),
665
'type' => Controls_Manager::COLOR,
@@ -669,7 +632,7 @@ class Premium_Banner extends Widget_Base {
669
],
670
'selectors' => [
671
'{{WRAPPER}} .premium_banner .premium-banner-link:hover' => 'color: {{VALUE}};'
672
- ],
673
]
674
);
675
@@ -693,35 +656,34 @@ class Premium_Banner extends Widget_Base {
693
]
694
);
695
696
- $this->add_control(
697
- 'premium_banner_hover_backcolor_of_button',
698
[
699
'label' => esc_html__( 'Hover Background Color', 'premium-addons-for-elementor' ),
700
'type' => Controls_Manager::COLOR,
701
'selectors' => [
702
'{{WRAPPER}} .premium_banner .premium-banner-link:hover' => 'background-color: {{VALUE}};'
703
- ],
704
]
705
);
706
707
$this->add_group_control(
708
Group_Control_Border::get_type(),
709
- [
710
- 'name' => 'premium_banner_button_border',
711
- 'selector' => '{{WRAPPER}} .premium_banner .premium-banner-link',
712
- ]
713
- );
714
715
$this->add_control('premium_banner_button_border_radius',
716
- [
717
- 'label' => esc_html__('Border Radius', 'premium-addons-for-elementor'),
718
- 'type' => Controls_Manager::SLIDER,
719
- 'size_units' => ['px', '%' ,'em'],
720
- 'selectors' => [
721
- '{{WRAPPER}} .premium_banner .premium-banner-link' => 'border-radius: {{SIZE}}{{UNIT}};'
722
- ]
723
]
724
- );
725
726
$this->add_group_control(
727
Group_Control_Text_Shadow::get_type(),
@@ -730,17 +692,18 @@ class Premium_Banner extends Widget_Base {
730
'name' => 'premium_banner_button_shadow',
731
'selector' => '{{WRAPPER}} .premium_banner .premium-banner-link',
732
]
733
- );
734
735
$this->add_responsive_control('premium_banner_button_padding',
736
- [
737
- 'label' => esc_html__('Padding', 'premium-addons-for-elementor'),
738
- 'type' => Controls_Manager::DIMENSIONS,
739
- 'size_units' => ['px', 'em', '%'],
740
- 'selectors' => [
741
- '{{WRAPPER}} .premium_banner .premium-banner-link' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
742
- ]
743
- ]);
744
745
$this->end_controls_section();
746
@@ -756,7 +719,7 @@ class Premium_Banner extends Widget_Base {
756
$title = $settings[ 'premium_banner_title' ];
757
$full_title = '<'. $title_tag . ' class="premium_addons-banner-ib-title ult-responsive premium_banner_title"><div '. $this->get_render_attribute_string('premium_banner_title') .'>' .$title. '</div></'.$title_tag.'>';
758
759
- $link = isset( $settings['premium_banner_image_link_switcher'] ) && $settings['premium_banner_image_link_switcher'] != '' ? $settings['premium_banner_image_custom_link']['url'] : get_permalink( $settings['premium_banner_image_existing_page_link'] );
760
761
$link_title = $settings['premium_banner_image_link_switcher'] != 'yes' ? get_the_title( $settings['premium_banner_image_existing_page_link'] ) : '';
762
@@ -765,30 +728,28 @@ class Premium_Banner extends Widget_Base {
765
$full_link = '<a class="premium_addons-banner-ib-link" href="'. $link .'" title="'. $link_title .'"'. $open_new_tab . $nofollow_link . '></a>';
766
$animation_class = $settings['premium_banner_image_animation'];
767
$hover_class = ' ' . $settings['premium_banner_hover_effect'];
768
- $extra_class = isset( $settings['premium_banner_extra_class'] ) && $settings['premium_banner_extra_class'] != '' ? ' '. $settings['premium_banner_extra_class'] : '';
769
$active = $settings['premium_banner_active'] == 'yes' ? ' active' : '';
770
$full_class = $animation_class.$hover_class.$extra_class.$active;
771
- $min_size = $settings['premium_banner_min_range'].'px';
772
- $max_size = $settings['premium_banner_max_range'].'px';
773
774
775
$banner_url = 'url' == $settings['premium_banner_link_selection'] ? $settings['premium_banner_link']['url'] : get_permalink($settings['premium_banner_existing_link']);
776
777
$alt = esc_attr( Control_Media::get_image_alt( $settings['premium_banner_image'] ) );
778
779
-
780
- ob_start();
781
- ?>
782
<div class="premium_banner" id="premium-banner-<?php echo esc_attr($this->get_id()); ?>">
783
<div class="premium_addons-banner-ib <?php echo $full_class; ?> premium-banner-min-height">
784
- <?php if( isset( $settings['premium_banner_image']['url'] ) && $settings['premium_banner_image']['url'] != '' ): ?>
785
- <?php if($settings['premium_banner_height'] == 'custom' ): ?>
786
- <div class="premium_addons-banner-img-wrap">
787
- <?php endif; ?>
788
- <img class="premium_addons-banner-ib-img" alt="<?php echo $alt; ?>" src="<?php echo $settings['premium_banner_image']['url']; ?>">
789
- <?php if($settings['premium_banner_height'] == 'custom' ): ?>
790
- </div>
791
- <?php endif; ?>
792
<?php endif; ?>
793
<div class="premium_addons-banner-ib-desc">
794
<?php echo $full_title; ?>
@@ -804,7 +765,7 @@ class Premium_Banner extends Widget_Base {
804
<?php endif; ?>
805
</div>
806
<?php
807
- if( $settings['premium_banner_link_url_switch'] == 'yes' && (!empty( $settings['premium_banner_image_custom_link']['url'] ) || !empty($settings['premium_banner_image_existing_page_link'] )) ) {
808
echo $full_link;
809
}
810
?>
@@ -820,8 +781,7 @@ class Premium_Banner extends Widget_Base {
820
<?php endif; ?>
821
822
</div>
823
- <?php $output = ob_get_clean();
824
- echo $output;
825
}
826
827
protected function content_template() {
1
+ <?php
2
+
3
namespace Elementor;
4
5
if ( ! defined( 'ABSPATH' ) ) exit; // If this file is called directly, abort.
37
// This will controls the animation, colors and background, dimensions etc
38
protected function _register_controls() {
39
40
+ $this->start_controls_section('premium_banner_global_settings',
41
[
42
+ 'label' => esc_html__( 'Image', 'premium-addons-for-elementor' )
43
]
44
);
45
46
+ $this->add_control('premium_banner_image',
47
[
48
'label' => esc_html__( 'Upload Image', 'premium-addons-for-elementor' ),
49
'description' => esc_html__( 'Select an image for the Banner', 'premium-addons-for-elementor' ),
57
);
58
59
$this->add_control('premium_banner_link_url_switch',
60
+ [
61
+ 'label' => esc_html__('Link', 'premium-addons-for-elementor'),
62
+ 'type' => Controls_Manager::SWITCHER
63
+ ]
64
+ );
65
66
+ $this->add_control('premium_banner_image_link_switcher',
67
[
68
'label' => esc_html__( 'Custom Link', 'premium-addons-for-elementor' ),
69
'type' => Controls_Manager::SWITCHER,
70
'description' => esc_html__( 'Add a custom link to the banner', 'premium-addons-for-elementor' ),
71
'condition' => [
72
'premium_banner_link_url_switch' => 'yes',
74
]
75
);
76
77
+ $this->add_control('premium_banner_image_custom_link',
78
[
79
'label' => esc_html__( 'Set custom Link', 'premium-addons-for-elementor' ),
80
'type' => Controls_Manager::URL,
81
'description' => esc_html__( 'What custom link you want to set to banner?', 'premium-addons-for-elementor' ),
82
'condition' => [
83
'premium_banner_image_link_switcher' => 'yes',
84
+ 'premium_banner_link_url_switch' => 'yes'
85
],
86
+ 'show_external' => false
87
]
88
);
89
90
+ $this->add_control('premium_banner_image_existing_page_link',
91
[
92
'label' => esc_html__( 'Existing Page', 'premium-addons-for-elementor' ),
93
'type' => Controls_Manager::SELECT2,
94
'description' => esc_html__( 'Link the banner with an existing page', 'premium-addons-for-elementor' ),
95
'condition' => [
96
'premium_banner_image_link_switcher!' => 'yes',
97
+ 'premium_banner_link_url_switch' => 'yes'
98
],
99
'multiple' => false,
100
'options' => $this->getTemplateInstance()->get_all_post()
101
]
102
);
103
104
+ $this->add_control('premium_banner_image_link_open_new_tab',
105
[
106
'label' => esc_html__( 'New Tab', 'premium-addons-for-elementor' ),
107
'type' => Controls_Manager::SWITCHER,
108
'description' => esc_html__( 'Choose if you want the link be opened in a new tab or not', 'premium-addons-for-elementor' ),
109
'condition' => [
110
+ 'premium_banner_link_url_switch' => 'yes'
111
+ ]
112
]
113
);
114
115
+ $this->add_control('premium_banner_image_link_add_nofollow',
116
[
117
'label' => esc_html__( 'Nofollow Option', 'premium-addons-for-elementor' ),
118
'type' => Controls_Manager::SWITCHER,
119
'description' => esc_html__('if you choose yes, the link will not be counted in search engines', 'premium-addons-for-elementor' ),
120
'condition' => [
121
+ 'premium_banner_link_url_switch' => 'yes'
122
+ ]
123
]
124
);
125
126
+ $this->add_control('premium_banner_image_animation',
127
[
128
'label' => esc_html__( 'Effect', 'premium-addons-for-elementor' ),
129
'type' => Controls_Manager::SELECT,
140
]
141
);
142
143
+ $this->add_control('premium_banner_active',
144
[
145
'label' => esc_html__( 'Always Hovered', 'premium-addons-for-elementor' ),
146
'type' => Controls_Manager::SWITCHER,
147
+ 'description' => esc_html__( 'Choose if you want the effect to be always triggered', 'premium-addons-for-elementor' )
148
]
149
);
150
151
+ $this->add_control('premium_banner_hover_effect',
152
+ [
153
+ 'label' => esc_html__('Hover Effect', 'premium-addons-for-elementor'),
154
+ 'type' => Controls_Manager::SELECT,
155
+ 'options' => [
156
+ 'none' => esc_html__('None', 'premium-addons-for-elementor'),
157
+ 'zoomin' => esc_html__('Zoom In', 'premium-addons-for-elementor'),
158
+ 'zoomout' => esc_html__('Zoom Out', 'premium-addons-for-elementor'),
159
+ 'scale' => esc_html__('Scale', 'premium-addons-for-elementor'),
160
+ 'grayscale' => esc_html__('Grayscale', 'premium-addons-for-elementor'),
161
+ 'blur' => esc_html__('Blur', 'premium-addons-for-elementor'),
162
+ 'bright' => esc_html__('Bright', 'premium-addons-for-elementor'),
163
+ 'sepia' => esc_html__('Sepia', 'premium-addons-for-elementor'),
164
+ ],
165
+ 'default' => 'none',
166
+ ]
167
+ );
168
169
+ $this->add_control('premium_banner_height',
170
[
171
'label' => esc_html__( 'Height', 'premium-addons-for-elementor' ),
172
'type' => Controls_Manager::SELECT,
173
'options' => [
174
'default' => 'Default',
175
+ 'custom' => 'Custom'
176
],
177
'default' => 'default',
178
+ 'description' => esc_html__( 'Choose if you want to set a custom height for the banner or keep it as it is', 'premium-addons-for-elementor' )
179
]
180
);
181
182
+ $this->add_responsive_control('premium_banner_custom_height',
183
[
184
'label' => esc_html__( 'Min Height', 'premium-addons-for-elementor' ),
185
'type' => Controls_Manager::NUMBER,
193
]
194
);
195
196
+ $this->add_responsive_control('premium_banner_img_vertical_align',
197
[
198
'label' => esc_html__( 'Vertical Align', 'premium-addons-for-elementor' ),
199
'type' => Controls_Manager::SELECT,
204
'flex-start' => esc_html__('Top', 'premium-addons-for-elementor'),
205
'center' => esc_html__('Middle', 'premium-addons-for-elementor'),
206
'flex-end' => esc_html__('Bottom', 'premium-addons-for-elementor'),
207
+ 'inherit' => esc_html__('Full', 'premium-addons-for-elementor')
208
],
209
'default' => 'flex-start',
210
'selectors' => [
213
]
214
);
215
216
+ $this->add_control('premium_banner_extra_class',
217
[
218
'label' => esc_html__( 'Extra Class', 'premium-addons-for-elementor' ),
219
'type' => Controls_Manager::TEXT,
220
+ 'description' => esc_html__( 'Add extra class name that will be applied to the banner, and you can use this class for your customizations.', 'premium-addons-for-elementor' )
221
]
222
);
223
224
225
$this->end_controls_section();
226
227
+ $this->start_controls_section('premium_banner_image_section',
228
[
229
'label' => esc_html__( 'Content', 'premium-addons-for-elementor' )
230
]
231
);
232
233
+ $this->add_control('premium_banner_title',
234
[
235
'label' => esc_html__( 'Title', 'premium-addons-for-elementor' ),
236
'placeholder' => esc_html__( 'Give a title to this banner', 'premium-addons-for-elementor' ),
237
'type' => Controls_Manager::TEXT,
238
'dynamic' => [ 'active' => true ],
239
'default' => esc_html__( 'Premium Banner', 'premium-addons-for-elementor' ),
241
]
242
);
243
244
+ $this->add_control('premium_banner_title_tag',
245
[
246
'label' => esc_html__( 'HTML Tag', 'premium-addons-for-elementor' ),
247
'description' => esc_html__( 'Select a heading tag for the title. Headings are defined with H1 to H6 tags', 'premium-addons-for-elementor' ),
248
'type' => Controls_Manager::SELECT,
249
'default' => 'h3',
250
'options' => [
251
+ 'h1' => 'H1',
252
+ 'h2' => 'H2',
253
+ 'h3' => 'H3',
254
+ 'h4' => 'H4',
255
+ 'h5' => 'H5',
256
+ 'h6' => 'H6',
257
+ ],
258
'label_block' => true,
259
]
260
);
261
262
263
+ $this->add_control('premium_banner_description_hint',
264
[
265
'label' => esc_html__( 'Description', 'premium-addons-for-elementor' ),
266
'type' => Controls_Manager::HEADING,
267
]
268
);
269
270
+ $this->add_control('premium_banner_description',
271
[
272
'label' => esc_html__( 'Description', 'premium-addons-for-elementor' ),
273
'description' => esc_html__( 'Give the description to this banner', 'premium-addons-for-elementor' ),
278
]
279
);
280
281
+ $this->add_control('premium_banner_link_switcher',
282
[
283
'label' => esc_html__('Button', 'premium-addons-for-elementor'),
284
'type' => Controls_Manager::SWITCHER,
289
);
290
291
292
+ $this->add_control('premium_banner_more_text',
293
[
294
'label' => esc_html__('Text','premium-addons-for-elementor'),
295
'type' => Controls_Manager::TEXT,
302
]
303
);
304
305
+ $this->add_control('premium_banner_link_selection',
306
[
307
'label' => esc_html__('Link Type', 'premium-addons-for-elementor'),
308
'type' => Controls_Manager::SELECT,
319
]
320
);
321
322
+ $this->add_control('premium_banner_link',
323
[
324
'label' => esc_html__('Link', 'premium-addons-for-elementor'),
325
'type' => Controls_Manager::URL,
326
'default' => [
327
'url' => '#',
328
+ ],
329
'placeholder' => 'https://premiumaddons.com/',
330
'label_block' => true,
331
'condition' => [
336
]
337
);
338
339
+ $this->add_control('premium_banner_existing_link',
340
[
341
'label' => esc_html__('Existing Page', 'premium-addons-for-elementor'),
342
'type' => Controls_Manager::SELECT2,
347
'premium_banner_link_switcher' => 'yes',
348
'premium_banner_link_url_switch!' => 'yes'
349
],
350
+ 'label_block' => true
351
]
352
);
353
376
'{{WRAPPER}} .premium_addons-banner-ib-title, {{WRAPPER}} .premium_addons-banner-ib-content, {{WRAPPER}} .premium-banner-read-more' => 'text-align: {{VALUE}};',
377
]
378
]
379
+ );
380
381
$this->end_controls_section();
382
383
$this->start_controls_section('premium_banner_responsive_section',
384
[
385
'label' => esc_html__('Responsive', 'premium-addons-for-elementor'),
386
+ ]
387
+ );
388
389
$this->add_control('premium_banner_responsive_switcher',
390
[
391
'label' => esc_html__('Responsive Controls', 'premium-addons-for-elementor'),
392
'type' => Controls_Manager::SWITCHER,
393
'description' => esc_html__('If the description text is not suiting well on specific screen sizes, you may enable this option which will hide the description text.', 'premium-addons-for-elementor')
394
+ ]
395
+ );
396
397
$this->add_control('premium_banner_min_range',
398
[
403
'condition' => [
404
'premium_banner_responsive_switcher' => 'yes'
405
],
406
+ ]
407
+ );
408
409
$this->add_control('premium_banner_max_range',
410
[
415
'condition' => [
416
'premium_banner_responsive_switcher' => 'yes'
417
],
418
+ ]
419
+ );
420
421
$this->end_controls_section();
422
423
+ $this->start_controls_section('premium_banner_opacity_style',
424
[
425
'label' => esc_html__( 'Image', 'premium-addons-for-elementor' ),
426
'tab' => Controls_Manager::TAB_STYLE
427
]
428
);
429
430
+ $this->add_control('premium_banner_image_bg_color',
431
[
432
'label' => esc_html__( 'Background Color', 'premium-addons-for-elementor' ),
433
'type' => Controls_Manager::COLOR,
434
'selectors' => [
435
+ '{{WRAPPER}} .premium_addons-banner-ib' => 'background: {{VALUE}};'
436
]
437
]
438
);
439
440
+ $this->add_control('premium_banner_image_opacity',
441
[
442
'label' => esc_html__( 'Image Opacity', 'premium-addons-for-elementor' ),
443
'type' => Controls_Manager::SLIDER,
444
'default' => [
445
+ 'size' => 1
446
],
447
'range' => [
448
'px' => [
449
'min' => 0,
450
'max' => 1,
451
+ 'step' => .1
452
]
453
],
454
'selectors' => [
455
+ '{{WRAPPER}} .premium_addons-banner-ib .premium_addons-banner-ib-img' => 'opacity: {{SIZE}};'
456
+ ]
457
]
458
);
459
460
461
+ $this->add_control('premium_banner_image_hover_opacity',
462
[
463
'label' => esc_html__( 'Hover Opacity', 'premium-addons-for-elementor' ),
464
'type' => Controls_Manager::SLIDER,
465
'default' => [
466
+ 'size' => 1
467
],
468
'range' => [
469
'px' => [
470
'min' => 0,
471
'max' => 1,
472
+ 'step' => .1
473
]
474
],
475
'selectors' => [
476
+ '{{WRAPPER}} .premium_addons-banner-ib .premium_addons-banner-ib-img.active' => 'opacity: {{SIZE}};'
477
+ ]
478
]
479
);
480
481
$this->add_group_control(
482
Group_Control_Border::get_type(),
483
+ [
484
+ 'name' => 'premium_banner_image_border',
485
+ 'selector' => '{{WRAPPER}} .premium_addons-banner-ib'
486
+ ]
487
+ );
488
489
$this->add_responsive_control(
490
'premium_banner_image_border_radius',
493
'type' => Controls_Manager::SLIDER,
494
'size_units' => ['px', '%' ,'em'],
495
'selectors' => [
496
+ '{{WRAPPER}} .premium_addons-banner-ib' => 'border-radius: {{SIZE}}{{UNIT}};'
497
+ ]
498
]
499
);
500
501
$this->end_controls_section();
502
503
+ $this->start_controls_section('premium_banner_title_style',
504
[
505
'label' => esc_html__( 'Title', 'premium-addons-for-elementor' ),
506
'tab' => Controls_Manager::TAB_STYLE
507
]
508
);
509
510
+ $this->add_control('premium_banner_color_of_title',
511
[
512
'label' => esc_html__( 'Color', 'premium-addons-for-elementor' ),
513
'type' => Controls_Manager::COLOR,
514
'scheme' => [
515
'type' => Scheme_Color::get_type(),
516
+ 'value' => Scheme_Color::COLOR_1
517
],
518
'selectors' => [
519
'{{WRAPPER}} .premium_addons-banner-ib-desc .premium_banner_title' => 'color: {{VALUE}};'
520
+ ]
521
]
522
);
523
524
+ $this->add_control('premium_banner_style2_title_bg',
525
[
526
'label' => esc_html__( 'Title Background', 'premium-addons-for-elementor' ),
527
'type' => Controls_Manager::COLOR,
532
],
533
'selectors' => [
534
'{{WRAPPER}} .premium_banner_animation5 .premium_addons-banner-ib-desc' => 'background: {{VALUE}};',
535
+ ]
536
]
537
);
538
541
[
542
'name' => 'premium_banner_title_typography',
543
'selector' => '{{WRAPPER}} .premium_addons-banner-ib-desc .premium_banner_title',
544
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1
545
]
546
);
547
550
[
551
'label' => esc_html__('Shadow','premium-addons-for-elementor'),
552
'name' => 'premium_banner_title_shadow',
553
+ 'selector' => '{{WRAPPER}} .premium_addons-banner-ib-desc .premium_banner_title'
554
]
555
+ );
556
557
$this->end_controls_section();
558
559
+ $this->start_controls_section('premium_banner_styles_of_content',
560
[
561
'label' => esc_html__( 'Description', 'premium-addons-for-elementor' ),
562
'tab' => Controls_Manager::TAB_STYLE
563
]
564
);
565
566
+ $this->add_control('premium_banner_color_of_content',
567
[
568
'label' => esc_html__( 'Color', 'premium-addons-for-elementor' ),
569
'type' => Controls_Manager::COLOR,
570
'scheme' => [
571
'type' => Scheme_Color::get_type(),
572
+ 'value' => Scheme_Color::COLOR_3
573
],
574
'selectors' => [
575
'{{WRAPPER}} .premium_banner .premium_banner_content' => 'color: {{VALUE}};'
593
'name' => 'premium_banner_description_shadow',
594
'selector' => '{{WRAPPER}} .premium_banner .premium_banner_content',
595
]
596
+ );
597
598
$this->end_controls_section();
599
600
+ $this->start_controls_section('premium_banner_styles_of_button',
601
[
602
'label' => esc_html__( 'Button', 'premium-addons-for-elementor' ),
603
'tab' => Controls_Manager::TAB_STYLE,
608
]
609
);
610
611
+ $this->add_control('premium_banner_color_of_button',
612
[
613
'label' => esc_html__( 'Color', 'premium-addons-for-elementor' ),
614
'type' => Controls_Manager::COLOR,
615
'scheme' => [
616
'type' => Scheme_Color::get_type(),
617
+ 'value' => Scheme_Color::COLOR_3
618
],
619
'selectors' => [
620
'{{WRAPPER}} .premium_banner .premium-banner-link' => 'color: {{VALUE}};'
621
+ ]
622
]
623
);
624
625
+ $this->add_control('premium_banner_hover_color_of_button',
626
[
627
'label' => esc_html__( 'Hover Color', 'premium-addons-for-elementor' ),
628
'type' => Controls_Manager::COLOR,
632
],
633
'selectors' => [
634
'{{WRAPPER}} .premium_banner .premium-banner-link:hover' => 'color: {{VALUE}};'
635
+ ]
636
]
637
);
638
656
]
657
);
658
659
+ $this->add_control('premium_banner_hover_backcolor_of_button',
660
[
661
'label' => esc_html__( 'Hover Background Color', 'premium-addons-for-elementor' ),
662
'type' => Controls_Manager::COLOR,
663
'selectors' => [
664
'{{WRAPPER}} .premium_banner .premium-banner-link:hover' => 'background-color: {{VALUE}};'
665
+ ]
666
]
667
);
668
669
$this->add_group_control(
670
Group_Control_Border::get_type(),
671
+ [
672
+ 'name' => 'premium_banner_button_border',
673
+ 'selector' => '{{WRAPPER}} .premium_banner .premium-banner-link'
674
+ ]
675
+ );
676
677
$this->add_control('premium_banner_button_border_radius',
678
+ [
679
+ 'label' => esc_html__('Border Radius', 'premium-addons-for-elementor'),
680
+ 'type' => Controls_Manager::SLIDER,
681
+ 'size_units' => ['px', '%' ,'em'],
682
+ 'selectors' => [
683
+ '{{WRAPPER}} .premium_banner .premium-banner-link' => 'border-radius: {{SIZE}}{{UNIT}};'
684
]
685
+ ]
686
+ );
687
688
$this->add_group_control(
689
Group_Control_Text_Shadow::get_type(),
692
'name' => 'premium_banner_button_shadow',
693
'selector' => '{{WRAPPER}} .premium_banner .premium-banner-link',
694
]
695
+ );
696
697
$this->add_responsive_control('premium_banner_button_padding',
698
+ [
699
+ 'label' => esc_html__('Padding', 'premium-addons-for-elementor'),
700
+ 'type' => Controls_Manager::DIMENSIONS,
701
+ 'size_units' => ['px', 'em', '%'],
702
+ 'selectors' => [
703
+ '{{WRAPPER}} .premium_banner .premium-banner-link' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
704
+ ]
705
+ ]
706
+ );
707
708
$this->end_controls_section();
709
719
$title = $settings[ 'premium_banner_title' ];
720
$full_title = '<'. $title_tag . ' class="premium_addons-banner-ib-title ult-responsive premium_banner_title"><div '. $this->get_render_attribute_string('premium_banner_title') .'>' .$title. '</div></'.$title_tag.'>';
721
722
+ $link = 'yes' == $settings['premium_banner_image_link_switcher'] ? $settings['premium_banner_image_custom_link']['url'] : get_permalink( $settings['premium_banner_image_existing_page_link'] );
723
724
$link_title = $settings['premium_banner_image_link_switcher'] != 'yes' ? get_the_title( $settings['premium_banner_image_existing_page_link'] ) : '';
725
728
$full_link = '<a class="premium_addons-banner-ib-link" href="'. $link .'" title="'. $link_title .'"'. $open_new_tab . $nofollow_link . '></a>';
729
$animation_class = $settings['premium_banner_image_animation'];
730
$hover_class = ' ' . $settings['premium_banner_hover_effect'];
731
+ $extra_class = ! empty( $settings['premium_banner_extra_class'] ) ? ' '. $settings['premium_banner_extra_class'] : '';
732
$active = $settings['premium_banner_active'] == 'yes' ? ' active' : '';
733
$full_class = $animation_class.$hover_class.$extra_class.$active;
734
+ $min_size = $settings['premium_banner_min_range'] .'px';
735
+ $max_size = $settings['premium_banner_max_range'] .'px';
736
737
738
$banner_url = 'url' == $settings['premium_banner_link_selection'] ? $settings['premium_banner_link']['url'] : get_permalink($settings['premium_banner_existing_link']);
739
740
$alt = esc_attr( Control_Media::get_image_alt( $settings['premium_banner_image'] ) );
741
742
+ ?>
743
<div class="premium_banner" id="premium-banner-<?php echo esc_attr($this->get_id()); ?>">
744
<div class="premium_addons-banner-ib <?php echo $full_class; ?> premium-banner-min-height">
745
+ <?php if( !empty( $settings['premium_banner_image']['url'] ) ) : ?>
746
+ <?php if( $settings['premium_banner_height'] == 'custom' ) : ?>
747
+ <div class="premium_addons-banner-img-wrap">
748
+ <?php endif; ?>
749
+ <img class="premium_addons-banner-ib-img" alt="<?php echo $alt; ?>" src="<?php echo $settings['premium_banner_image']['url']; ?>">
750
+ <?php if( $settings['premium_banner_height'] == 'custom' ): ?>
751
+ </div>
752
+ <?php endif; ?>
753
<?php endif; ?>
754
<div class="premium_addons-banner-ib-desc">
755
<?php echo $full_title; ?>
765
<?php endif; ?>
766
</div>
767
<?php
768
+ if( $settings['premium_banner_link_url_switch'] == 'yes' && ( ! empty( $settings['premium_banner_image_custom_link']['url'] ) || !empty( $settings['premium_banner_image_existing_page_link'] ) ) ) {
769
echo $full_link;
770
}
771
?>
781
<?php endif; ?>
782
783
</div>
784
+ <?php
785
}
786
787
protected function content_template() {
widgets/premium-dual-header.php CHANGED
@@ -1,4 +1,5 @@
1
<?php
2
namespace Elementor;
3
4
if ( ! defined( 'ABSPATH' ) ) exit; // If this file is called directly, abort.
@@ -33,449 +34,435 @@ class Premium_Dual_Header extends Widget_Base {
33
34
/*Start General Section*/
35
$this->start_controls_section('premium_dual_header_general_settings',
36
- [
37
- 'label' => esc_html__('Dual Heading', 'premium-addons-for-elementor')
38
- ]
39
- );
40
41
/*First Header*/
42
$this->add_control('premium_dual_header_first_header_text',
43
- [
44
- 'label' => esc_html__('First Heading', 'premium-addons-for-elementor'),
45
- 'type' => Controls_Manager::TEXT,
46
- 'dynamic' => [ 'active' => true ],
47
- 'default' => esc_html__('Premium', 'premium-addons-for-elementor'),
48
- 'label_block' => true,
49
- ]
50
- );
51
-
52
- /* First Wrapper*/
53
- /*$this->add_control('premium_dual_header_first_wrap',
54
- [
55
- 'label' => esc_html__('Wrapper Tag', 'premium-addons-for-elementor'),
56
- 'type' => Controls_Manager::SELECT,
57
- 'default' => 'div',
58
- 'options' => [
59
- 'div' => 'div',
60
- 'span' => 'span',
61
- ],
62
- 'label_block' => true,
63
- ]
64
- );*/
65
-
66
/*Second Header*/
67
$this->add_control('premium_dual_header_second_header_text',
68
- [
69
- 'label' => esc_html__('Second Heading', 'premium-addons-for-elementor'),
70
- 'type' => Controls_Manager::TEXT,
71
- 'dynamic' => [ 'active' => true ],
72
- 'default' => esc_html__('Addons', 'premium-addons-for-elementor'),
73
- 'label_block' => true,
74
- ]
75
- );
76
77
/*Title Tag*/
78
$this->add_control('premium_dual_header_first_header_tag',
79
- [
80
- 'label' => esc_html__('HTML Tag', 'premium-addons-for-elementor'),
81
- 'type' => Controls_Manager::SELECT,
82
- 'default' => 'h2',
83
- 'options' => [
84
- 'h1' => 'H1',
85
- 'h2' => 'H2',
86
- 'h3' => 'H3',
87
- 'h4' => 'H4',
88
- 'h5' => 'H5',
89
- 'h6' => 'H6',
90
- 'p' => 'p',
91
- 'span' => 'span',
92
- ],
93
- 'label_block' => true,
94
- ]
95
- );
96
97
/*Text Align*/
98
$this->add_control('premium_dual_header_position',
99
- [
100
- 'label' => esc_html__( 'Display', 'premium-addons-for-elementor' ),
101
- 'type' => Controls_Manager::SELECT,
102
- 'options' => [
103
- 'inline'=> esc_html__('Inline', 'premium-addons-for-elementor'),
104
- 'block' => esc_html__('Block', 'premium-addons-for-elementor'),
105
- ],
106
- 'default' => 'inline',
107
- 'selectors' => [
108
- '{{WRAPPER}} .premium-dual-header-first-container span, {{WRAPPER}} .premium-dual-header-second-container' => 'display: {{VALUE}};',
109
- ],
110
- 'label_block' => true
111
- ]
112
- );
113
114
$this->add_control('premium_dual_header_link_switcher',
115
- [
116
- 'label' => esc_html__('Link', 'premium-addons-for-elementor'),
117
- 'type' => Controls_Manager::SWITCHER,
118
- 'description' => esc_html__('Enable or disable link','premium-addons-for-elementor'),
119
- ]
120
- );
121
122
$this->add_control('premium_dual_heading_link_selection',
123
- [
124
- 'label' => esc_html__('Link Type', 'premium-addons-for-elementor'),
125
- 'type' => Controls_Manager::SELECT,
126
- 'options' => [
127
- 'url' => esc_html__('URL', 'premium-addons-for-elementor'),
128
- 'link' => esc_html__('Existing Page', 'premium-addons-for-elementor'),
129
- ],
130
- 'default' => 'url',
131
- 'label_block' => true,
132
- 'condition' => [
133
- 'premium_dual_header_link_switcher' => 'yes',
134
- ]
135
- ]
136
- );
137
138
$this->add_control('premium_dual_heading_link',
139
- [
140
- 'label' => esc_html__('Link', 'premium-addons-for-elementor'),
141
- 'type' => Controls_Manager::URL,
142
- 'default' => [
143
- 'url' => '#',
144
- ],
145
- 'placeholder' => 'https://premiumaddons.com/',
146
- 'label_block' => true,
147
- 'separator' => 'after',
148
- 'condition' => [
149
- 'premium_dual_header_link_switcher' => 'yes',
150
- 'premium_dual_heading_link_selection' => 'url'
151
- ]
152
- ]
153
- );
154
155
$this->add_control('premium_dual_heading_existing_link',
156
- [
157
- 'label' => esc_html__('Existing Page', 'premium-addons-for-elementor'),
158
- 'type' => Controls_Manager::SELECT2,
159
- 'options' => $this->getTemplateInstance()->get_all_post(),
160
- 'condition' => [
161
- 'premium_dual_header_link_switcher' => 'yes',
162
- 'premium_dual_heading_link_selection' => 'link',
163
- ],
164
- 'multiple' => false,
165
- 'separator' => 'after',
166
- 'label_block' => true,
167
- ]
168
- );
169
170
/*Text Align*/
171
$this->add_responsive_control('premium_dual_header_text_align',
172
- [
173
- 'label' => esc_html__( 'Alignment', 'premium-addons-for-elementor' ),
174
- 'type' => Controls_Manager::CHOOSE,
175
- 'options' => [
176
- 'left' => [
177
- 'title'=> esc_html__( 'Left', 'premium-addons-for-elementor' ),
178
- 'icon' => 'fa fa-align-left',
179
- ],
180
- 'center' => [
181
- 'title'=> esc_html__( 'Center', 'premium-addons-for-elementor' ),
182
- 'icon' => 'fa fa-align-center',
183
- ],
184
- 'right' => [
185
- 'title'=> esc_html__( 'Right', 'premium-addons-for-elementor' ),
186
- 'icon' => 'fa fa-align-right',
187
- ],
188
- ],
189
- 'default' => 'center',
190
- 'selectors' => [
191
- '{{WRAPPER}} .premium-dual-header-container' => 'text-align: {{VALUE}};',
192
- ],
193
]
194
- );
195
-
196
/*End General Settings Section*/
197
$this->end_controls_section();
198
199
/*Start First Header Styling Section*/
200
$this->start_controls_section('premium_dual_header_first_style',
201
- [
202
- 'label' => esc_html__('First Heading', 'premium-addons-for-elementor'),
203
- 'tab' => Controls_Manager::TAB_STYLE,
204
- ]
205
- );
206
207
/*First Typography*/
208
$this->add_group_control(
209
Group_Control_Typography::get_type(),
210
- [
211
- 'name' => 'first_header_typography',
212
- 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
213
- 'selector' => '{{WRAPPER}} .premium-dual-header-first-span',
214
- ]
215
- );
216
217
$this->add_control('premium_dual_header_first_animated',
218
- [
219
- 'label' => esc_html__('Animated Background', 'premium-addons-for-elementor'),
220
- 'type' => Controls_Manager::SWITCHER,
221
- ]
222
- );
223
-
224
/*First Coloring Style*/
225
$this->add_control('premium_dual_header_first_back_clip',
226
- [
227
- 'label' => esc_html__('Background Style', 'premium-addons-for-elementor'),
228
- 'type' => Controls_Manager::SELECT,
229
- 'default' => 'color',
230
- 'description' => esc_html__('Choose ‘Normal’ style to put a background behind the text. Choose ‘Clipped’ style so the background will be clipped on the text.','premium-addons-for-elementor'),
231
- 'options' => [
232
- 'color' => esc_html__('Normal Background', 'premium-addons-for-elementor'),
233
- 'clipped' => esc_html__('Clipped Background', 'premium-addons-for-elementor'),
234
- ],
235
- 'label_block' => true,
236
- ]
237
- );
238
-
239
/*First Color*/
240
$this->add_control('premium_dual_header_first_color',
241
- [
242
- 'label' => esc_html__('Text Color', 'premium-addons-for-elementor'),
243
- 'type' => Controls_Manager::COLOR,
244
- 'scheme' => [
245
- 'type' => Scheme_Color::get_type(),
246
- 'value' => Scheme_Color::COLOR_1,
247
- ],
248
- 'condition' => [
249
- 'premium_dual_header_first_back_clip' => 'color',
250
- ],
251
- 'selectors' => [
252
- '{{WRAPPER}} .premium-dual-header-first-span' => 'color: {{VALUE}};',
253
- ]
254
- ]
255
- );
256
257
/*First Background Color*/
258
$this->add_group_control(
259
Group_Control_Background::get_type(),
260
- [
261
- 'name' => 'premium_dual_header_first_background',
262
- 'types' => [ 'classic' , 'gradient' ],
263
- 'condition' => [
264
- 'premium_dual_header_first_back_clip' => 'color',
265
- ],
266
- 'selector' => '{{WRAPPER}} .premium-dual-header-first-span',
267
- ]
268
- );
269
270
/*First Clip*/
271
$this->add_group_control(
272
Group_Control_Background::get_type(),
273
- [
274
- 'name' => 'premium_dual_header_first_clipped_background',
275
- 'types' => [ 'classic' , 'gradient' ],
276
- 'condition' => [
277
- 'premium_dual_header_first_back_clip' => 'clipped',
278
- ],
279
- 'selector' => '{{WRAPPER}} .premium-dual-header-first-span',
280
- ]
281
- );
282
283
/*First Border*/
284
$this->add_group_control(
285
Group_Control_Border::get_type(),
286
- [
287
- 'name' => 'first_header_border',
288
- 'selector' => '{{WRAPPER}} .premium-dual-header-first-span',
289
- ]
290
- );
291
292
/*First Border Radius*/
293
$this->add_control('premium_dual_header_first_border_radius',
294
- [
295
- 'label' => esc_html__('Border Radius', 'premium-addons-for-elementor'),
296
- 'type' => Controls_Manager::SLIDER,
297
- 'size_units' => ['px', '%', 'em'],
298
- 'selectors' => [
299
- '{{WRAPPER}} .premium-dual-header-first-span' => 'border-radius: {{SIZE}}{{UNIT}};'
300
- ]
301
- ]
302
- );
303
304
/*First Text Shadow*/
305
$this->add_group_control(
306
Group_Control_Text_Shadow::get_type(),
307
[
308
- 'label' => esc_html__('Shadow','premium-addons-for-elementor'),
309
- 'name' => 'premium_dual_header_first_text_shadow',
310
- 'selector' => '{{WRAPPER}} .premium-dual-header-first-span',
311
]
312
- );
313
314
/*First Margin*/
315
$this->add_responsive_control('premium_dual_header_first_margin',
316
- [
317
- 'label' => esc_html__('Margin', 'premium-addons-for-elementor'),
318
- 'type' => Controls_Manager::DIMENSIONS,
319
- 'size_units' => [ 'px', 'em', '%' ],
320
- 'selectors' => [
321
- '{{WRAPPER}} .premium-dual-header-first-span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
322
- ]
323
- ]
324
- );
325
326
/*First Padding*/
327
$this->add_responsive_control('premium_dual_header_first_padding',
328
- [
329
- 'label' => esc_html__('Padding', 'premium-addons-for-elementor'),
330
- 'type' => Controls_Manager::DIMENSIONS,
331
- 'size_units' => [ 'px', 'em', '%' ],
332
- 'selectors' => [
333
- '{{WRAPPER}} .premium-dual-header-first-span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
334
- ]
335
- ]
336
- );
337
338
/*End First Header Styling Section*/
339
$this->end_controls_section();
340
341
/*Start First Header Styling Section*/
342
$this->start_controls_section('premium_dual_header_second_style',
343
- [
344
- 'label' => esc_html__('Second Heading', 'premium-addons-for-elementor'),
345
- 'tab' => Controls_Manager::TAB_STYLE,
346
- ]
347
- );
348
349
/*Second Typography*/
350
$this->add_group_control(
351
Group_Control_Typography::get_type(),
352
- [
353
- 'name' => 'second_header_typography',
354
- 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
355
- 'selector' => '{{WRAPPER}} .premium-dual-header-second-header',
356
- ]
357
- );
358
359
$this->add_control('premium_dual_header_second_animated',
360
- [
361
- 'label' => esc_html__('Animated Background', 'premium-addons-for-elementor'),
362
- 'type' => Controls_Manager::SWITCHER,
363
- ]
364
- );
365
366
/*Second Coloring Style*/
367
$this->add_control('premium_dual_header_second_back_clip',
368
- [
369
- 'label' => esc_html__('Background Style', 'premium-addons-for-elementor'),
370
- 'type' => Controls_Manager::SELECT,
371
- 'default' => 'color',
372
- 'description' => esc_html__('Choose ‘Normal’ style to put a background behind the text. Choose ‘Clipped’ style so the background will be clipped on the text.','premium-addons-for-elementor'),
373
- 'options' => [
374
- 'color' => esc_html__('Normal Background', 'premium-addons-for-elementor'),
375
- 'clipped' => esc_html__('Clipped Background', 'premium-addons-for-elementor'),
376
- ],
377
- 'label_block' => true,
378
- ]
379
- );
380
381
/*Second Color*/
382
$this->add_control('premium_dual_header_second_color',
383
- [
384
- 'label' => esc_html__('Text Color', 'premium-addons-for-elementor'),
385
- 'type' => Controls_Manager::COLOR,
386
- 'scheme' => [
387
- 'type' => Scheme_Color::get_type(),
388
- 'value' => Scheme_Color::COLOR_2,
389
- ],
390
- 'condition' => [
391
- 'premium_dual_header_second_back_clip' => 'color',
392
- ],
393
- 'selectors' => [
394
- '{{WRAPPER}} .premium-dual-header-second-header' => 'color: {{VALUE}};',
395
- ]
396
- ]
397
- );
398
399
/*Second Background Color*/
400
$this->add_group_control(
401
Group_Control_Background::get_type(),
402
- [
403
- 'name' => 'premium_dual_header_second_background',
404
- 'types' => [ 'classic' , 'gradient' ],
405
- 'condition' => [
406
- 'premium_dual_header_second_back_clip' => 'color',
407
- ],
408
- 'selector' => '{{WRAPPER}} .premium-dual-header-second-header',
409
- ]
410
- );
411
412
/*Second Clip*/
413
$this->add_group_control(
414
Group_Control_Background::get_type(),
415
- [
416
- 'name' => 'premium_dual_header_second_clipped_background',
417
- 'types' => [ 'classic' , 'gradient' ],
418
- 'condition' => [
419
- 'premium_dual_header_second_back_clip' => 'clipped',
420
- ],
421
- 'selector' => '{{WRAPPER}} .premium-dual-header-second-header',
422
- ]
423
- );
424
425
/*Second Border*/
426
$this->add_group_control(
427
Group_Control_Border::get_type(),
428
- [
429
- 'name' => 'second_header_border',
430
- 'selector' => '{{WRAPPER}} .premium-dual-header-second-header',
431
- ]
432
- );
433
434
/*Second Border Radius*/
435
$this->add_control('premium_dual_header_second_border_radius',
436
- [
437
- 'label' => esc_html__('Border Radius', 'premium-addons-for-elementor'),
438
- 'type' => Controls_Manager::SLIDER,
439
- 'size_units' => ['px', '%', 'em'],
440
- 'selectors' => [
441
- '{{WRAPPER}} .premium-dual-header-second-header' => 'border-radius: {{SIZE}}{{UNIT}};'
442
- ]
443
]
444
- );
445
446
/*Second Text Shadow*/
447
$this->add_group_control(
448
Group_Control_Text_Shadow::get_type(),
449
[
450
- 'label' => esc_html__('Shadow','premium-addons-for-elementor'),
451
- 'name' => 'premium_dual_header_second_text_shadow',
452
- 'selector' => '{{WRAPPER}} .premium-dual-header-second-header',
453
]
454
- );
455
456
/*Second Margin*/
457
$this->add_responsive_control('premium_dual_header_second_margin',
458
- [
459
- 'label' => esc_html__('Margin', 'premium-addons-for-elementor'),
460
- 'type' => Controls_Manager::DIMENSIONS,
461
- 'size_units' => [ 'px', 'em', '%' ],
462
- 'selectors' => [
463
- '{{WRAPPER}} .premium-dual-header-second-header' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
464
- ]
465
- ]
466
- );
467
468
/*Second Padding*/
469
$this->add_responsive_control('premium_dual_header_second_padding',
470
- [
471
- 'label' => esc_html__('Padding', 'premium-addons-for-elementor'),
472
- 'type' => Controls_Manager::DIMENSIONS,
473
- 'size_units' => [ 'px', 'em', '%' ],
474
- 'selectors' => [
475
- '{{WRAPPER}} .premium-dual-header-second-header' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
476
- ]
477
- ]
478
- );
479
480
/*End Second Header Styling Section*/
481
$this->end_controls_section();
@@ -510,22 +497,26 @@ class Premium_Dual_Header extends Widget_Base {
510
511
$full_first_title_tag = '<' . $first_title_tag . ' class="premium-dual-header-first-header ' . $first_clip . $first_grad . '"><span class="premium-dual-header-first-span">'. $first_title_text . '</span><span class="premium-dual-header-second-header ' . $second_clip . $second_grad . '">'. $second_title_text . '</span></' . $settings['premium_dual_header_first_header_tag'] . '> ';
512
513
- if( $settings['premium_dual_header_link_switcher'] =='yes' && $settings['premium_dual_heading_link_selection'] == 'link' ) {
514
- $link = get_permalink($settings['premium_dual_heading_existing_link']);
515
- } elseif( $settings['premium_dual_header_link_switcher'] =='yes' && $settings['premium_dual_heading_link_selection'] == 'url' ){
516
$link = $settings['premium_dual_heading_link']['url'];
517
}
518
- ?>
519
520
- <div class="premium-dual-header-container">
521
- <?php if( $settings['premium_dual_header_link_switcher'] == 'yes' && ( !empty( $settings['premium_dual_heading_link']['url'] ) || !empty( $settings['premium_dual_heading_existing_link'] ) ) ) : ?>
522
- <a <?php if( !empty( $link ) ) : ?> href="<?php echo esc_attr( $link ); ?>" <?php endif; ?> <?php if(!empty($settings['premium_dual_heading_link']['is_external'])) : ?> target="_blank" <?php endif; ?><?php if(!empty($settings['premium_dual_heading_link']['nofollow'])) : ?> rel="nofollow" <?php endif; ?>>
523
<?php endif; ?>
524
- <div class="premium-dual-header-first-container"><?php echo $full_first_title_tag; ?></div>
525
- <?php if( $settings['premium_dual_header_link_switcher'] == 'yes' && ( !empty( $settings['premium_dual_heading_link']['url'] ) || !empty( $settings['premium_dual_heading_existing_link'] ) ) ) : ?>
526
- </a>
527
- <?php endif; ?>
528
- </div>
529
530
<?php
531
}
1
<?php
2
+
3
namespace Elementor;
4
5
if ( ! defined( 'ABSPATH' ) ) exit; // If this file is called directly, abort.
34
35
/*Start General Section*/
36
$this->start_controls_section('premium_dual_header_general_settings',
37
+ [
38
+ 'label' => esc_html__('Dual Heading', 'premium-addons-for-elementor')
39
+ ]
40
+ );
41
42
/*First Header*/
43
$this->add_control('premium_dual_header_first_header_text',
44
+ [
45
+ 'label' => esc_html__('First Heading', 'premium-addons-for-elementor'),
46
+ 'type' => Controls_Manager::TEXT,
47
+ 'dynamic' => [ 'active' => true ],
48
+ 'default' => esc_html__('Premium', 'premium-addons-for-elementor'),
49
+ 'label_block' => true,
50
+ ]
51
+ );
52
+
53
/*Second Header*/
54
$this->add_control('premium_dual_header_second_header_text',
55
+ [
56
+ 'label' => esc_html__('Second Heading', 'premium-addons-for-elementor'),
57
+ 'type' => Controls_Manager::TEXT,
58
+ 'dynamic' => [ 'active' => true ],
59
+ 'default' => esc_html__('Addons', 'premium-addons-for-elementor'),
60
+ 'label_block' => true,
61
+ ]
62
+ );
63
64
/*Title Tag*/
65
$this->add_control('premium_dual_header_first_header_tag',
66
+ [
67
+ 'label' => esc_html__('HTML Tag', 'premium-addons-for-elementor'),
68
+ 'type' => Controls_Manager::SELECT,
69
+ 'default' => 'h2',
70
+ 'options' => [
71
+ 'h1' => 'H1',
72
+ 'h2' => 'H2',
73
+ 'h3' => 'H3',
74
+ 'h4' => 'H4',
75
+ 'h5' => 'H5',
76
+ 'h6' => 'H6',
77
+ 'p' => 'p',
78
+ 'span' => 'span',
79
+ ],
80
+ 'label_block' => true,
81
+ ]
82
+ );
83
84
/*Text Align*/
85
$this->add_control('premium_dual_header_position',
86
+ [
87
+ 'label' => esc_html__( 'Display', 'premium-addons-for-elementor' ),
88
+ 'type' => Controls_Manager::SELECT,
89
+ 'options' => [
90
+ 'inline'=> esc_html__('Inline', 'premium-addons-for-elementor'),
91
+ 'block' => esc_html__('Block', 'premium-addons-for-elementor'),
92
+ ],
93
+ 'default' => 'inline',
94
+ 'selectors' => [
95
+ '{{WRAPPER}} .premium-dual-header-first-container span, {{WRAPPER}} .premium-dual-header-second-container' => 'display: {{VALUE}};',
96
+ ],
97
+ 'label_block' => true
98
+ ]
99
+ );
100
101
$this->add_control('premium_dual_header_link_switcher',
102
+ [
103
+ 'label' => esc_html__('Link', 'premium-addons-for-elementor'),
104
+ 'type' => Controls_Manager::SWITCHER,
105
+ 'description' => esc_html__('Enable or disable link','premium-addons-for-elementor'),
106
+ ]
107
+ );
108
109
$this->add_control('premium_dual_heading_link_selection',
110
+ [
111
+ 'label' => esc_html__('Link Type', 'premium-addons-for-elementor'),
112
+ 'type' => Controls_Manager::SELECT,
113
+ 'options' => [
114
+ 'url' => esc_html__('URL', 'premium-addons-for-elementor'),
115
+ 'link' => esc_html__('Existing Page', 'premium-addons-for-elementor'),
116
+ ],
117
+ 'default' => 'url',
118
+ 'label_block' => true,
119
+ 'condition' => [
120
+ 'premium_dual_header_link_switcher' => 'yes',
121
+ ]
122
+ ]
123
+ );
124
125
$this->add_control('premium_dual_heading_link',
126
+ [
127
+ 'label' => esc_html__('Link', 'premium-addons-for-elementor'),
128
+ 'type' => Controls_Manager::URL,
129
+ 'default' => [
130
+ 'url' => '#',
131
+ ],
132
+ 'placeholder' => 'https://premiumaddons.com/',
133
+ 'label_block' => true,
134
+ 'separator' => 'after',
135
+ 'condition' => [
136
+ 'premium_dual_header_link_switcher' => 'yes',
137
+ 'premium_dual_heading_link_selection' => 'url'
138
+ ]
139
+ ]
140
+ );
141
142
$this->add_control('premium_dual_heading_existing_link',
143
+ [
144
+ 'label' => esc_html__('Existing Page', 'premium-addons-for-elementor'),
145
+ 'type' => Controls_Manager::SELECT2,
146
+ 'options' => $this->getTemplateInstance()->get_all_post(),
147
+ 'condition' => [
148
+ 'premium_dual_header_link_switcher' => 'yes',
149
+ 'premium_dual_heading_link_selection' => 'link',
150
+ ],
151
+ 'multiple' => false,
152
+ 'separator' => 'after',
153
+ 'label_block' => true,
154
+ ]
155
+ );
156
157
/*Text Align*/
158
$this->add_responsive_control('premium_dual_header_text_align',
159
+ [
160
+ 'label' => esc_html__( 'Alignment', 'premium-addons-for-elementor' ),
161
+ 'type' => Controls_Manager::CHOOSE,
162
+ 'options' => [
163
+ 'left' => [
164
+ 'title'=> esc_html__( 'Left', 'premium-addons-for-elementor' ),
165
+ 'icon' => 'fa fa-align-left',
166
+ ],
167
+ 'center' => [
168
+ 'title'=> esc_html__( 'Center', 'premium-addons-for-elementor' ),
169
+ 'icon' => 'fa fa-align-center',
170
+ ],
171
+ 'right' => [
172
+ 'title'=> esc_html__( 'Right', 'premium-addons-for-elementor' ),
173
+ 'icon' => 'fa fa-align-right'
174
]
175
+ ],
176
+ 'default' => 'center',
177
+ 'selectors' => [
178
+ '{{WRAPPER}} .premium-dual-header-container' => 'text-align: {{VALUE}};'
179
+ ],
180
+ ]
181
+ );
182
+
183
/*End General Settings Section*/
184
$this->end_controls_section();
185
186
/*Start First Header Styling Section*/
187
$this->start_controls_section('premium_dual_header_first_style',
188
+ [
189
+ 'label' => esc_html__('First Heading', 'premium-addons-for-elementor'),
190
+ 'tab' => Controls_Manager::TAB_STYLE
191
+ ]
192
+ );
193
194
/*First Typography*/
195
$this->add_group_control(
196
Group_Control_Typography::get_type(),
197
+ [
198
+ 'name' => 'first_header_typography',
199
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
200
+ 'selector' => '{{WRAPPER}} .premium-dual-header-first-span'
201
+ ]
202
+ );
203
204
$this->add_control('premium_dual_header_first_animated',
205
+ [
206
+ 'label' => esc_html__('Animated Background', 'premium-addons-for-elementor'),
207
+ 'type' => Controls_Manager::SWITCHER
208
+ ]
209
+ );
210
+
211
/*First Coloring Style*/
212
$this->add_control('premium_dual_header_first_back_clip',
213
+ [
214
+ 'label' => esc_html__('Background Style', 'premium-addons-for-elementor'),
215
+ 'type' => Controls_Manager::SELECT,
216
+ 'default' => 'color',
217
+ 'description' => esc_html__('Choose ‘Normal’ style to put a background behind the text. Choose ‘Clipped’ style so the background will be clipped on the text.','premium-addons-for-elementor'),
218
+ 'options' => [
219
+ 'color' => esc_html__('Normal Background', 'premium-addons-for-elementor'),
220
+ 'clipped' => esc_html__('Clipped Background', 'premium-addons-for-elementor'),
221
+ ],
222
+ 'label_block' => true
223
+ ]
224
+ );
225
+
226
/*First Color*/
227
$this->add_control('premium_dual_header_first_color',
228
+ [
229
+ 'label' => esc_html__('Text Color', 'premium-addons-for-elementor'),
230
+ 'type' => Controls_Manager::COLOR,
231
+ 'scheme' => [
232
+ 'type' => Scheme_Color::get_type(),
233
+ 'value' => Scheme_Color::COLOR_1
234
+ ],
235
+ 'condition' => [
236
+ 'premium_dual_header_first_back_clip' => 'color'
237
+ ],
238
+ 'selectors' => [
239
+ '{{WRAPPER}} .premium-dual-header-first-span' => 'color: {{VALUE}};'
240
+ ]
241
+ ]
242
+ );
243
244
/*First Background Color*/
245
$this->add_group_control(
246
Group_Control_Background::get_type(),
247
+ [
248
+ 'name' => 'premium_dual_header_first_background',
249
+ 'types' => [ 'classic' , 'gradient' ],
250
+ 'condition' => [
251
+ 'premium_dual_header_first_back_clip' => 'color'
252
+ ],
253
+ 'selector' => '{{WRAPPER}} .premium-dual-header-first-span'
254
+ ]
255
+ );
256
257
/*First Clip*/
258
$this->add_group_control(
259
Group_Control_Background::get_type(),
260
+ [
261
+ 'name' => 'premium_dual_header_first_clipped_background',
262
+ 'types' => [ 'classic' , 'gradient' ],
263
+ 'condition' => [
264
+ 'premium_dual_header_first_back_clip' => 'clipped'
265
+ ],
266
+ 'selector' => '{{WRAPPER}} .premium-dual-header-first-span'
267
+ ]
268
+ );
269
270
/*First Border*/
271
$this->add_group_control(
272
Group_Control_Border::get_type(),
273
+ [
274
+ 'name' => 'first_header_border',
275
+ 'selector' => '{{WRAPPER}} .premium-dual-header-first-span'
276
+ ]
277
+ );
278
279
/*First Border Radius*/
280
$this->add_control('premium_dual_header_first_border_radius',
281
+ [
282
+ 'label' => esc_html__('Border Radius', 'premium-addons-for-elementor'),
283
+ 'type' => Controls_Manager::SLIDER,
284
+ 'size_units' => ['px', '%', 'em'],
285
+ 'selectors' => [
286
+ '{{WRAPPER}} .premium-dual-header-first-span' => 'border-radius: {{SIZE}}{{UNIT}};'
287
+ ]
288
+ ]
289
+ );
290
291
/*First Text Shadow*/
292
$this->add_group_control(
293
Group_Control_Text_Shadow::get_type(),
294
[
295
+ 'label' => esc_html__('Shadow','premium-addons-for-elementor'),
296
+ 'name' => 'premium_dual_header_first_text_shadow',
297
+ 'selector' => '{{WRAPPER}} .premium-dual-header-first-span'
298
]
299
+ );
300
301
/*First Margin*/
302
$this->add_responsive_control('premium_dual_header_first_margin',
303
+ [
304
+ 'label' => esc_html__('Margin', 'premium-addons-for-elementor'),
305
+ 'type' => Controls_Manager::DIMENSIONS,
306
+ 'size_units' => [ 'px', 'em', '%' ],
307
+ 'selectors' => [
308
+ '{{WRAPPER}} .premium-dual-header-first-span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}'
309
+ ]
310
+ ]
311
+ );
312
313
/*First Padding*/
314
$this->add_responsive_control('premium_dual_header_first_padding',
315
+ [
316
+ 'label' => esc_html__('Padding', 'premium-addons-for-elementor'),
317
+ 'type' => Controls_Manager::DIMENSIONS,
318
+ 'size_units' => [ 'px', 'em', '%' ],
319
+ 'selectors' => [
320
+ '{{WRAPPER}} .premium-dual-header-first-span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}'
321
+ ]
322
+ ]
323
+ );
324
325
/*End First Header Styling Section*/
326
$this->end_controls_section();
327
328
/*Start First Header Styling Section*/
329
$this->start_controls_section('premium_dual_header_second_style',
330
+ [
331
+ 'label' => esc_html__('Second Heading', 'premium-addons-for-elementor'),
332
+ 'tab' => Controls_Manager::TAB_STYLE
333
+ ]
334
+ );
335
336
/*Second Typography*/
337
$this->add_group_control(
338
Group_Control_Typography::get_type(),
339
+ [
340
+ 'name' => 'second_header_typography',
341
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
342
+ 'selector' => '{{WRAPPER}} .premium-dual-header-second-header'
343
+ ]
344
+ );
345
346
$this->add_control('premium_dual_header_second_animated',
347
+ [
348
+ 'label' => esc_html__('Animated Background', 'premium-addons-for-elementor'),
349
+ 'type' => Controls_Manager::SWITCHER
350
+ ]
351
+ );
352
353
/*Second Coloring Style*/
354
$this->add_control('premium_dual_header_second_back_clip',
355
+ [
356
+ 'label' => esc_html__('Background Style', 'premium-addons-for-elementor'),
357
+ 'type' => Controls_Manager::SELECT,
358
+ 'default' => 'color',
359
+ 'description' => esc_html__('Choose ‘Normal’ style to put a background behind the text. Choose ‘Clipped’ style so the background will be clipped on the text.','premium-addons-for-elementor'),
360
+ 'options' => [
361
+ 'color' => esc_html__('Normal Background', 'premium-addons-for-elementor'),
362
+ 'clipped' => esc_html__('Clipped Background', 'premium-addons-for-elementor')
363
+ ],
364
+ 'label_block' => true
365
+ ]
366
+ );
367
368
/*Second Color*/
369
$this->add_control('premium_dual_header_second_color',
370
+ [
371
+ 'label' => esc_html__('Text Color', 'premium-addons-for-elementor'),
372
+ 'type' => Controls_Manager::COLOR,
373
+ 'scheme' => [
374
+ 'type' => Scheme_Color::get_type(),
375
+ 'value' => Scheme_Color::COLOR_2
376
+ ],
377
+ 'condition' => [
378
+ 'premium_dual_header_second_back_clip' => 'color'
379
+ ],
380
+ 'selectors' => [
381
+ '{{WRAPPER}} .premium-dual-header-second-header' => 'color: {{VALUE}};'
382
+ ]
383
+ ]
384
+ );
385
386
/*Second Background Color*/
387
$this->add_group_control(
388
Group_Control_Background::get_type(),
389
+ [
390
+ 'name' => 'premium_dual_header_second_background',
391
+ 'types' => [ 'classic' , 'gradient' ],
392
+ 'condition' => [
393
+ 'premium_dual_header_second_back_clip' => 'color'
394
+ ],
395
+ 'selector' => '{{WRAPPER}} .premium-dual-header-second-header'
396
+ ]
397
+ );
398
399
/*Second Clip*/
400
$this->add_group_control(
401
Group_Control_Background::get_type(),
402
+ [
403
+ 'name' => 'premium_dual_header_second_clipped_background',
404
+ 'types' => [ 'classic' , 'gradient' ],
405
+ 'condition' => [
406
+ 'premium_dual_header_second_back_clip' => 'clipped'
407
+ ],
408
+ 'selector' => '{{WRAPPER}} .premium-dual-header-second-header'
409
+ ]
410
+ );
411
412
/*Second Border*/
413
$this->add_group_control(
414
Group_Control_Border::get_type(),
415
+ [
416
+ 'name' => 'second_header_border',
417
+ 'selector' => '{{WRAPPER}} .premium-dual-header-second-header'
418
+ ]
419
+ );
420
421
/*Second Border Radius*/
422
$this->add_control('premium_dual_header_second_border_radius',
423
+ [
424
+ 'label' => esc_html__('Border Radius', 'premium-addons-for-elementor'),
425
+ 'type' => Controls_Manager::SLIDER,
426
+ 'size_units' => ['px', '%', 'em'],
427
+ 'selectors' => [
428
+ '{{WRAPPER}} .premium-dual-header-second-header' => 'border-radius: {{SIZE}}{{UNIT}};'
429
]
430
+ ]
431
+ );
432
433
/*Second Text Shadow*/
434
$this->add_group_control(
435
Group_Control_Text_Shadow::get_type(),
436
[
437
+ 'label' => esc_html__('Shadow','premium-addons-for-elementor'),
438
+ 'name' => 'premium_dual_header_second_text_shadow',
439
+ 'selector' => '{{WRAPPER}} .premium-dual-header-second-header'
440
]
441
+ );
442
443
/*Second Margin*/
444
$this->add_responsive_control('premium_dual_header_second_margin',
445
+ [
446
+ 'label' => esc_html__('Margin', 'premium-addons-for-elementor'),
447
+ 'type' => Controls_Manager::DIMENSIONS,
448
+ 'size_units' => [ 'px', 'em', '%' ],
449
+ 'selectors' => [
450
+ '{{WRAPPER}} .premium-dual-header-second-header' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}'
451
+ ]
452
+ ]
453
+ );
454
455
/*Second Padding*/
456
$this->add_responsive_control('premium_dual_header_second_padding',
457
+ [
458
+ 'label' => esc_html__('Padding', 'premium-addons-for-elementor'),
459
+ 'type' => Controls_Manager::DIMENSIONS,
460
+ 'size_units' => [ 'px', 'em', '%' ],
461
+ 'selectors' => [
462
+ '{{WRAPPER}} .premium-dual-header-second-header' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
463
+ ]
464
+ ]
465
+ );
466
467
/*End Second Header Styling Section*/
468
$this->end_controls_section();
497
498
$full_first_title_tag = '<' . $first_title_tag . ' class="premium-dual-header-first-header ' . $first_clip . $first_grad . '"><span class="premium-dual-header-first-span">'. $first_title_text . '</span><span class="premium-dual-header-second-header ' . $second_clip . $second_grad . '">'. $second_title_text . '</span></' . $settings['premium_dual_header_first_header_tag'] . '> ';
499
500
+ $link = '';
501
+ if( $settings['premium_dual_header_link_switcher'] == 'yes' && $settings['premium_dual_heading_link_selection'] == 'link' ) {
502
+ $link = get_permalink( $settings['premium_dual_heading_existing_link'] );
503
+ } elseif( $settings['premium_dual_header_link_switcher'] == 'yes' && $settings['premium_dual_heading_link_selection'] == 'url' ) {
504
$link = $settings['premium_dual_heading_link']['url'];
505
}
506
+
507
+ ?>
508
509
+ <div class="premium-dual-header-container">
510
+ <?php if( ! empty ( $link ) ) : ?>
511
+ <a href="<?php echo esc_attr( $link ); ?>" <?php if( ! empty( $settings['premium_dual_heading_link']['is_external'] ) ) : ?> target="_blank" <?php endif; ?><?php if( ! empty( $settings['premium_dual_heading_link']['nofollow'] ) ) : ?> rel="nofollow" <?php endif; ?>>
512
+ <?php endif; ?>
513
+ <div class="premium-dual-header-first-container">
514
+ <?php echo $full_first_title_tag; ?>
515
+ </div>
516
+ <?php if( ! empty ( $link ) ) : ?>
517
+ </a>
518
<?php endif; ?>
519
+ </div>
520
521
<?php
522
}
widgets/premium-grid.php CHANGED
@@ -22,12 +22,18 @@ class Premium_Grid extends Widget_Base {
22
return 'pa-grid-icon';
23
}
24
25
public function get_script_depends(){
26
return [
27
'prettyPhoto-js',
28
'isotope-js',
29
'premium-addons-js'
30
- ];
31
}
32
33
public function is_reload_preview_required(){
22
return 'pa-grid-icon';
23
}
24
25
+ public function get_style_depends(){
26
+ return [
27
+ 'pa-prettyphoto',
28
+ ];
29
+ }
30
+
31
public function get_script_depends(){
32
return [
33
'prettyPhoto-js',
34
'isotope-js',
35
'premium-addons-js'
36
+ ];
37
}
38
39
public function is_reload_preview_required(){
widgets/premium-title.php CHANGED
@@ -1,4 +1,5 @@
1
<?php
2
namespace Elementor;
3
4
if ( ! defined( 'ABSPATH' ) ) exit; // If this file is called directly, abort.
@@ -26,276 +27,276 @@ class Premium_Title extends Widget_Base {
26
27
/* Start Title General Settings Section */
28
$this->start_controls_section('premium_title_content',
29
- [
30
- 'label' => esc_html__('Title', 'premium-addons-for-elementor'),
31
- ]
32
- );
33
34
/*Title Text*/
35
$this->add_control('premium_title_text',
36
- [
37
- 'label' => esc_html__('Title', 'premium-addons-for-elementor'),
38
- 'type' => Controls_Manager::TEXT,
39
- 'default' => esc_html__('Premium Title','premium-addons-for-elementor'),
40
- 'label_block' => true,
41
- 'dynamic' => [ 'active' => true ]
42
- ]
43
- );
44
45
/*Title Style*/
46
$this->add_control('premium_title_style',
47
- [
48
- 'label' => esc_html__('Style', 'premium-addons-for-elementor'),
49
- 'type' => Controls_Manager::SELECT,
50
- 'default' => 'style1',
51
- 'options' => [
52
- 'style1' => esc_html__('Style1'),
53
- 'style2' => esc_html__('Style2'),
54
- 'style3' => esc_html__('Style3'),
55
- 'style4' => esc_html__('Style4'),
56
- 'style5' => esc_html__('Style5'),
57
- 'style6' => esc_html__('Style6'),
58
- 'style7' => esc_html__('Style7'),
59
- ],
60
- 'label_block' => true,
61
- ]
62
- );
63
64
/*Icon Switcher*/
65
$this->add_control('premium_title_icon_switcher',
66
- [
67
- 'label' => esc_html__('Icon', 'premium-addons-for-elementor'),
68
- 'type' => Controls_Manager::SWITCHER,
69
- ]
70
- );
71
72
/*Icon*/
73
$this->add_control('premium_title_icon',
74
- [
75
- 'label' => esc_html__('Font Awesome Icon', 'premium-addons-for-elementor'),
76
- 'type' => Controls_Manager::ICON,
77
- 'label_block' => true,
78
- 'condition' => [
79
- 'premium_title_icon_switcher' => 'yes',
80
- ]
81
]
82
- );
83
84
/*Title HTML TAG*/
85
$this->add_control('premium_title_tag',
86
- [
87
- 'label' => esc_html__('HTML Tag', 'premium-addons-for-elementor'),
88
- 'type' => Controls_Manager::SELECT,
89
- 'default' => esc_html__('h2','premium-addons-for-elementor'),
90
- 'options' => [
91
- 'h1' => 'H1',
92
- 'h2' => 'H2',
93
- 'h3' => 'H3',
94
- 'h4' => 'H4',
95
- 'h5' => 'H5',
96
- 'h6' => 'H6',
97
- ],
98
- ]
99
- );
100
101
/*Title Align*/
102
$this->add_responsive_control('premium_title_align',
103
- [
104
- 'label' => esc_html__( 'Alignment', 'premium-addons-for-elementor' ),
105
- 'type' => Controls_Manager::CHOOSE,
106
- 'options' => [
107
- 'left' => [
108
- 'title'=> esc_html__( 'Left', 'premium-addons-for-elementor' ),
109
- 'icon' => 'fa fa-align-left',
110
- ],
111
- 'center' => [
112
- 'title'=> esc_html__( 'Center', 'premium-addons-for-elementor' ),
113
- 'icon' => 'fa fa-align-center',
114
- ],
115
- 'right' => [
116
- 'title'=> esc_html__( 'Right', 'premium-addons-for-elementor' ),
117
- 'icon' => 'fa fa-align-right',
118
- ],
119
],
120
- 'default' => 'left',
121
- 'selectors' => [
122
- '{{WRAPPER}} .premium-title-container' => 'text-align: {{VALUE}};',
123
],
124
- ]
125
- );
126
127
128
129
/*Style 8*/
130
/*Strip Width*/
131
$this->add_control('premium_title_style7_strip_width',
132
- [
133
- 'label' => esc_html__('Strip Width (PX)', 'premium-addons-for-elementor'),
134
- 'type' => Controls_Manager::SLIDER,
135
- 'size_units' => ['px', '%', 'em'],
136
- 'default' => [
137
- 'unit' => 'px',
138
- 'size' => '120',
139
- ],
140
- 'selectors' => [
141
- '{{WRAPPER}} .premium-title-style7-strip:before' => 'width: {{SIZE}}{{UNIT}};',
142
- ],
143
- 'label_block' => true,
144
- 'condition' => [
145
- 'premium_title_style' => 'style7',
146
- ],
147
]
148
- );
149
150
/*Strip Height*/
151
$this->add_control('premium_title_style7_strip_height',
152
- [
153
- 'label' => esc_html__('Strip Height (PX)', 'premium-addons-for-elementor'),
154
- 'type' => Controls_Manager::SLIDER,
155
- 'size_units' => ['px', 'em'],
156
- 'default' => [
157
- 'unit' => 'px',
158
- 'size' => '5',
159
- ],
160
- 'label_block' => true,
161
- 'selectors' => [
162
- '{{WRAPPER}} .premium-title-style7-strip,{{WRAPPER}} .premium-title-style7-strip:before ' => 'height: {{SIZE}}{{UNIT}};',
163
- ],
164
- 'condition' => [
165
- 'premium_title_style' => 'style7',
166
- ],
167
]
168
- );
169
170
/*Strip Top Spacing*/
171
$this->add_control('premium_title_style7_strip_top_spacing',
172
- [
173
- 'label' => esc_html__('Strip Top Spacing (PX)', 'premium-addons-for-elementor'),
174
- 'type' => Controls_Manager::SLIDER,
175
- 'size_units' => ['px', '%', 'em'],
176
- 'selectors' => [
177
- '{{WRAPPER}} .premium-title-style7-strip' => 'margin-top: {{SIZE}}{{UNIT}};',
178
- ],
179
- 'label_block' => true,
180
- 'condition' => [
181
- 'premium_title_style' => 'style7',
182
- ],
183
- ]
184
- );
185
186
/*Strip Bottom Spacing*/
187
$this->add_control('premium_title_style7_strip_bottom_spacing',
188
- [
189
- 'label' => esc_html__('Strip Bottom Spacing (PX)', 'premium-addons-for-elementor'),
190
- 'type' => Controls_Manager::SLIDER,
191
- 'size_units' => ['px', '%', 'em'],
192
- 'label_block' => true,
193
- 'selectors' => [
194
- '{{WRAPPER}} .premium-title-style7-strip' => 'margin-bottom: {{SIZE}}{{UNIT}};',
195
- ],
196
- 'condition' => [
197
- 'premium_title_style' => 'style7',
198
- ],
199
]
200
- );
201
202
/*Title Align*/
203
$this->add_responsive_control('premium_title_style7_strip_align',
204
- [
205
- 'label' => esc_html__( 'Align', 'premium-addons-for-elementor' ),
206
- 'type' => Controls_Manager::CHOOSE,
207
- 'options' => [
208
- 'left' => [
209
- 'title'=> esc_html__( 'Left', 'premium-addons-for-elementor' ),
210
- 'icon' => 'fa fa-align-left',
211
- ],
212
- 'none' => [
213
- 'title'=> esc_html__( 'Center', 'premium-addons-for-elementor' ),
214
- 'icon' => 'fa fa-align-center',
215
- ],
216
- 'right' => [
217
- 'title'=> esc_html__( 'Right', 'premium-addons-for-elementor' ),
218
- 'icon' => 'fa fa-align-right',
219
- ],
220
- ],
221
- 'default' => 'none',
222
- 'selectors' => [
223
- '{{WRAPPER}} .premium-title-style7-strip:before' => 'float: {{VALUE}};',
224
],
225
- 'condition' => [
226
- 'premium_title_style' => 'style7',
227
- ],
228
- ]
229
- );
230
231
/*End Title General Settings Section*/
232
$this->end_controls_section();
233
234
/*Start Styling Section*/
235
$this->start_controls_section('premium_title_style_section',
236
- [
237
- 'label' => esc_html__('Title', 'premium-addons-for-elementor'),
238
- 'tab' => Controls_Manager::TAB_STYLE,
239
- ]
240
- );
241
242
/*Title Color*/
243
$this->add_control('premium_title_color',
244
- [
245
- 'label' => esc_html__('Color', 'premium-addons-for-elementor'),
246
- 'type' => Controls_Manager::COLOR,
247
- 'scheme' => [
248
- 'type' => Scheme_Color::get_type(),
249
- 'value' => Scheme_Color::COLOR_1,
250
- ],
251
- 'selectors' => [
252
- '{{WRAPPER}} .premium-title-header' => 'color: {{VALUE}};',
253
- ],
254
- ]
255
- );
256
257
258
/*Title Typography*/
259
$this->add_group_control(
260
- Group_Control_Typography::get_type(),
261
- [
262
- 'name' => 'title_typography',
263
- 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
264
- 'selector' => '{{WRAPPER}} .premium-title-header',
265
- ]
266
- );
267
268
/*Style 1*/
269
/*Style 1 Border*/
270
$this->add_group_control(
271
Group_Control_Border::get_type(),
272
- [
273
- 'name' => 'style_one_border',
274
- 'selector' => '{{WRAPPER}} .premium-title-style1',
275
- 'condition' => [
276
- 'premium_title_style' => 'style1',
277
- ],
278
- ]
279
- );
280
281
/*Style 2*/
282
/*Background Color*/
283
$this->add_control('premium_title_style2_background_color',
284
- [
285
- 'label' => esc_html__('Background Color', 'premium-addons-for-elementor'),
286
- 'type' => Controls_Manager::COLOR,
287
- 'scheme' => [
288
- 'type' => Scheme_Color::get_type(),
289
- 'value' => Scheme_Color::COLOR_2,
290
- ],
291
- 'selectors' => [
292
- '{{WRAPPER}} .premium-title-style2' => 'background-color: {{VALUE}};',
293
- ],
294
- 'condition' => [
295
- 'premium_title_style' => 'style2',
296
- ],
297
- ]
298
- );
299
300
/*Style 2*/
301
@@ -303,245 +304,243 @@ class Premium_Title extends Widget_Base {
303
/*Style 3*/
304
/*Background Color*/
305
$this->add_control('premium_title_style3_background_color',
306
- [
307
- 'label' => esc_html__('Background Color', 'premium-addons-for-elementor'),
308
- 'type' => Controls_Manager::COLOR,
309
- 'scheme' => [
310
- 'type' => Scheme_Color::get_type(),
311
- 'value' => Scheme_Color::COLOR_2,
312
- ],
313
- 'selectors' => [
314
- '{{WRAPPER}} .premium-title-style3' => 'background-color: {{VALUE}};',
315
- ],
316
- 'condition' => [
317
- 'premium_title_style' => 'style3',
318
- ],
319
- ]