Addons for Elementor - Version 6.7.1

Version Description

  • Added Upgrade notice on the addons
Download this release

Release Info

Developer livemesh
Plugin Icon 128x128 Addons for Elementor
Version 6.7.1
Comparing to
See all releases

Code changes from version 6.7 to 6.7.1

addons-for-elementor.php CHANGED
@@ -8,7 +8,7 @@
8
  * Author URI: https://livemeshelementor.com
9
  * License: GPL3
10
  * License URI: https://www.gnu.org/licenses/gpl-3.0.txt
11
- * Version: 6.7
12
  * Text Domain: livemesh-el-addons
13
  * Domain Path: languages
14
  * Elementor tested up to: 3.1.0
@@ -37,7 +37,7 @@ if ( !defined( 'ABSPATH' ) ) {
37
 
38
  if ( !function_exists( 'lae_fs' ) ) {
39
  // Plugin version
40
- define( 'LAE_VERSION', '6.7' );
41
  // Plugin Root File
42
  define( 'LAE_PLUGIN_FILE', __FILE__ );
43
  // Plugin Folder Path
8
  * Author URI: https://livemeshelementor.com
9
  * License: GPL3
10
  * License URI: https://www.gnu.org/licenses/gpl-3.0.txt
11
+ * Version: 6.7.1
12
  * Text Domain: livemesh-el-addons
13
  * Domain Path: languages
14
  * Elementor tested up to: 3.1.0
37
 
38
  if ( !function_exists( 'lae_fs' ) ) {
39
  // Plugin version
40
+ define( 'LAE_VERSION', '6.7.1' );
41
  // Plugin Root File
42
  define( 'LAE_PLUGIN_FILE', __FILE__ );
43
  // Plugin Folder Path
assets/css/widgets/testimonials.css CHANGED
@@ -9,7 +9,7 @@
9
  border-radius: 30px;
10
  text-align: center;
11
  position: relative;
12
- padding: 20px;
13
  margin-bottom: 40px;
14
  font-style: italic;
15
  font-size: 15px;
9
  border-radius: 30px;
10
  text-align: center;
11
  position: relative;
12
+ padding: 20px 20px 10px;
13
  margin-bottom: 40px;
14
  font-style: italic;
15
  font-size: 15px;
assets/css/widgets/testimonials.css.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["testimonials.scss","../_lae-lib.scss"],"names":[],"mappings":"AAGA,mGAAmG;AAGnG;EACE,YAAW,EAAA;EAEX;IACE,oBAAmB,EAAA;EAGrB;IACE,oBAAmB;IACnB,0BAAyB;IACzB,oBAAmB;IACnB,mBAAkB;IAClB,mBAAkB;IAClB,cAAa;IACb,oBAAmB;IACnB,mBAAkB;IAClB,gBAAe;IACf,kBAAiB;IACjB,YAAW;IAqCX,mBAAkB;IAClB,iBAAgB,EAAA;IApChB;MACE,YAAW;MACX,iBAAgB,EAAA;IAGlB;MACE,YAAW;MACX,eAAc;MACd,iBAAgB;MAChB,+BAA8B;MAC9B,iCAAgC;MAChC,oBAAmB;MACnB,yBAAwB;MAGxB,iCAAgC;MAEhC,8BAA6B;MAC7B,YAAW;MACX,aAAY;MACZ,mBAAkB;MAClB,cAAa;MACb,WAAU;MACV,aAAY,EAAA;MAEZ;QACE,WAAU;QACV,YAAW,EAAA;MAGb;QACE,iBAAgB,EAAA;EAQtB;IACE,eAAc,EAAA;IAEd;MACE,oBAAmB,EAAA;MAEnB;QACE,gBAAe;QACf,mBAAkB;QAClB,mBAAkB,EAAA;QAElB;UACE,mBAAkB,EAAA;IAKxB;MACE,oBAAmB;MACnB,uBAAsB;MACtB,YAAW,EAAA;MAEX;QACE,eAAc,EAAA;MAGhB;QC4CJ,gBAAe;QACf,kBAAiB;QACjB,oBAAmB;QACnB,kBAAiB;QACjB,YAAW;QACX,0BAAyB;QACzB,YAAW;QACX,cAAa;QACb,oBAAmB;QDlDb,gBAAe;QACf,kBAAiB;QACjB,mBAAkB;QAClB,YAAW,EAAA;QAEX;UACE,eAAc,EAAA","file":"testimonials.css"}
1
+ {"version":3,"sources":["testimonials.scss","../_lae-lib.scss"],"names":[],"mappings":"AAGA,mGAAmG;AAGnG;EACE,YAAW,EAAA;EAEX;IACE,oBAAmB,EAAA;EAGrB;IACE,oBAAmB;IACnB,0BAAyB;IACzB,oBAAmB;IACnB,mBAAkB;IAClB,mBAAkB;IAClB,wBAAuB;IACvB,oBAAmB;IACnB,mBAAkB;IAClB,gBAAe;IACf,kBAAiB;IACjB,YAAW;IAqCX,mBAAkB;IAClB,iBAAgB,EAAA;IApChB;MACE,YAAW;MACX,iBAAgB,EAAA;IAGlB;MACE,YAAW;MACX,eAAc;MACd,iBAAgB;MAChB,+BAA8B;MAC9B,iCAAgC;MAChC,oBAAmB;MACnB,yBAAwB;MAGxB,iCAAgC;MAEhC,8BAA6B;MAC7B,YAAW;MACX,aAAY;MACZ,mBAAkB;MAClB,cAAa;MACb,WAAU;MACV,aAAY,EAAA;MAEZ;QACE,WAAU;QACV,YAAW,EAAA;MAGb;QACE,iBAAgB,EAAA;EAQtB;IACE,eAAc,EAAA;IAEd;MACE,oBAAmB,EAAA;MAEnB;QACE,gBAAe;QACf,mBAAkB;QAClB,mBAAkB,EAAA;QAElB;UACE,mBAAkB,EAAA;IAKxB;MACE,oBAAmB;MACnB,uBAAsB;MACtB,YAAW,EAAA;MAEX;QACE,eAAc,EAAA;MAGhB;QC4CJ,gBAAe;QACf,kBAAiB;QACjB,oBAAmB;QACnB,kBAAiB;QACjB,YAAW;QACX,0BAAyB;QACzB,YAAW;QACX,cAAa;QACb,oBAAmB;QDlDb,gBAAe;QACf,kBAAiB;QACjB,mBAAkB;QAClB,YAAW,EAAA;QAEX;UACE,eAAc,EAAA","file":"testimonials.css"}
assets/css/widgets/testimonials.scss CHANGED
@@ -17,7 +17,7 @@
17
  border-radius: 30px;
18
  text-align: center;
19
  position: relative;
20
- padding: 20px;
21
  margin-bottom: 40px;
22
  font-style: italic;
23
  font-size: 15px;
17
  border-radius: 30px;
18
  text-align: center;
19
  position: relative;
20
+ padding: 20px 20px 10px;
21
  margin-bottom: 40px;
22
  font-style: italic;
23
  font-size: 15px;
includes/widgets/carousel.php CHANGED
@@ -6,43 +6,47 @@ Description: Display a list of custom HTML content as a carousel.
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
9
-
10
  namespace LivemeshAddons\Widgets;
11
 
12
- use Elementor\Repeater;
13
- use Elementor\Widget_Base;
14
- use Elementor\Controls_Manager;
15
- use Elementor\Scheme_Color;
16
- use Elementor\Group_Control_Typography;
17
- use Elementor\Scheme_Typography;
18
-
19
- if (!defined('ABSPATH'))
20
- exit; // Exit if accessed directly
21
-
22
-
23
- class LAE_Carousel_Widget extends LAE_Widget_Base {
24
-
25
- public function get_name() {
26
  return 'lae-carousel';
27
  }
28
-
29
- public function get_title() {
30
- return __('Carousel', 'livemesh-el-addons');
 
31
  }
32
-
33
- public function get_icon() {
 
34
  return 'lae-icon-carousel';
35
  }
36
-
37
- public function get_categories() {
38
- return array('livemesh-addons');
 
39
  }
40
-
41
- public function get_custom_help_url() {
 
42
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/carousel-addon/';
43
  }
44
-
45
- public function get_script_depends() {
 
46
  return [
47
  'lae-jquery-slick',
48
  'lae-frontend-scripts',
@@ -50,8 +54,9 @@ class LAE_Carousel_Widget extends LAE_Widget_Base {
50
  'lae-carousel-scripts'
51
  ];
52
  }
53
-
54
- public function get_style_depends() {
 
55
  return [
56
  'lae-icomoon-styles',
57
  'lae-slick-carousel-styles',
@@ -60,407 +65,275 @@ class LAE_Carousel_Widget extends LAE_Widget_Base {
60
  'lae-carousel-styles'
61
  ];
62
  }
63
-
64
- protected function _register_controls() {
65
-
66
- $this->start_controls_section(
67
- 'section_carousel',
68
- [
69
- 'label' => __('Carousel', 'livemesh-el-addons'),
70
- ]
71
- );
72
-
73
-
74
- $this->add_control(
75
- 'carousel_heading',
76
- [
77
- 'label' => __('HTML Elements', 'livemesh-el-addons'),
78
- 'type' => Controls_Manager::HEADING,
79
- ]
80
- );
81
-
82
  $repeater = new Repeater();
83
-
84
- $repeater->add_control(
85
- 'element_title',
86
- [
87
-
88
- 'type' => Controls_Manager::TEXT,
89
- 'label_block' => true,
90
- 'label' => __('Element Title & HTML Content', 'livemesh-el-addons'),
91
- 'default' => __('My element title', 'livemesh-el-addons'),
92
- 'description' => __('The title to identify the HTML element', 'livemesh-el-addons'),
93
- ]
94
- );
95
-
96
- $repeater->add_control(
97
- 'element_content',
98
- [
99
-
100
- 'label' => __('HTML Element Content', 'livemesh-el-addons'),
101
- 'type' => Controls_Manager::WYSIWYG,
102
- 'default' => __('The HTML content for the element', 'livemesh-el-addons'),
103
- 'show_label' => false,
104
- 'dynamic' => [
105
- 'active' => true,
106
- ],
107
- ]
108
- );
109
-
110
-
111
- $this->add_control(
112
- 'elements',
113
  [
114
- 'type' => Controls_Manager::REPEATER,
115
- 'default' => [
116
- [
117
- 'element_title' => 'Aliquam lorem ante',
118
- 'element_content' => 'Suspendisse potenti. Praesent ac sem eget est egestas volutpat. Fusce neque. In hac habitasse platea dictumst. Morbi nec metus.
119
 
120
  Sed magna purus, fermentum eu, tincidunt eu, varius ut, felis. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi. Vestibulum volutpat pretium libero. Nullam accumsan lorem in dui. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
121
 
122
  In consectetuer turpis ut velit. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi. Vivamus laoreet. Praesent ac massa at ligula laoreet iaculis. Cras non dolor.',
123
- ],
124
- [
125
- 'element_title' => 'Pellentesque commodo eros',
126
- 'element_content' => 'In hac habitasse platea dictumst. Ut a nisl id ante tempus hendrerit. Morbi mattis ullamcorper velit. Nullam sagittis. Sed a libero.
127
 
128
  Donec mollis hendrerit risus. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent egestas neque eu enim. Donec mollis hendrerit risus.
129
 
130
  Donec orci lectus, aliquam ut, faucibus non, euismod id, nulla. Aenean imperdiet. Nulla consequat massa quis enim. Aenean imperdiet. Fusce commodo aliquam arcu.',
131
- ],
132
- [
133
- 'element_title' => 'Aenean commodo ligula',
134
- 'element_content' => 'Fusce convallis metus id felis luctus adipiscing. Suspendisse faucibus, nunc et pellentesque egestas, lacus ante convallis tellus, vitae iaculis lacus elit id tortor. Sed lectus. Etiam vitae tortor. Praesent adipiscing.
135
 
136
  Sed in libero ut nibh placerat accumsan. Pellentesque ut neque. Donec id justo. Phasellus gravida semper nisi. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.
137
 
138
  Vestibulum dapibus nunc ac augue. Nam at tortor in tellus interdum sagittis. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Sed lectus. Quisque ut nisi.',
139
- ],
140
- [
141
- 'element_title' => 'Suspendisse pulvinar augue',
142
- 'element_content' => 'Sed aliquam ultrices mauris. Sed mollis, eros et ultrices tempus, mauris ipsum aliquam libero, non adipiscing dolor urna a orci. Etiam feugiat lorem non metus. In turpis. Morbi mattis ullamcorper velit.
143
 
144
  Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Maecenas nec odio et ante tincidunt tempus. Ut leo. Praesent vestibulum dapibus nibh. Sed aliquam ultrices mauris.
145
 
146
  Nunc interdum lacus sit amet orci. Nunc interdum lacus sit amet orci. Vestibulum facilisis, purus nec pulvinar iaculis, ligula mi congue nunc, vitae euismod ligula urna in dolor. Curabitur at lacus ac velit ornare lobortis. Fusce vulputate eleifend sapien.',
147
- ],
148
- [
149
- 'element_title' => 'Aenean tellus metus',
150
- 'element_content' => 'Vivamus elementum semper nisi. Praesent adipiscing. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Fusce vel dui.
151
 
152
  Sed fringilla mauris sit amet nibh. Nunc nonummy metus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Phasellus blandit leo ut odio. Praesent egestas neque eu enim.
153
 
154
  Fusce risus nisl, viverra et, tempor et, pretium in, sapien. Vestibulum turpis sem, aliquet eget, lobortis pellentesque, rutrum eu, nisl. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Sed fringilla mauris sit amet nibh. Pellentesque ut neque.',
155
- ],
156
- ],
157
- 'fields' => $repeater->get_controls(),
158
- 'title_field' => '{{{ element_title }}}',
159
- ]
160
- );
161
-
 
 
 
162
  $this->end_controls_section();
163
-
164
- $this->start_controls_section(
165
- 'section_settings',
166
- [
167
- 'label' => __('Carousel Settings', 'livemesh-el-addons'),
168
- 'tab' => Controls_Manager::TAB_SETTINGS,
169
- ]
170
- );
171
-
172
-
173
- $this->add_responsive_control(
174
- 'gutter',
175
- [
176
- 'label' => __('Spacing between items', 'livemesh-el-addons'),
177
- 'type' => Controls_Manager::SLIDER,
178
- 'size_units' => ['px'],
179
- 'default' => [
180
- 'size' => 10,
181
- ],
182
- 'range' => [
183
- 'px' => [
184
- 'min' => 0,
185
- 'max' => 50,
186
- ],
187
- ],
188
- 'selectors' => [
189
- '{{WRAPPER}} .lae-carousel .slick-slide' => 'margin: 0 {{SIZE}}{{UNIT}};',
190
- '{{WRAPPER}} .lae-carousel .slick-list' => 'margin: 0 -{{SIZE}}{{UNIT}};',
191
- ],
192
- ]
193
- );
194
-
195
- $this->add_control(
196
- 'arrows',
197
- [
198
- 'type' => Controls_Manager::SWITCHER,
199
- 'label_off' => __('No', 'livemesh-el-addons'),
200
- 'label_on' => __('Yes', 'livemesh-el-addons'),
201
- 'return_value' => 'yes',
202
- 'default' => 'yes',
203
- 'label' => __('Prev/Next Arrows?', 'livemesh-el-addons'),
204
- ]
205
- );
206
-
207
-
208
- $this->add_control(
209
- 'dots',
210
- [
211
- 'type' => Controls_Manager::SWITCHER,
212
- 'label_off' => __('No', 'livemesh-el-addons'),
213
- 'label_on' => __('Yes', 'livemesh-el-addons'),
214
- 'return_value' => 'yes',
215
- 'separator' => 'before',
216
- 'default' => 'no',
217
- 'label' => __('Show dot indicators for navigation?', 'livemesh-el-addons'),
218
- ]
219
- );
220
-
221
- $this->add_control(
222
- 'pause_on_hover',
223
- [
224
- 'type' => Controls_Manager::SWITCHER,
225
- 'label_off' => __('No', 'livemesh-el-addons'),
226
- 'label_on' => __('Yes', 'livemesh-el-addons'),
227
- 'return_value' => 'yes',
228
- 'default' => 'yes',
229
- 'label' => __('Pause on Hover?', 'livemesh-el-addons'),
230
- ]
231
- );
232
-
233
- $this->add_control(
234
- 'autoplay',
235
- [
236
- 'type' => Controls_Manager::SWITCHER,
237
- 'label_off' => __('No', 'livemesh-el-addons'),
238
- 'label_on' => __('Yes', 'livemesh-el-addons'),
239
- 'return_value' => 'yes',
240
- 'separator' => 'before',
241
- 'default' => 'no',
242
- 'label' => __('Autoplay?', 'livemesh-el-addons'),
243
- 'description' => __('Should the carousel autoplay as in a slideshow.', 'livemesh-el-addons'),
244
- ]
245
- );
246
-
247
- $this->add_control(
248
- 'autoplay_speed',
249
- [
250
- 'label' => __('Autoplay speed in ms', 'livemesh-el-addons'),
251
- 'type' => Controls_Manager::NUMBER,
252
- 'default' => 3000,
253
- ]
254
- );
255
-
256
-
257
- $this->add_control(
258
- 'animation_speed',
259
- [
260
- 'label' => __('Autoplay animation speed in ms', 'livemesh-el-addons'),
261
- 'type' => Controls_Manager::NUMBER,
262
- 'default' => 300,
263
- ]
264
- );
265
-
266
  $this->end_controls_section();
267
-
268
- $this->start_controls_section(
269
- 'section_responsive',
270
- [
271
- 'label' => __('Responsive Options', 'livemesh-el-addons'),
272
- 'tab' => Controls_Manager::TAB_SETTINGS,
273
- ]
274
- );
275
-
276
- $this->add_control(
277
- 'heading_desktop',
278
- [
279
- 'label' => __('Desktop', 'livemesh-el-addons'),
280
- 'type' => Controls_Manager::HEADING,
281
- 'separator' => 'after',
282
- ]
283
- );
284
-
285
-
286
- $this->add_control(
287
- 'display_columns',
288
- [
289
- 'label' => __('Columns per row', 'livemesh-el-addons'),
290
- 'type' => Controls_Manager::NUMBER,
291
- 'min' => 1,
292
- 'max' => 25,
293
- 'step' => 1,
294
- 'default' => 3,
295
- ]
296
- );
297
-
298
-
299
- $this->add_control(
300
- 'scroll_columns',
301
- [
302
- 'label' => __('Columns to scroll', 'livemesh-el-addons'),
303
- 'type' => Controls_Manager::NUMBER,
304
- 'min' => 1,
305
- 'max' => 25,
306
- 'step' => 1,
307
- 'default' => 3,
308
- ]
309
- );
310
-
311
- $this->add_control(
312
- 'heading_tablet',
313
- [
314
- 'label' => __('Tablet', 'livemesh-el-addons'),
315
- 'type' => Controls_Manager::HEADING,
316
- 'separator' => 'after',
317
- ]
318
- );
319
-
320
- $this->add_control(
321
- 'tablet_display_columns',
322
- [
323
- 'label' => __('Columns per row', 'livemesh-el-addons'),
324
- 'type' => Controls_Manager::NUMBER,
325
- 'min' => 1,
326
- 'max' => 20,
327
- 'step' => 1,
328
- 'default' => 2,
329
- ]
330
- );
331
-
332
- $this->add_control(
333
- 'tablet_scroll_columns',
334
- [
335
- 'label' => __('Columns to scroll', 'livemesh-el-addons'),
336
- 'type' => Controls_Manager::NUMBER,
337
- 'min' => 1,
338
- 'max' => 20,
339
- 'step' => 1,
340
- 'default' => 2,
341
- ]
342
- );
343
-
344
- $this->add_control(
345
- 'tablet_width',
346
- [
347
- 'label' => __('Tablet Resolution', 'livemesh-el-addons'),
348
- 'description' => __('The resolution to treat as a tablet resolution.', 'livemesh-el-addons'),
349
- 'type' => Controls_Manager::NUMBER,
350
- 'default' => 800,
351
- ]
352
- );
353
-
354
-
355
- $this->add_control(
356
- 'heading_mobile',
357
- [
358
- 'label' => __('Mobile Phone', 'livemesh-el-addons'),
359
- 'type' => Controls_Manager::HEADING,
360
- 'separator' => 'after',
361
- ]
362
- );
363
-
364
- $this->add_control(
365
- 'mobile_display_columns',
366
- [
367
- 'label' => __('Columns per row', 'livemesh-el-addons'),
368
- 'type' => Controls_Manager::NUMBER,
369
- 'min' => 1,
370
- 'max' => 10,
371
- 'step' => 1,
372
- 'default' => 1,
373
- ]
374
- );
375
-
376
- $this->add_control(
377
- 'mobile_scroll_columns',
378
- [
379
- 'label' => __('Columns to scroll', 'livemesh-el-addons'),
380
- 'type' => Controls_Manager::NUMBER,
381
- 'min' => 1,
382
- 'max' => 10,
383
- 'step' => 1,
384
- 'default' => 1,
385
- ]
386
- );
387
-
388
- $this->add_control(
389
- 'mobile_width',
390
- [
391
- 'label' => __('Mobile Resolution', 'livemesh-el-addons'),
392
- 'description' => __('The resolution to treat as a mobile resolution.', 'livemesh-el-addons'),
393
- 'type' => Controls_Manager::NUMBER,
394
- 'default' => 480,
395
- ]
396
- );
397
-
398
-
399
  $this->end_controls_section();
400
-
401
- $this->start_controls_section(
402
- 'section_carousel_style',
403
- [
404
- 'label' => __('Carousel', 'livemesh-el-addons'),
405
- 'tab' => Controls_Manager::TAB_STYLE,
406
- 'show_label' => false,
407
- ]
408
- );
409
-
410
- $this->add_control(
411
- 'heading_content',
412
- [
413
- 'label' => __('Content', 'livemesh-el-addons'),
414
- 'type' => Controls_Manager::HEADING,
415
- 'separator' => 'after',
416
- ]
417
- );
418
-
419
- $this->add_control(
420
- 'content_color',
421
- [
422
- 'label' => __('Color', 'livemesh-el-addons'),
423
- 'type' => Controls_Manager::COLOR,
424
- 'selectors' => [
425
- '{{WRAPPER}} .lae-carousel .lae-carousel-item' => 'color: {{VALUE}};',
426
- ],
427
- ]
428
- );
429
-
430
- $this->add_control(
431
- 'content_bg_color',
432
- [
433
- 'label' => __('Background Color', 'livemesh-el-addons'),
434
- 'type' => Controls_Manager::COLOR,
435
- 'selectors' => [
436
- '{{WRAPPER}} .lae-carousel .lae-carousel-item' => 'background-color: {{VALUE}};',
437
- ],
438
- ]
439
- );
440
-
441
- $this->add_group_control(
442
- Group_Control_Typography::get_type(),
443
- [
444
- 'name' => 'content_typography',
445
- 'selector' => '{{WRAPPER}} .lae-carousel .lae-carousel-item',
446
- ]
447
- );
448
  }
449
-
450
- protected function render() {
451
-
452
  $settings = $this->get_settings_for_display();
453
-
454
- $settings = apply_filters('lae_carousel_' . $this->get_id() . '_settings', $settings);
455
-
456
  $args['settings'] = $settings;
457
-
458
  $args['widget_instance'] = $this;
459
-
460
- lae_get_template_part('addons/carousel/loop', $args);
461
  }
462
-
463
- protected function content_template() {
 
464
  }
465
 
466
  }
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
 
9
  namespace LivemeshAddons\Widgets;
10
 
11
+ use Elementor\Repeater ;
12
+ use Elementor\Widget_Base ;
13
+ use Elementor\Controls_Manager ;
14
+ use Elementor\Scheme_Color ;
15
+ use Elementor\Group_Control_Typography ;
16
+ use Elementor\Scheme_Typography ;
17
+ if ( !defined( 'ABSPATH' ) ) {
18
+ exit;
19
+ }
20
+ // Exit if accessed directly
21
+ class LAE_Carousel_Widget extends LAE_Widget_Base
22
+ {
23
+ public function get_name()
24
+ {
25
  return 'lae-carousel';
26
  }
27
+
28
+ public function get_title()
29
+ {
30
+ return __( 'Carousel', 'livemesh-el-addons' );
31
  }
32
+
33
+ public function get_icon()
34
+ {
35
  return 'lae-icon-carousel';
36
  }
37
+
38
+ public function get_categories()
39
+ {
40
+ return array( 'livemesh-addons' );
41
  }
42
+
43
+ public function get_custom_help_url()
44
+ {
45
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/carousel-addon/';
46
  }
47
+
48
+ public function get_script_depends()
49
+ {
50
  return [
51
  'lae-jquery-slick',
52
  'lae-frontend-scripts',
54
  'lae-carousel-scripts'
55
  ];
56
  }
57
+
58
+ public function get_style_depends()
59
+ {
60
  return [
61
  'lae-icomoon-styles',
62
  'lae-slick-carousel-styles',
65
  'lae-carousel-styles'
66
  ];
67
  }
68
+
69
+ protected function _register_controls()
70
+ {
71
+ $this->start_controls_section( 'section_carousel', [
72
+ 'label' => __( 'Carousel', 'livemesh-el-addons' ),
73
+ ] );
74
+ $this->add_control( 'carousel_heading', [
75
+ 'label' => __( 'HTML Elements', 'livemesh-el-addons' ),
76
+ 'type' => Controls_Manager::HEADING,
77
+ ] );
 
 
 
 
 
 
 
 
 
78
  $repeater = new Repeater();
79
+ $repeater->add_control( 'element_title', [
80
+ 'type' => Controls_Manager::TEXT,
81
+ 'label_block' => true,
82
+ 'label' => __( 'Element Title & HTML Content', 'livemesh-el-addons' ),
83
+ 'default' => __( 'My element title', 'livemesh-el-addons' ),
84
+ 'description' => __( 'The title to identify the HTML element', 'livemesh-el-addons' ),
85
+ ] );
86
+ $repeater->add_control( 'element_content', [
87
+ 'label' => __( 'HTML Element Content', 'livemesh-el-addons' ),
88
+ 'type' => Controls_Manager::WYSIWYG,
89
+ 'default' => __( 'The HTML content for the element', 'livemesh-el-addons' ),
90
+ 'show_label' => false,
91
+ 'dynamic' => [
92
+ 'active' => true,
93
+ ],
94
+ ] );
95
+ $this->add_control( 'elements', [
96
+ 'type' => Controls_Manager::REPEATER,
97
+ 'default' => [
 
 
 
 
 
 
 
 
 
 
 
98
  [
99
+ 'element_title' => 'Aliquam lorem ante',
100
+ 'element_content' => 'Suspendisse potenti. Praesent ac sem eget est egestas volutpat. Fusce neque. In hac habitasse platea dictumst. Morbi nec metus.
 
 
 
101
 
102
  Sed magna purus, fermentum eu, tincidunt eu, varius ut, felis. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi. Vestibulum volutpat pretium libero. Nullam accumsan lorem in dui. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
103
 
104
  In consectetuer turpis ut velit. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi. Vivamus laoreet. Praesent ac massa at ligula laoreet iaculis. Cras non dolor.',
105
+ ],
106
+ [
107
+ 'element_title' => 'Pellentesque commodo eros',
108
+ 'element_content' => 'In hac habitasse platea dictumst. Ut a nisl id ante tempus hendrerit. Morbi mattis ullamcorper velit. Nullam sagittis. Sed a libero.
109
 
110
  Donec mollis hendrerit risus. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent egestas neque eu enim. Donec mollis hendrerit risus.
111
 
112
  Donec orci lectus, aliquam ut, faucibus non, euismod id, nulla. Aenean imperdiet. Nulla consequat massa quis enim. Aenean imperdiet. Fusce commodo aliquam arcu.',
113
+ ],
114
+ [
115
+ 'element_title' => 'Aenean commodo ligula',
116
+ 'element_content' => 'Fusce convallis metus id felis luctus adipiscing. Suspendisse faucibus, nunc et pellentesque egestas, lacus ante convallis tellus, vitae iaculis lacus elit id tortor. Sed lectus. Etiam vitae tortor. Praesent adipiscing.
117
 
118
  Sed in libero ut nibh placerat accumsan. Pellentesque ut neque. Donec id justo. Phasellus gravida semper nisi. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.
119
 
120
  Vestibulum dapibus nunc ac augue. Nam at tortor in tellus interdum sagittis. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Sed lectus. Quisque ut nisi.',
121
+ ],
122
+ [
123
+ 'element_title' => 'Suspendisse pulvinar augue',
124
+ 'element_content' => 'Sed aliquam ultrices mauris. Sed mollis, eros et ultrices tempus, mauris ipsum aliquam libero, non adipiscing dolor urna a orci. Etiam feugiat lorem non metus. In turpis. Morbi mattis ullamcorper velit.
125
 
126
  Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Maecenas nec odio et ante tincidunt tempus. Ut leo. Praesent vestibulum dapibus nibh. Sed aliquam ultrices mauris.
127
 
128
  Nunc interdum lacus sit amet orci. Nunc interdum lacus sit amet orci. Vestibulum facilisis, purus nec pulvinar iaculis, ligula mi congue nunc, vitae euismod ligula urna in dolor. Curabitur at lacus ac velit ornare lobortis. Fusce vulputate eleifend sapien.',
129
+ ],
130
+ [
131
+ 'element_title' => 'Aenean tellus metus',
132
+ 'element_content' => 'Vivamus elementum semper nisi. Praesent adipiscing. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Fusce vel dui.
133
 
134
  Sed fringilla mauris sit amet nibh. Nunc nonummy metus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Phasellus blandit leo ut odio. Praesent egestas neque eu enim.
135
 
136
  Fusce risus nisl, viverra et, tempor et, pretium in, sapien. Vestibulum turpis sem, aliquet eget, lobortis pellentesque, rutrum eu, nisl. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Sed fringilla mauris sit amet nibh. Pellentesque ut neque.',
137
+ ]
138
+ ],
139
+ 'fields' => $repeater->get_controls(),
140
+ 'title_field' => '{{{ element_title }}}',
141
+ ] );
142
+ $this->add_control( 'upgrade_notice', [
143
+ 'type' => Controls_Manager::RAW_HTML,
144
+ 'separator' => 'before',
145
+ 'raw' => '<div style="text-align:center;line-height:1.6;"><p>' . __( 'Unlock new possibilities with premium widgets and styles of <strong>Livemesh Addons for Elementor <i>Premium</i></strong>. ', 'livemesh-el-addons' ) . '</p><p style="padding-top:15px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://livemeshelementor.com/pricing/#pricing-plans" target="_blank"><i class="fa fa-hand-o-right" aria-hidden="true"></i>' . __( 'Go Pro', 'livemesh-el-addons' ) . '</a></p></div>',
146
+ ] );
147
  $this->end_controls_section();
148
+ $this->start_controls_section( 'section_settings', [
149
+ 'label' => __( 'Carousel Settings', 'livemesh-el-addons' ),
150
+ 'tab' => Controls_Manager::TAB_SETTINGS,
151
+ ] );
152
+ $this->add_responsive_control( 'gutter', [
153
+ 'label' => __( 'Spacing between items', 'livemesh-el-addons' ),
154
+ 'type' => Controls_Manager::SLIDER,
155
+ 'size_units' => [ 'px' ],
156
+ 'default' => [
157
+ 'size' => 10,
158
+ ],
159
+ 'range' => [
160
+ 'px' => [
161
+ 'min' => 0,
162
+ 'max' => 50,
163
+ ],
164
+ ],
165
+ 'selectors' => [
166
+ '{{WRAPPER}} .lae-carousel .slick-slide' => 'margin: 0 {{SIZE}}{{UNIT}};',
167
+ '{{WRAPPER}} .lae-carousel .slick-list' => 'margin: 0 -{{SIZE}}{{UNIT}};',
168
+ ],
169
+ ] );
170
+ $this->add_control( 'arrows', [
171
+ 'type' => Controls_Manager::SWITCHER,
172
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
173
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
174
+ 'return_value' => 'yes',
175
+ 'default' => 'yes',
176
+ 'label' => __( 'Prev/Next Arrows?', 'livemesh-el-addons' ),
177
+ ] );
178
+ $this->add_control( 'dots', [
179
+ 'type' => Controls_Manager::SWITCHER,
180
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
181
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
182
+ 'return_value' => 'yes',
183
+ 'separator' => 'before',
184
+ 'default' => 'no',
185
+ 'label' => __( 'Show dot indicators for navigation?', 'livemesh-el-addons' ),
186
+ ] );
187
+ $this->add_control( 'pause_on_hover', [
188
+ 'type' => Controls_Manager::SWITCHER,
189
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
190
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
191
+ 'return_value' => 'yes',
192
+ 'default' => 'yes',
193
+ 'label' => __( 'Pause on Hover?', 'livemesh-el-addons' ),
194
+ ] );
195
+ $this->add_control( 'autoplay', [
196
+ 'type' => Controls_Manager::SWITCHER,
197
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
198
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
199
+ 'return_value' => 'yes',
200
+ 'separator' => 'before',
201
+ 'default' => 'no',
202
+ 'label' => __( 'Autoplay?', 'livemesh-el-addons' ),
203
+ 'description' => __( 'Should the carousel autoplay as in a slideshow.', 'livemesh-el-addons' ),
204
+ ] );
205
+ $this->add_control( 'autoplay_speed', [
206
+ 'label' => __( 'Autoplay speed in ms', 'livemesh-el-addons' ),
207
+ 'type' => Controls_Manager::NUMBER,
208
+ 'default' => 3000,
209
+ ] );
210
+ $this->add_control( 'animation_speed', [
211
+ 'label' => __( 'Autoplay animation speed in ms', 'livemesh-el-addons' ),
212
+ 'type' => Controls_Manager::NUMBER,
213
+ 'default' => 300,
214
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
  $this->end_controls_section();
216
+ $this->start_controls_section( 'section_responsive', [
217
+ 'label' => __( 'Responsive Options', 'livemesh-el-addons' ),
218
+ 'tab' => Controls_Manager::TAB_SETTINGS,
219
+ ] );
220
+ $this->add_control( 'heading_desktop', [
221
+ 'label' => __( 'Desktop', 'livemesh-el-addons' ),
222
+ 'type' => Controls_Manager::HEADING,
223
+ 'separator' => 'after',
224
+ ] );
225
+ $this->add_control( 'display_columns', [
226
+ 'label' => __( 'Columns per row', 'livemesh-el-addons' ),
227
+ 'type' => Controls_Manager::NUMBER,
228
+ 'min' => 1,
229
+ 'max' => 25,
230
+ 'step' => 1,
231
+ 'default' => 3,
232
+ ] );
233
+ $this->add_control( 'scroll_columns', [
234
+ 'label' => __( 'Columns to scroll', 'livemesh-el-addons' ),
235
+ 'type' => Controls_Manager::NUMBER,
236
+ 'min' => 1,
237
+ 'max' => 25,
238
+ 'step' => 1,
239
+ 'default' => 3,
240
+ ] );
241
+ $this->add_control( 'heading_tablet', [
242
+ 'label' => __( 'Tablet', 'livemesh-el-addons' ),
243
+ 'type' => Controls_Manager::HEADING,
244
+ 'separator' => 'after',
245
+ ] );
246
+ $this->add_control( 'tablet_display_columns', [
247
+ 'label' => __( 'Columns per row', 'livemesh-el-addons' ),
248
+ 'type' => Controls_Manager::NUMBER,
249
+ 'min' => 1,
250
+ 'max' => 20,
251
+ 'step' => 1,
252
+ 'default' => 2,
253
+ ] );
254
+ $this->add_control( 'tablet_scroll_columns', [
255
+ 'label' => __( 'Columns to scroll', 'livemesh-el-addons' ),
256
+ 'type' => Controls_Manager::NUMBER,
257
+ 'min' => 1,
258
+ 'max' => 20,
259
+ 'step' => 1,
260
+ 'default' => 2,
261
+ ] );
262
+ $this->add_control( 'tablet_width', [
263
+ 'label' => __( 'Tablet Resolution', 'livemesh-el-addons' ),
264
+ 'description' => __( 'The resolution to treat as a tablet resolution.', 'livemesh-el-addons' ),
265
+ 'type' => Controls_Manager::NUMBER,
266
+ 'default' => 800,
267
+ ] );
268
+ $this->add_control( 'heading_mobile', [
269
+ 'label' => __( 'Mobile Phone', 'livemesh-el-addons' ),
270
+ 'type' => Controls_Manager::HEADING,
271
+ 'separator' => 'after',
272
+ ] );
273
+ $this->add_control( 'mobile_display_columns', [
274
+ 'label' => __( 'Columns per row', 'livemesh-el-addons' ),
275
+ 'type' => Controls_Manager::NUMBER,
276
+ 'min' => 1,
277
+ 'max' => 10,
278
+ 'step' => 1,
279
+ 'default' => 1,
280
+ ] );
281
+ $this->add_control( 'mobile_scroll_columns', [
282
+ 'label' => __( 'Columns to scroll', 'livemesh-el-addons' ),
283
+ 'type' => Controls_Manager::NUMBER,
284
+ 'min' => 1,
285
+ 'max' => 10,
286
+ 'step' => 1,
287
+ 'default' => 1,
288
+ ] );
289
+ $this->add_control( 'mobile_width', [
290
+ 'label' => __( 'Mobile Resolution', 'livemesh-el-addons' ),
291
+ 'description' => __( 'The resolution to treat as a mobile resolution.', 'livemesh-el-addons' ),
292
+ 'type' => Controls_Manager::NUMBER,
293
+ 'default' => 480,
294
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  $this->end_controls_section();
296
+ $this->start_controls_section( 'section_carousel_style', [
297
+ 'label' => __( 'Carousel', 'livemesh-el-addons' ),
298
+ 'tab' => Controls_Manager::TAB_STYLE,
299
+ 'show_label' => false,
300
+ ] );
301
+ $this->add_control( 'heading_content', [
302
+ 'label' => __( 'Content', 'livemesh-el-addons' ),
303
+ 'type' => Controls_Manager::HEADING,
304
+ 'separator' => 'after',
305
+ ] );
306
+ $this->add_control( 'content_color', [
307
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
308
+ 'type' => Controls_Manager::COLOR,
309
+ 'selectors' => [
310
+ '{{WRAPPER}} .lae-carousel .lae-carousel-item' => 'color: {{VALUE}};',
311
+ ],
312
+ ] );
313
+ $this->add_control( 'content_bg_color', [
314
+ 'label' => __( 'Background Color', 'livemesh-el-addons' ),
315
+ 'type' => Controls_Manager::COLOR,
316
+ 'selectors' => [
317
+ '{{WRAPPER}} .lae-carousel .lae-carousel-item' => 'background-color: {{VALUE}};',
318
+ ],
319
+ ] );
320
+ $this->add_group_control( Group_Control_Typography::get_type(), [
321
+ 'name' => 'content_typography',
322
+ 'selector' => '{{WRAPPER}} .lae-carousel .lae-carousel-item',
323
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
  }
325
+
326
+ protected function render()
327
+ {
328
  $settings = $this->get_settings_for_display();
329
+ $settings = apply_filters( 'lae_carousel_' . $this->get_id() . '_settings', $settings );
 
 
330
  $args['settings'] = $settings;
 
331
  $args['widget_instance'] = $this;
332
+ lae_get_template_part( 'addons/carousel/loop', $args );
 
333
  }
334
+
335
+ protected function content_template()
336
+ {
337
  }
338
 
339
  }
includes/widgets/clients.php CHANGED
@@ -6,397 +6,294 @@ Description: Display one or more clients depicting a percentage value in a multi
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
9
-
10
  namespace LivemeshAddons\Widgets;
11
 
12
- use Elementor\Repeater;
13
- use Elementor\Widget_Base;
14
- use Elementor\Controls_Manager;
15
- use Elementor\Utils;
16
- use Elementor\Group_Control_Typography;
17
- use Elementor\Scheme_Color;
18
- use Elementor\Scheme_Typography;
19
-
20
- if (!defined('ABSPATH'))
21
- exit; // Exit if accessed directly
22
-
23
-
24
- class LAE_Clients_Widget extends LAE_Widget_Base {
25
-
26
- public function get_name() {
27
  return 'lae-clients';
28
  }
29
-
30
- public function get_title() {
31
- return __('Clients', 'livemesh-el-addons');
 
32
  }
33
-
34
- public function get_icon() {
 
35
  return 'lae-icon-clients';
36
  }
37
-
38
- public function get_categories() {
39
- return array('livemesh-addons');
 
40
  }
41
-
42
- public function get_custom_help_url() {
 
43
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/clients-addon/';
44
  }
45
-
46
- public function get_script_depends() {
47
- return [
48
- 'lae-waypoints',
49
- 'lae-frontend-scripts'
50
- ];
51
  }
52
-
53
- public function get_style_depends() {
54
- return [
55
- 'lae-animate-styles',
56
- 'lae-frontend-styles',
57
- 'lae-clients-styles'
58
- ];
59
  }
60
-
61
- protected function _register_controls() {
62
-
63
- $this->start_controls_section(
64
- 'section_clients',
65
- [
66
- 'label' => __('Clients', 'livemesh-el-addons'),
67
- ]
68
- );
69
-
70
-
71
  $repeater = new Repeater();
72
-
73
- $repeater->add_control(
74
- 'client_name',
75
- [
76
-
77
- 'type' => Controls_Manager::TEXT,
78
- 'label' => __('Client Name', 'livemesh-el-addons'),
79
- 'label_block' => true,
80
- 'description' => __('The name of the client/customer.', 'livemesh-el-addons'),
81
- 'default' => __('My client name', 'livemesh-el-addons'),
82
- 'dynamic' => [
83
- 'active' => true,
84
- ],
85
- ]
86
- );
87
-
88
- $repeater->add_control(
89
- 'client_link',
90
- [
91
-
92
- 'label' => __('Client URL', 'livemesh-el-addons'),
93
- 'description' => __('The website of the client/customer.', 'livemesh-el-addons'),
94
- 'type' => Controls_Manager::URL,
95
- 'label_block' => true,
96
- 'default' => [
97
- 'url' => '',
98
- 'is_external' => 'true',
99
- ],
100
- 'placeholder' => __('http://client-link.com', 'livemesh-el-addons'),
101
- 'dynamic' => [
102
- 'active' => true,
103
- ],
104
- ]
105
- );
106
-
107
- $repeater->add_control(
108
- 'client_image',
109
- [
110
-
111
- 'label' => __('Client Logo/Image', 'livemesh-el-addons'),
112
- 'description' => __('The logo image for the client/customer.', 'livemesh-el-addons'),
113
- 'type' => Controls_Manager::MEDIA,
114
- 'default' => [
115
- 'url' => Utils::get_placeholder_image_src(),
116
- ],
117
- 'label_block' => true,
118
- 'dynamic' => [
119
- 'active' => true,
120
- ],
121
- ]
122
- );
123
-
124
- $this->add_control(
125
- 'clients',
126
- [
127
- 'type' => Controls_Manager::REPEATER,
128
- 'fields' => $repeater->get_controls(),
129
- 'title_field' => '{{{ client_name }}}',
130
- ]
131
- );
132
-
133
  $this->end_controls_section();
134
-
135
- $this->start_controls_section(
136
- 'section_animation_settings',
137
- [
138
- 'label' => __('Widget Animation', 'livemesh-el-addons'),
139
- 'tab' => Controls_Manager::TAB_SETTINGS,
140
- ]
141
- );
142
-
143
- $this->add_control(
144
- 'widget_animation',
145
- [
146
- "type" => Controls_Manager::SELECT,
147
- "label" => __("Animation Type", "livemesh-el-addons"),
148
- 'options' => lae_get_animation_options(),
149
- 'default' => 'none',
150
- ]
151
- );
152
-
153
  $this->end_controls_section();
154
-
155
- $this->start_controls_section(
156
- 'section_grid_settings',
157
- [
158
- 'label' => __('Grid Settings', 'livemesh-el-addons'),
159
- 'tab' => Controls_Manager::TAB_SETTINGS,
160
- ]
161
- );
162
-
163
- $this->add_control(
164
- 'column_layout',
165
- [
166
- 'label' => __('Column Layout', 'livemesh-el-addons'),
167
- 'type' => Controls_Manager::SELECT,
168
- 'options' => array(
169
- 'auto' => __('Auto', 'livemesh-el-addons'),
170
- 'custom' => __('Custom', 'livemesh-el-addons'),
171
- ),
172
- 'default' => 'auto',
173
- 'description' => __('Set column layout to be <strong>Auto</strong> to let the widget auto calculate number of columns based on minimum column size specified. The option <strong>Custom</strong> lets you explicitly control number of columns based on screen width.', 'livemesh-el-addons'),
174
- ]
175
- );
176
-
177
- $this->add_control(
178
- 'min_column_size',
179
- [
180
- 'label' => __('Minimum Column Size', 'livemesh-el-addons'),
181
- 'type' => Controls_Manager::SLIDER,
182
- 'size_units' => ['px'],
183
- 'default' => [
184
- 'size' => 240,
185
- ],
186
- 'range' => [
187
- 'px' => [
188
- 'min' => 50,
189
- 'max' => 500,
190
- ],
191
- ],
192
- 'selectors' => [
193
- '{{WRAPPER}} .lae-uber-grid-container.lae-grid-auto-column-layout' => 'grid-template-columns: repeat(auto-fit, minmax({{SIZE}}{{UNIT}}, 1fr));',
194
- ],
195
- 'condition' => [
196
- 'column_layout' => 'auto'
197
- ]
198
- ]
199
- );
200
-
201
- $this->add_responsive_control(
202
- 'per_line',
203
- [
204
- 'label' => __('Columns per row', 'livemesh-el-addons'),
205
- 'type' => Controls_Manager::SELECT,
206
- 'default' => '4',
207
- 'tablet_default' => '3',
208
- 'mobile_default' => '2',
209
- 'options' => [
210
- '1' => '1',
211
- '2' => '2',
212
- '3' => '3',
213
- '4' => '4',
214
- '5' => '5',
215
- '6' => '6',
216
- ],
217
- 'frontend_available' => true,
218
- 'condition' => [
219
- 'column_layout' => 'custom'
220
- ]
221
- ]
222
- );
223
-
224
- $this->add_control(
225
- 'column_gap',
226
- [
227
- 'label' => __('Column Gap', 'livemesh-el-addons'),
228
- 'type' => Controls_Manager::SLIDER,
229
- 'size_units' => ['px'],
230
- 'default' => [
231
- 'size' => 0,
232
- ],
233
- 'range' => [
234
- 'px' => [
235
- 'min' => 0,
236
- 'max' => 100,
237
- ],
238
- ],
239
- 'selectors' => [
240
- '{{WRAPPER}} .lae-uber-grid-container' => 'column-gap: {{SIZE}}{{UNIT}};',
241
- ],
242
- ]
243
- );
244
-
245
- $this->add_control(
246
- 'row_gap',
247
- [
248
- 'label' => __('Row Gap', 'livemesh-el-addons'),
249
- 'type' => Controls_Manager::SLIDER,
250
- 'size_units' => ['px'],
251
- 'default' => [
252
- 'size' => 0,
253
- ],
254
- 'range' => [
255
- 'px' => [
256
- 'min' => 0,
257
- 'max' => 100,
258
- ],
259
- ],
260
- 'selectors' => [
261
- '{{WRAPPER}} .lae-uber-grid-container' => 'row-gap: {{SIZE}}{{UNIT}};',
262
- ],
263
- ]
264
- );
265
-
266
  $this->end_controls_section();
267
-
268
- $this->start_controls_section(
269
- 'section_styling',
270
- [
271
- 'label' => __('Clients', 'livemesh-el-addons'),
272
- 'tab' => Controls_Manager::TAB_STYLE,
273
-
274
- ]
275
- );
276
-
277
- $this->add_control(
278
- 'heading_client_image',
279
- [
280
- 'label' => __('Client Images', 'livemesh-el-addons'),
281
- 'type' => Controls_Manager::HEADING,
282
- 'separator' => 'before',
283
- ]
284
- );
285
-
286
- $this->add_control(
287
- 'client_border_color',
288
- [
289
- 'label' => __('Client Border Color', 'livemesh-el-addons'),
290
- 'type' => Controls_Manager::COLOR,
291
- 'selectors' => [
292
- '{{WRAPPER}} .lae-clients .lae-client' => 'border-color: {{VALUE}} !important;',
293
- ],
294
- ]
295
- );
296
-
297
- $this->add_control(
298
- 'client_hover_bg_color',
299
- [
300
- 'label' => __('Client Hover Color', 'livemesh-el-addons'),
301
- 'type' => Controls_Manager::COLOR,
302
- 'selectors' => [
303
- '{{WRAPPER}} .lae-clients .lae-client .lae-image-overlay' => 'background-color: {{VALUE}};',
304
- ],
305
- ]
306
- );
307
-
308
- $this->add_responsive_control(
309
- 'thumbnail_hover_opacity',
310
- [
311
- 'label' => __('Thumbnail Hover Opacity (%)', 'livemesh-el-addons'),
312
- 'type' => Controls_Manager::SLIDER,
313
- 'default' => [
314
- 'size' => 0.7,
315
- ],
316
- 'range' => [
317
- 'px' => [
318
- 'max' => 1,
319
- 'min' => 0.10,
320
- 'step' => 0.01,
321
- ],
322
- ],
323
- 'selectors' => [
324
- '{{WRAPPER}} .lae-clients .lae-client:hover .lae-image-overlay' => 'opacity: {{SIZE}};',
325
- ],
326
- ]
327
- );
328
-
329
- $this->add_control(
330
- 'client_padding',
331
- [
332
- 'label' => __('Client Padding', 'livemesh-el-addons'),
333
- 'description' => __('Padding for the client images.', 'livemesh-el-addons'),
334
- 'type' => Controls_Manager::DIMENSIONS,
335
- 'size_units' => ['px', '%', 'em'],
336
- 'selectors' => [
337
- '{{WRAPPER}} .lae-clients .lae-client' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
338
- ],
339
- ]
340
- );
341
-
342
- $this->add_control(
343
- 'heading_client_name',
344
- [
345
- 'label' => __('Client Name', 'livemesh-el-addons'),
346
- 'type' => Controls_Manager::HEADING,
347
- 'separator' => 'before',
348
- ]
349
- );
350
-
351
-
352
- $this->add_control(
353
- 'client_name_color',
354
- [
355
- 'label' => __('Client Name Color', 'livemesh-el-addons'),
356
- 'type' => Controls_Manager::COLOR,
357
- 'selectors' => [
358
- '{{WRAPPER}} .lae-clients .lae-client .lae-client-name a' => 'color: {{VALUE}};',
359
- ],
360
- ]
361
- );
362
-
363
-
364
- $this->add_control(
365
- 'client_name_hover_color',
366
- [
367
- 'label' => __('Client Name Hover Color', 'livemesh-el-addons'),
368
- 'type' => Controls_Manager::COLOR,
369
- 'selectors' => [
370
- '{{WRAPPER}} .lae-clients .lae-client .lae-client-name a:hover' => 'color: {{VALUE}};',
371
- ],
372
- ]
373
- );
374
-
375
- $this->add_group_control(
376
- Group_Control_Typography::get_type(),
377
- [
378
- 'name' => 'client_name_typography',
379
- 'selector' => '{{WRAPPER}} .lae-clients .lae-client .lae-client-name a',
380
- ]
381
- );
382
-
383
  $this->end_controls_section();
384
  }
385
-
386
- protected function render() {
387
-
388
  $settings = $this->get_settings_for_display();
389
-
390
- $settings = apply_filters('lae_clients_' . $this->get_id() . '_settings', $settings);
391
-
392
  $args['settings'] = $settings;
393
-
394
  $args['widget_instance'] = $this;
395
-
396
- lae_get_template_part('addons/clients/loop', $args);
397
  }
398
-
399
- protected function content_template() {
 
400
  }
401
 
402
  }
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
 
9
  namespace LivemeshAddons\Widgets;
10
 
11
+ use Elementor\Repeater ;
12
+ use Elementor\Widget_Base ;
13
+ use Elementor\Controls_Manager ;
14
+ use Elementor\Utils ;
15
+ use Elementor\Group_Control_Typography ;
16
+ use Elementor\Scheme_Color ;
17
+ use Elementor\Scheme_Typography ;
18
+ if ( !defined( 'ABSPATH' ) ) {
19
+ exit;
20
+ }
21
+ // Exit if accessed directly
22
+ class LAE_Clients_Widget extends LAE_Widget_Base
23
+ {
24
+ public function get_name()
25
+ {
26
  return 'lae-clients';
27
  }
28
+
29
+ public function get_title()
30
+ {
31
+ return __( 'Clients', 'livemesh-el-addons' );
32
  }
33
+
34
+ public function get_icon()
35
+ {
36
  return 'lae-icon-clients';
37
  }
38
+
39
+ public function get_categories()
40
+ {
41
+ return array( 'livemesh-addons' );
42
  }
43
+
44
+ public function get_custom_help_url()
45
+ {
46
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/clients-addon/';
47
  }
48
+
49
+ public function get_script_depends()
50
+ {
51
+ return [ 'lae-waypoints', 'lae-frontend-scripts' ];
 
 
52
  }
53
+
54
+ public function get_style_depends()
55
+ {
56
+ return [ 'lae-animate-styles', 'lae-frontend-styles', 'lae-clients-styles' ];
 
 
 
57
  }
58
+
59
+ protected function _register_controls()
60
+ {
61
+ $this->start_controls_section( 'section_clients', [
62
+ 'label' => __( 'Clients', 'livemesh-el-addons' ),
63
+ ] );
 
 
 
 
 
64
  $repeater = new Repeater();
65
+ $repeater->add_control( 'client_name', [
66
+ 'type' => Controls_Manager::TEXT,
67
+ 'label' => __( 'Client Name', 'livemesh-el-addons' ),
68
+ 'label_block' => true,
69
+ 'description' => __( 'The name of the client/customer.', 'livemesh-el-addons' ),
70
+ 'default' => __( 'My client name', 'livemesh-el-addons' ),
71
+ 'dynamic' => [
72
+ 'active' => true,
73
+ ],
74
+ ] );
75
+ $repeater->add_control( 'client_link', [
76
+ 'label' => __( 'Client URL', 'livemesh-el-addons' ),
77
+ 'description' => __( 'The website of the client/customer.', 'livemesh-el-addons' ),
78
+ 'type' => Controls_Manager::URL,
79
+ 'label_block' => true,
80
+ 'default' => [
81
+ 'url' => '',
82
+ 'is_external' => 'true',
83
+ ],
84
+ 'placeholder' => __( 'http://client-link.com', 'livemesh-el-addons' ),
85
+ 'dynamic' => [
86
+ 'active' => true,
87
+ ],
88
+ ] );
89
+ $repeater->add_control( 'client_image', [
90
+ 'label' => __( 'Client Logo/Image', 'livemesh-el-addons' ),
91
+ 'description' => __( 'The logo image for the client/customer.', 'livemesh-el-addons' ),
92
+ 'type' => Controls_Manager::MEDIA,
93
+ 'default' => [
94
+ 'url' => Utils::get_placeholder_image_src(),
95
+ ],
96
+ 'label_block' => true,
97
+ 'dynamic' => [
98
+ 'active' => true,
99
+ ],
100
+ ] );
101
+ $this->add_control( 'clients', [
102
+ 'type' => Controls_Manager::REPEATER,
103
+ 'fields' => $repeater->get_controls(),
104
+ 'title_field' => '{{{ client_name }}}',
105
+ ] );
106
+ $this->add_control( 'upgrade_notice', [
107
+ 'type' => Controls_Manager::RAW_HTML,
108
+ 'separator' => 'before',
109
+ 'raw' => '<div style="text-align:center;line-height:1.6;"><p>' . __( 'Unlock new possibilities with premium widgets and styles of <strong>Livemesh Addons for Elementor <i>Premium</i></strong>. ', 'livemesh-el-addons' ) . '</p><p style="padding-top:15px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://livemeshelementor.com/pricing/#pricing-plans" target="_blank"><i class="fa fa-hand-o-right" aria-hidden="true"></i>' . __( 'Go Pro', 'livemesh-el-addons' ) . '</a></p></div>',
110
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  $this->end_controls_section();
112
+ $this->start_controls_section( 'section_animation_settings', [
113
+ 'label' => __( 'Widget Animation', 'livemesh-el-addons' ),
114
+ 'tab' => Controls_Manager::TAB_SETTINGS,
115
+ ] );
116
+ $this->add_control( 'widget_animation', [
117
+ "type" => Controls_Manager::SELECT,
118
+ "label" => __( "Animation Type", "livemesh-el-addons" ),
119
+ 'options' => lae_get_animation_options(),
120
+ 'default' => 'none',
121
+ ] );
 
 
 
 
 
 
 
 
 
122
  $this->end_controls_section();
123
+ $this->start_controls_section( 'section_grid_settings', [
124
+ 'label' => __( 'Grid Settings', 'livemesh-el-addons' ),
125
+ 'tab' => Controls_Manager::TAB_SETTINGS,
126
+ ] );
127
+ $this->add_control( 'column_layout', [
128
+ 'label' => __( 'Column Layout', 'livemesh-el-addons' ),
129
+ 'type' => Controls_Manager::SELECT,
130
+ 'options' => array(
131
+ 'auto' => __( 'Auto', 'livemesh-el-addons' ),
132
+ 'custom' => __( 'Custom', 'livemesh-el-addons' ),
133
+ ),
134
+ 'default' => 'auto',
135
+ 'description' => __( 'Set column layout to be <strong>Auto</strong> to let the widget auto calculate number of columns based on minimum column size specified. The option <strong>Custom</strong> lets you explicitly control number of columns based on screen width.', 'livemesh-el-addons' ),
136
+ ] );
137
+ $this->add_control( 'min_column_size', [
138
+ 'label' => __( 'Minimum Column Size', 'livemesh-el-addons' ),
139
+ 'type' => Controls_Manager::SLIDER,
140
+ 'size_units' => [ 'px' ],
141
+ 'default' => [
142
+ 'size' => 240,
143
+ ],
144
+ 'range' => [
145
+ 'px' => [
146
+ 'min' => 50,
147
+ 'max' => 500,
148
+ ],
149
+ ],
150
+ 'selectors' => [
151
+ '{{WRAPPER}} .lae-uber-grid-container.lae-grid-auto-column-layout' => 'grid-template-columns: repeat(auto-fit, minmax({{SIZE}}{{UNIT}}, 1fr));',
152
+ ],
153
+ 'condition' => [
154
+ 'column_layout' => 'auto',
155
+ ],
156
+ ] );
157
+ $this->add_responsive_control( 'per_line', [
158
+ 'label' => __( 'Columns per row', 'livemesh-el-addons' ),
159
+ 'type' => Controls_Manager::SELECT,
160
+ 'default' => '4',
161
+ 'tablet_default' => '3',
162
+ 'mobile_default' => '2',
163
+ 'options' => [
164
+ '1' => '1',
165
+ '2' => '2',
166
+ '3' => '3',
167
+ '4' => '4',
168
+ '5' => '5',
169
+ '6' => '6',
170
+ ],
171
+ 'frontend_available' => true,
172
+ 'condition' => [
173
+ 'column_layout' => 'custom',
174
+ ],
175
+ ] );
176
+ $this->add_control( 'column_gap', [
177
+ 'label' => __( 'Column Gap', 'livemesh-el-addons' ),
178
+ 'type' => Controls_Manager::SLIDER,
179
+ 'size_units' => [ 'px' ],
180
+ 'default' => [
181
+ 'size' => 0,
182
+ ],
183
+ 'range' => [
184
+ 'px' => [
185
+ 'min' => 0,
186
+ 'max' => 100,
187
+ ],
188
+ ],
189
+ 'selectors' => [
190
+ '{{WRAPPER}} .lae-uber-grid-container' => 'column-gap: {{SIZE}}{{UNIT}};',
191
+ ],
192
+ ] );
193
+ $this->add_control( 'row_gap', [
194
+ 'label' => __( 'Row Gap', 'livemesh-el-addons' ),
195
+ 'type' => Controls_Manager::SLIDER,
196
+ 'size_units' => [ 'px' ],
197
+ 'default' => [
198
+ 'size' => 0,
199
+ ],
200
+ 'range' => [
201
+ 'px' => [
202
+ 'min' => 0,
203
+ 'max' => 100,
204
+ ],
205
+ ],
206
+ 'selectors' => [
207
+ '{{WRAPPER}} .lae-uber-grid-container' => 'row-gap: {{SIZE}}{{UNIT}};',
208
+ ],
209
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  $this->end_controls_section();
211
+ $this->start_controls_section( 'section_styling', [
212
+ 'label' => __( 'Clients', 'livemesh-el-addons' ),
213
+ 'tab' => Controls_Manager::TAB_STYLE,
214
+ ] );
215
+ $this->add_control( 'heading_client_image', [
216
+ 'label' => __( 'Client Images', 'livemesh-el-addons' ),
217
+ 'type' => Controls_Manager::HEADING,
218
+ 'separator' => 'before',
219
+ ] );
220
+ $this->add_control( 'client_border_color', [
221
+ 'label' => __( 'Client Border Color', 'livemesh-el-addons' ),
222
+ 'type' => Controls_Manager::COLOR,
223
+ 'selectors' => [
224
+ '{{WRAPPER}} .lae-clients .lae-client' => 'border-color: {{VALUE}} !important;',
225
+ ],
226
+ ] );
227
+ $this->add_control( 'client_hover_bg_color', [
228
+ 'label' => __( 'Client Hover Color', 'livemesh-el-addons' ),
229
+ 'type' => Controls_Manager::COLOR,
230
+ 'selectors' => [
231
+ '{{WRAPPER}} .lae-clients .lae-client .lae-image-overlay' => 'background-color: {{VALUE}};',
232
+ ],
233
+ ] );
234
+ $this->add_responsive_control( 'thumbnail_hover_opacity', [
235
+ 'label' => __( 'Thumbnail Hover Opacity (%)', 'livemesh-el-addons' ),
236
+ 'type' => Controls_Manager::SLIDER,
237
+ 'default' => [
238
+ 'size' => 0.7,
239
+ ],
240
+ 'range' => [
241
+ 'px' => [
242
+ 'max' => 1,
243
+ 'min' => 0.1,
244
+ 'step' => 0.01,
245
+ ],
246
+ ],
247
+ 'selectors' => [
248
+ '{{WRAPPER}} .lae-clients .lae-client:hover .lae-image-overlay' => 'opacity: {{SIZE}};',
249
+ ],
250
+ ] );
251
+ $this->add_control( 'client_padding', [
252
+ 'label' => __( 'Client Padding', 'livemesh-el-addons' ),
253
+ 'description' => __( 'Padding for the client images.', 'livemesh-el-addons' ),
254
+ 'type' => Controls_Manager::DIMENSIONS,
255
+ 'size_units' => [ 'px', '%', 'em' ],
256
+ 'selectors' => [
257
+ '{{WRAPPER}} .lae-clients .lae-client' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
258
+ ],
259
+ ] );
260
+ $this->add_control( 'heading_client_name', [
261
+ 'label' => __( 'Client Name', 'livemesh-el-addons' ),
262
+ 'type' => Controls_Manager::HEADING,
263
+ 'separator' => 'before',
264
+ ] );
265
+ $this->add_control( 'client_name_color', [
266
+ 'label' => __( 'Client Name Color', 'livemesh-el-addons' ),
267
+ 'type' => Controls_Manager::COLOR,
268
+ 'selectors' => [
269
+ '{{WRAPPER}} .lae-clients .lae-client .lae-client-name a' => 'color: {{VALUE}};',
270
+ ],
271
+ ] );
272
+ $this->add_control( 'client_name_hover_color', [
273
+ 'label' => __( 'Client Name Hover Color', 'livemesh-el-addons' ),
274
+ 'type' => Controls_Manager::COLOR,
275
+ 'selectors' => [
276
+ '{{WRAPPER}} .lae-clients .lae-client .lae-client-name a:hover' => 'color: {{VALUE}};',
277
+ ],
278
+ ] );
279
+ $this->add_group_control( Group_Control_Typography::get_type(), [
280
+ 'name' => 'client_name_typography',
281
+ 'selector' => '{{WRAPPER}} .lae-clients .lae-client .lae-client-name a',
282
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
  $this->end_controls_section();
284
  }
285
+
286
+ protected function render()
287
+ {
288
  $settings = $this->get_settings_for_display();
289
+ $settings = apply_filters( 'lae_clients_' . $this->get_id() . '_settings', $settings );
 
 
290
  $args['settings'] = $settings;
 
291
  $args['widget_instance'] = $this;
292
+ lae_get_template_part( 'addons/clients/loop', $args );
 
293
  }
294
+
295
+ protected function content_template()
296
+ {
297
  }
298
 
299
  }
includes/widgets/heading.php CHANGED
@@ -6,299 +6,219 @@ Description: Display one or more heading depicting a percentage value in a multi
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
9
-
10
  namespace LivemeshAddons\Widgets;
11
 
12
- use Elementor\Widget_Base;
13
- use Elementor\Controls_Manager;
14
- use Elementor\Scheme_Color;
15
- use Elementor\Group_Control_Typography;
16
- use Elementor\Scheme_Typography;
17
-
18
- if (!defined('ABSPATH'))
19
- exit; // Exit if accessed directly
20
-
21
-
22
- class LAE_Heading_Widget extends LAE_Widget_Base {
23
-
24
- public function get_name() {
25
  return 'lae-heading';
26
  }
27
-
28
- public function get_title() {
29
- return __('Heading', 'livemesh-el-addons');
 
30
  }
31
-
32
- public function get_icon() {
 
33
  return 'lae-icon-heading';
34
  }
35
-
36
- public function get_categories() {
37
- return array('livemesh-addons');
 
38
  }
39
-
40
- public function get_custom_help_url() {
 
41
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/heading-addon/';
42
  }
43
-
44
- public function get_script_depends() {
45
- return [
46
- 'lae-waypoints',
47
- 'lae-frontend-scripts'
48
- ];
49
  }
50
-
51
- public function get_style_depends() {
52
- return [
53
- 'lae-animate-styles',
54
- 'lae-frontend-styles',
55
- 'lae-heading-styles'
56
- ];
57
  }
58
-
59
- protected function _register_controls() {
60
-
61
- $this->start_controls_section(
62
- 'section_heading',
63
- [
64
- 'label' => __('Heading', 'livemesh-el-addons'),
65
- ]
66
- );
67
-
68
-
69
- $this->add_control(
70
-
71
- 'style', [
72
- 'type' => Controls_Manager::SELECT,
73
- 'label' => __('Choose Style', 'livemesh-el-addons'),
74
- 'default' => 'style1',
75
- 'options' => [
76
- 'style1' => __('Style 1', 'livemesh-el-addons'),
77
- 'style2' => __('Style 2', 'livemesh-el-addons'),
78
- 'style3' => __('Style 3', 'livemesh-el-addons'),
79
- ],
80
- ]
81
- );
82
-
83
- $this->add_control(
84
- 'heading',
85
- [
86
- 'type' => Controls_Manager::TEXT,
87
- 'label' => __('Heading Title', 'livemesh-el-addons'),
88
- 'label_block' => true,
89
- 'separator' => 'before',
90
- 'default' => __('Heading Title', 'livemesh-el-addons'),
91
- 'dynamic' => [
92
- 'active' => true,
93
- ],
94
- ]
95
- );
96
-
97
- $this->add_control(
98
- 'subtitle',
99
- [
100
- 'type' => Controls_Manager::TEXT,
101
- 'label' => __('Subheading', 'livemesh-el-addons'),
102
- 'label_block' => true,
103
- 'description' => __('A subtitle displayed above the title heading.', 'livemesh-el-addons'),
104
- 'condition' => [
105
- 'style' => 'style2',
106
- ],
107
- 'dynamic' => [
108
- 'active' => true,
109
- ],
110
- ]
111
- );
112
-
113
- $this->add_control(
114
- 'short_text',
115
- [
116
- 'type' => 'textarea',
117
- 'label' => __('Short Text', 'livemesh-el-addons'),
118
- 'description' => __('Short text generally displayed below the heading title.', 'livemesh-el-addons'),
119
- 'condition' => [
120
- 'style' => ['style1', 'style2']
121
- ],
122
- 'dynamic' => [
123
- 'active' => true,
124
- ],
125
- ]
126
- );
127
-
128
- $this->add_control(
129
- 'heading_settings',
130
- [
131
- 'label' => __( 'Settings', 'livemesh-el-addons' ),
132
- 'type' => Controls_Manager::HEADING,
133
- 'separator' => 'before',
134
- ]
135
- );
136
-
137
- $this->add_control(
138
- 'align',
139
- [
140
- 'label' => __('Alignment', 'livemesh-el-addons'),
141
- 'type' => Controls_Manager::CHOOSE,
142
- 'options' => [
143
- 'left' => [
144
- 'title' => __('Left', 'livemesh-el-addons'),
145
- 'icon' => 'fa fa-align-left',
146
- ],
147
- 'center' => [
148
- 'title' => __('Center', 'livemesh-el-addons'),
149
- 'icon' => 'fa fa-align-center',
150
- ],
151
- 'right' => [
152
- 'title' => __('Right', 'livemesh-el-addons'),
153
- 'icon' => 'fa fa-align-right',
154
- ],
155
- 'justify' => [
156
- 'title' => __('Justified', 'livemesh-el-addons'),
157
- 'icon' => 'fa fa-align-justify',
158
- ],
159
- ],
160
- 'default' => 'center',
161
- ]
162
- );
163
-
164
- $this->add_control(
165
- 'widget_animation',
166
- [
167
- "type" => Controls_Manager::SELECT,
168
- "label" => __("Animation Type", "livemesh-el-addons"),
169
- 'options' => lae_get_animation_options(),
170
- 'default' => 'none',
171
- ]
172
- );
173
-
174
  $this->end_controls_section();
175
-
176
-
177
- $this->start_controls_section(
178
- 'section_styling',
179
- [
180
- 'label' => __('Title', 'livemesh-el-addons'),
181
- 'tab' => Controls_Manager::TAB_STYLE,
182
- ]
183
- );
184
-
185
- $this->add_control(
186
- 'title_tag',
187
- [
188
- 'label' => __( 'Title HTML Tag', 'livemesh-el-addons' ),
189
- 'type' => Controls_Manager::SELECT,
190
- 'options' => [
191
- 'h1' => __( 'H1', 'livemesh-el-addons' ),
192
- 'h2' => __( 'H2', 'livemesh-el-addons' ),
193
- 'h3' => __( 'H3', 'livemesh-el-addons' ),
194
- 'h4' => __( 'H4', 'livemesh-el-addons' ),
195
- 'h5' => __( 'H5', 'livemesh-el-addons' ),
196
- 'h6' => __( 'H6', 'livemesh-el-addons' ),
197
- 'div' => __( 'div', 'livemesh-el-addons' ),
198
- ],
199
- 'default' => 'h3',
200
- ]
201
- );
202
-
203
- $this->add_control(
204
- 'heading_color',
205
- [
206
- 'label' => __('Heading Color', 'livemesh-el-addons'),
207
- 'type' => Controls_Manager::COLOR,
208
- 'default' => '',
209
- 'selectors' => [
210
- '{{WRAPPER}} .lae-heading .lae-title' => 'color: {{VALUE}};',
211
- ],
212
- ]
213
- );
214
-
215
- $this->add_group_control(
216
- Group_Control_Typography::get_type(),
217
- [
218
- 'name' => 'heading_typography',
219
- 'label' => __('Typography', 'livemesh-el-addons'),
220
- 'selector' => '{{WRAPPER}} .lae-heading .lae-title',
221
- ]
222
- );
223
-
224
  $this->end_controls_section();
225
-
226
-
227
- $this->start_controls_section(
228
- 'section_subtitle',
229
- [
230
- 'label' => __('Subtitle', 'livemesh-el-addons'),
231
- 'tab' => Controls_Manager::TAB_STYLE,
232
- ]
233
- );
234
-
235
- $this->add_control(
236
- 'subtitle_color',
237
- [
238
- 'label' => __( 'Color', 'livemesh-el-addons' ),
239
- 'type' => Controls_Manager::COLOR,
240
- 'selectors' => [
241
- '{{WRAPPER}} .lae-heading .lae-subtitle' => 'color: {{VALUE}};',
242
- ],
243
- ]
244
- );
245
-
246
- $this->add_group_control(
247
- Group_Control_Typography::get_type(),
248
- [
249
- 'name' => 'subtitle_typography',
250
- 'selector' => '{{WRAPPER}} .lae-heading .lae-subtitle',
251
- ]
252
- );
253
-
254
  $this->end_controls_section();
255
-
256
-
257
- $this->start_controls_section(
258
- 'section_short_text',
259
- [
260
- 'label' => __('Short Text', 'livemesh-el-addons'),
261
- 'tab' => Controls_Manager::TAB_STYLE,
262
- ]
263
- );
264
-
265
- $this->add_control(
266
- 'text_color',
267
- [
268
- 'label' => __( 'Color', 'livemesh-el-addons' ),
269
- 'type' => Controls_Manager::COLOR,
270
- 'selectors' => [
271
- '{{WRAPPER}} .lae-heading .lae-text' => 'color: {{VALUE}};',
272
- ],
273
- ]
274
- );
275
-
276
- $this->add_group_control(
277
- Group_Control_Typography::get_type(),
278
- [
279
- 'name' => 'text_typography',
280
- 'selector' => '{{WRAPPER}} .lae-heading .lae-text',
281
- ]
282
- );
283
-
284
  $this->end_controls_section();
285
  }
286
-
287
- protected function render() {
288
-
289
  $settings = $this->get_settings_for_display();
290
-
291
- $settings = apply_filters('lae_heading_' . $this->get_id() . '_settings', $settings);
292
-
293
  $args['settings'] = $settings;
294
-
295
  $args['widget_instance'] = $this;
296
-
297
- lae_get_template_part("addons/heading/{$settings['style']}", $args);
298
-
299
  }
300
-
301
- protected function content_template() {
 
302
  }
303
 
304
  }
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
 
9
  namespace LivemeshAddons\Widgets;
10
 
11
+ use Elementor\Widget_Base ;
12
+ use Elementor\Controls_Manager ;
13
+ use Elementor\Scheme_Color ;
14
+ use Elementor\Group_Control_Typography ;
15
+ use Elementor\Scheme_Typography ;
16
+ if ( !defined( 'ABSPATH' ) ) {
17
+ exit;
18
+ }
19
+ // Exit if accessed directly
20
+ class LAE_Heading_Widget extends LAE_Widget_Base
21
+ {
22
+ public function get_name()
23
+ {
24
  return 'lae-heading';
25
  }
26
+
27
+ public function get_title()
28
+ {
29
+ return __( 'Heading', 'livemesh-el-addons' );
30
  }
31
+
32
+ public function get_icon()
33
+ {
34
  return 'lae-icon-heading';
35
  }
36
+
37
+ public function get_categories()
38
+ {
39
+ return array( 'livemesh-addons' );
40
  }
41
+
42
+ public function get_custom_help_url()
43
+ {
44
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/heading-addon/';
45
  }
46
+
47
+ public function get_script_depends()
48
+ {
49
+ return [ 'lae-waypoints', 'lae-frontend-scripts' ];
 
 
50
  }
51
+
52
+ public function get_style_depends()
53
+ {
54
+ return [ 'lae-animate-styles', 'lae-frontend-styles', 'lae-heading-styles' ];
 
 
 
55
  }
56
+
57
+ protected function _register_controls()
58
+ {
59
+ $this->start_controls_section( 'section_heading', [
60
+ 'label' => __( 'Heading', 'livemesh-el-addons' ),
61
+ ] );
62
+ $this->add_control( 'style', [
63
+ 'type' => Controls_Manager::SELECT,
64
+ 'label' => __( 'Choose Style', 'livemesh-el-addons' ),
65
+ 'default' => 'style1',
66
+ 'options' => [
67
+ 'style1' => __( 'Style 1', 'livemesh-el-addons' ),
68
+ 'style2' => __( 'Style 2', 'livemesh-el-addons' ),
69
+ 'style3' => __( 'Style 3', 'livemesh-el-addons' ),
70
+ ],
71
+ ] );
72
+ $this->add_control( 'heading', [
73
+ 'type' => Controls_Manager::TEXT,
74
+ 'label' => __( 'Heading Title', 'livemesh-el-addons' ),
75
+ 'label_block' => true,
76
+ 'separator' => 'before',
77
+ 'default' => __( 'Heading Title', 'livemesh-el-addons' ),
78
+ 'dynamic' => [
79
+ 'active' => true,
80
+ ],
81
+ ] );
82
+ $this->add_control( 'subtitle', [
83
+ 'type' => Controls_Manager::TEXT,
84
+ 'label' => __( 'Subheading', 'livemesh-el-addons' ),
85
+ 'label_block' => true,
86
+ 'description' => __( 'A subtitle displayed above the title heading.', 'livemesh-el-addons' ),
87
+ 'condition' => [
88
+ 'style' => 'style2',
89
+ ],
90
+ 'dynamic' => [
91
+ 'active' => true,
92
+ ],
93
+ ] );
94
+ $this->add_control( 'short_text', [
95
+ 'type' => 'textarea',
96
+ 'label' => __( 'Short Text', 'livemesh-el-addons' ),
97
+ 'description' => __( 'Short text generally displayed below the heading title.', 'livemesh-el-addons' ),
98
+ 'condition' => [
99
+ 'style' => [ 'style1', 'style2' ],
100
+ ],
101
+ 'dynamic' => [
102
+ 'active' => true,
103
+ ],
104
+ ] );
105
+ $this->add_control( 'heading_settings', [
106
+ 'label' => __( 'Settings', 'livemesh-el-addons' ),
107
+ 'type' => Controls_Manager::HEADING,
108
+ 'separator' => 'before',
109
+ ] );
110
+ $this->add_control( 'align', [
111
+ 'label' => __( 'Alignment', 'livemesh-el-addons' ),
112
+ 'type' => Controls_Manager::CHOOSE,
113
+ 'options' => [
114
+ 'left' => [
115
+ 'title' => __( 'Left', 'livemesh-el-addons' ),
116
+ 'icon' => 'fa fa-align-left',
117
+ ],
118
+ 'center' => [
119
+ 'title' => __( 'Center', 'livemesh-el-addons' ),
120
+ 'icon' => 'fa fa-align-center',
121
+ ],
122
+ 'right' => [
123
+ 'title' => __( 'Right', 'livemesh-el-addons' ),
124
+ 'icon' => 'fa fa-align-right',
125
+ ],
126
+ 'justify' => [
127
+ 'title' => __( 'Justified', 'livemesh-el-addons' ),
128
+ 'icon' => 'fa fa-align-justify',
129
+ ],
130
+ ],
131
+ 'default' => 'center',
132
+ ] );
133
+ $this->add_control( 'widget_animation', [
134
+ "type" => Controls_Manager::SELECT,
135
+ "label" => __( "Animation Type", "livemesh-el-addons" ),
136
+ 'options' => lae_get_animation_options(),
137
+ 'default' => 'none',
138
+ ] );
139
+ $this->add_control( 'upgrade_notice', [
140
+ 'type' => Controls_Manager::RAW_HTML,
141
+ 'separator' => 'before',
142
+ 'raw' => '<div style="text-align:center;line-height:1.6;"><p>' . __( 'Unlock new possibilities with premium widgets and styles of <strong>Livemesh Addons for Elementor <i>Premium</i></strong>. ', 'livemesh-el-addons' ) . '</p><p style="padding-top:15px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://livemeshelementor.com/pricing/#pricing-plans" target="_blank"><i class="fa fa-hand-o-right" aria-hidden="true"></i>' . __( 'Go Pro', 'livemesh-el-addons' ) . '</a></p></div>',
143
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  $this->end_controls_section();
145
+ $this->start_controls_section( 'section_styling', [
146
+ 'label' => __( 'Title', 'livemesh-el-addons' ),
147
+ 'tab' => Controls_Manager::TAB_STYLE,
148
+ ] );
149
+ $this->add_control( 'title_tag', [
150
+ 'label' => __( 'Title HTML Tag', 'livemesh-el-addons' ),
151
+ 'type' => Controls_Manager::SELECT,
152
+ 'options' => [
153
+ 'h1' => __( 'H1', 'livemesh-el-addons' ),
154
+ 'h2' => __( 'H2', 'livemesh-el-addons' ),
155
+ 'h3' => __( 'H3', 'livemesh-el-addons' ),
156
+ 'h4' => __( 'H4', 'livemesh-el-addons' ),
157
+ 'h5' => __( 'H5', 'livemesh-el-addons' ),
158
+ 'h6' => __( 'H6', 'livemesh-el-addons' ),
159
+ 'div' => __( 'div', 'livemesh-el-addons' ),
160
+ ],
161
+ 'default' => 'h3',
162
+ ] );
163
+ $this->add_control( 'heading_color', [
164
+ 'label' => __( 'Heading Color', 'livemesh-el-addons' ),
165
+ 'type' => Controls_Manager::COLOR,
166
+ 'default' => '',
167
+ 'selectors' => [
168
+ '{{WRAPPER}} .lae-heading .lae-title' => 'color: {{VALUE}};',
169
+ ],
170
+ ] );
171
+ $this->add_group_control( Group_Control_Typography::get_type(), [
172
+ 'name' => 'heading_typography',
173
+ 'label' => __( 'Typography', 'livemesh-el-addons' ),
174
+ 'selector' => '{{WRAPPER}} .lae-heading .lae-title',
175
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  $this->end_controls_section();
177
+ $this->start_controls_section( 'section_subtitle', [
178
+ 'label' => __( 'Subtitle', 'livemesh-el-addons' ),
179
+ 'tab' => Controls_Manager::TAB_STYLE,
180
+ ] );
181
+ $this->add_control( 'subtitle_color', [
182
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
183
+ 'type' => Controls_Manager::COLOR,
184
+ 'selectors' => [
185
+ '{{WRAPPER}} .lae-heading .lae-subtitle' => 'color: {{VALUE}};',
186
+ ],
187
+ ] );
188
+ $this->add_group_control( Group_Control_Typography::get_type(), [
189
+ 'name' => 'subtitle_typography',
190
+ 'selector' => '{{WRAPPER}} .lae-heading .lae-subtitle',
191
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  $this->end_controls_section();
193
+ $this->start_controls_section( 'section_short_text', [
194
+ 'label' => __( 'Short Text', 'livemesh-el-addons' ),
195
+ 'tab' => Controls_Manager::TAB_STYLE,
196
+ ] );
197
+ $this->add_control( 'text_color', [
198
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
199
+ 'type' => Controls_Manager::COLOR,
200
+ 'selectors' => [
201
+ '{{WRAPPER}} .lae-heading .lae-text' => 'color: {{VALUE}};',
202
+ ],
203
+ ] );
204
+ $this->add_group_control( Group_Control_Typography::get_type(), [
205
+ 'name' => 'text_typography',
206
+ 'selector' => '{{WRAPPER}} .lae-heading .lae-text',
207
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  $this->end_controls_section();
209
  }
210
+
211
+ protected function render()
212
+ {
213
  $settings = $this->get_settings_for_display();
214
+ $settings = apply_filters( 'lae_heading_' . $this->get_id() . '_settings', $settings );
 
 
215
  $args['settings'] = $settings;
 
216
  $args['widget_instance'] = $this;
217
+ lae_get_template_part( "addons/heading/{$settings['style']}", $args );
 
 
218
  }
219
+
220
+ protected function content_template()
221
+ {
222
  }
223
 
224
  }
includes/widgets/odometers.php CHANGED
@@ -6,45 +6,49 @@ Description: Display one or more animated odometer statistics in a multi-column
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
9
-
10
  namespace LivemeshAddons\Widgets;
11
 
12
- use Elementor\Repeater;
13
- use Elementor\Widget_Base;
14
- use Elementor\Controls_Manager;
15
- use Elementor\Utils;
16
- use Elementor\Scheme_Color;
17
- use Elementor\Group_Control_Typography;
18
- use Elementor\Scheme_Typography;
19
- use Elementor\Modules\DynamicTags\Module as TagsModule;
20
-
21
- if (!defined('ABSPATH'))
22
- exit; // Exit if accessed directly
23
-
24
-
25
- class LAE_Odometers_Widget extends LAE_Widget_Base {
26
-
27
- public function get_name() {
28
  return 'lae-odometers';
29
  }
30
-
31
- public function get_title() {
32
- return __('Odometers', 'livemesh-el-addons');
 
33
  }
34
-
35
- public function get_icon() {
 
36
  return 'eicon-counter';
37
  }
38
-
39
- public function get_categories() {
40
- return array('livemesh-addons');
 
41
  }
42
-
43
- public function get_custom_help_url() {
 
44
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/statistics-addons/';
45
  }
46
-
47
- public function get_script_depends() {
 
48
  return [
49
  'lae-waypoints',
50
  'jquery-stats',
@@ -52,439 +56,307 @@ class LAE_Odometers_Widget extends LAE_Widget_Base {
52
  'lae-odometers-scripts'
53
  ];
54
  }
55
-
56
- public function get_style_depends() {
57
- return [
58
- 'lae-animate-styles',
59
- 'lae-frontend-styles',
60
- 'lae-odometers-styles'
61
- ];
62
  }
63
-
64
- protected function _register_controls() {
65
-
66
- $this->start_controls_section(
67
- 'section_odometers',
68
- [
69
- 'label' => __('Odometers', 'livemesh-el-addons'),
70
- ]
71
- );
72
-
73
  $repeater = new Repeater();
74
-
75
- $repeater->add_control(
76
- 'stats_title',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  [
78
-
79
- 'label' => __('Stats Title', 'livemesh-el-addons'),
80
- 'default' => __('My stats title', 'livemesh-el-addons'),
81
- 'type' => Controls_Manager::TEXT,
82
- 'label_block' => true,
83
- 'dynamic' => [
84
- 'active' => true,
85
- ],
86
- ]
87
- );
88
-
89
- $repeater->add_control(
90
- 'start_value',
91
  [
92
-
93
- 'label' => __('Start Value', 'livemesh-el-addons'),
94
- 'type' => Controls_Manager::NUMBER,
95
- 'default' => 0,
96
- ]
97
- );
98
-
99
- $repeater->add_control(
100
- 'stop_value',
101
  [
102
-
103
- 'label' => __('Stop Value', 'livemesh-el-addons'),
104
- 'type' => Controls_Manager::NUMBER,
105
- 'default' => 100,
106
- ]
107
- );
108
-
109
- $repeater->add_control(
110
- 'icon_type',
111
-
112
- [
113
-
114
- 'label' => __('Choose Icon Type', 'livemesh-el-addons'),
115
- 'type' => Controls_Manager::SELECT,
116
- 'default' => 'icon',
117
- 'options' => [
118
- 'icon' => __('Icon', 'livemesh-el-addons'),
119
- 'icon_image' => __('Icon Image', 'livemesh-el-addons'),
120
- ],
121
- ]
122
- );
123
-
124
- $repeater->add_control(
125
- 'icon_image',
126
- [
127
-
128
- 'label' => __('Stats Image', 'livemesh-el-addons'),
129
- 'type' => Controls_Manager::MEDIA,
130
- 'default' => [
131
- 'url' => Utils::get_placeholder_image_src(),
132
- ],
133
- 'label_block' => true,
134
- 'condition' => [
135
- 'icon_type' => 'icon_image',
136
- ],
137
- 'dynamic' => [
138
- 'active' => true,
139
- ],
140
- ]
141
- );
142
-
143
- $repeater->add_control(
144
- 'selected_icon',
145
- [
146
-
147
- 'label' => __('Stats Icon', 'livemesh-el-addons'),
148
- 'type' => Controls_Manager::ICONS,
149
- 'label_block' => true,
150
- 'condition' => [
151
- 'icon_type' => 'icon',
152
- ],
153
- 'fa4compatibility' => 'icon',
154
- ]
155
- );
156
-
157
- $repeater->add_control(
158
- 'prefix',
159
  [
160
-
161
- 'label' => __('Prefix', 'livemesh-el-addons'),
162
- 'type' => Controls_Manager::TEXT,
163
- 'description' => __('The prefix string like currency symbols like $ to indicate a monetary value.', 'livemesh-el-addons'),
164
- 'dynamic' => [
165
- 'active' => true,
166
- 'categories' => [
167
- TagsModule::POST_META_CATEGORY,
168
- ],
169
- ],
170
- ]
171
- );
172
-
173
- $repeater->add_control(
174
- 'suffix',
175
- [
176
-
177
- 'label' => __('Suffix', 'livemesh-el-addons'),
178
- 'type' => Controls_Manager::TEXT,
179
- 'description' => __('The suffix string like hr for hours or m for million.', 'livemesh-el-addons'),
180
- 'dynamic' => [
181
- 'active' => true,
182
- 'categories' => [
183
- TagsModule::POST_META_CATEGORY,
184
- ],
185
- ],
186
- ]
187
- );
188
-
189
- $this->add_control(
190
- 'odometers',
191
- [
192
- 'label' => __('Odometers', 'livemesh-el-addons'),
193
- 'type' => Controls_Manager::REPEATER,
194
- 'default' => [
195
- [
196
- 'stats_title' => __('No of Customers', 'livemesh-el-addons'),
197
- 'start_value' => 1000,
198
- 'stop_value' => 65600,
199
- 'prefix' => '',
200
- 'suffix' => ''
201
- ],
202
- [
203
- 'stats_title' => __('Hours Worked', 'livemesh-el-addons'),
204
- 'start_value' => 1,
205
- 'stop_value' => 34000,
206
- 'prefix' => '',
207
- 'suffix' => ''
208
- ],
209
- [
210
- 'stats_title' => __('Support Tickets', 'livemesh-el-addons'),
211
- 'start_value' => 1,
212
- 'stop_value' => 348,
213
- 'prefix' => '',
214
- 'suffix' => 'k'
215
- ],
216
- [
217
- 'stats_title' => __('Product Revenue', 'livemesh-el-addons'),
218
- 'start_value' => 1,
219
- 'stop_value' => 35,
220
- 'prefix' => '$',
221
- 'suffix' => 'm'
222
- ],
223
- ],
224
- 'fields' => $repeater->get_controls(),
225
- 'title_field' => '{{{ stats_title }}}',
226
- ]
227
- );
228
-
229
  $this->end_controls_section();
230
-
231
- $this->start_controls_section(
232
- 'section_grid_settings',
233
- [
234
- 'label' => __('Grid Settings', 'livemesh-el-addons'),
235
- 'tab' => Controls_Manager::TAB_SETTINGS,
236
- ]
237
- );
238
-
239
- $this->add_control(
240
- 'column_layout',
241
- [
242
- 'label' => __('Column Layout', 'livemesh-el-addons'),
243
- 'type' => Controls_Manager::SELECT,
244
- 'options' => array(
245
- 'auto' => __('Auto', 'livemesh-el-addons'),
246
- 'custom' => __('Custom', 'livemesh-el-addons'),
247
- ),
248
- 'default' => 'auto',
249
- 'description' => __('Set column layout to be <strong>Auto</strong> to let the widget auto calculate number of columns based on minimum column size specified. The option <strong>Custom</strong> lets you explicitly control number of columns based on screen width.', 'livemesh-el-addons'),
250
- ]
251
- );
252
-
253
- $this->add_control(
254
- 'min_column_size',
255
- [
256
- 'label' => __('Minimum Column Size', 'livemesh-el-addons'),
257
- 'type' => Controls_Manager::SLIDER,
258
- 'size_units' => ['px'],
259
- 'default' => [
260
- 'size' => 210,
261
- ],
262
- 'range' => [
263
- 'px' => [
264
- 'min' => 50,
265
- 'max' => 500,
266
- ],
267
- ],
268
- 'selectors' => [
269
- '{{WRAPPER}} .lae-uber-grid-container.lae-grid-auto-column-layout' => 'grid-template-columns: repeat(auto-fit, minmax({{SIZE}}{{UNIT}}, 1fr));',
270
- ],
271
- 'condition' => [
272
- 'column_layout' => 'auto'
273
- ]
274
- ]
275
- );
276
-
277
- $this->add_responsive_control(
278
- 'per_line',
279
- [
280
- 'label' => __('Odometers per row', 'livemesh-el-addons'),
281
- 'type' => Controls_Manager::SELECT,
282
- 'default' => '4',
283
- 'tablet_default' => '3',
284
- 'mobile_default' => '1',
285
- 'options' => [
286
- '1' => '1',
287
- '2' => '2',
288
- '3' => '3',
289
- '4' => '4',
290
- '5' => '5',
291
- '6' => '6',
292
- ],
293
- 'frontend_available' => true,
294
- 'condition' => [
295
- 'column_layout' => 'custom'
296
- ]
297
- ]
298
- );
299
-
300
- $this->add_control(
301
- 'column_gap',
302
- [
303
- 'label' => __('Column Gap', 'livemesh-el-addons'),
304
- 'type' => Controls_Manager::SLIDER,
305
- 'size_units' => ['px'],
306
- 'default' => [
307
- 'size' => 30,
308
- ],
309
- 'range' => [
310
- 'px' => [
311
- 'min' => 0,
312
- 'max' => 100,
313
- ],
314
- ],
315
- 'selectors' => [
316
- '{{WRAPPER}} .lae-uber-grid-container' => 'column-gap: {{SIZE}}{{UNIT}};',
317
- ],
318
- ]
319
- );
320
-
321
- $this->add_control(
322
- 'row_gap',
323
- [
324
- 'label' => __('Row Gap', 'livemesh-el-addons'),
325
- 'type' => Controls_Manager::SLIDER,
326
- 'size_units' => ['px'],
327
- 'default' => [
328
- 'size' => 30,
329
- ],
330
- 'range' => [
331
- 'px' => [
332
- 'min' => 0,
333
- 'max' => 100,
334
- ],
335
- ],
336
- 'selectors' => [
337
- '{{WRAPPER}} .lae-uber-grid-container' => 'row-gap: {{SIZE}}{{UNIT}};',
338
- ],
339
- ]
340
- );
341
-
342
  $this->end_controls_section();
343
-
344
- $this->start_controls_section(
345
- 'section_stats_number',
346
- [
347
- 'label' => __('Stats Number', 'livemesh-el-addons'),
348
- 'tab' => Controls_Manager::TAB_STYLE,
349
- ]
350
- );
351
-
352
- $this->add_control(
353
- 'stats_number_color',
354
- [
355
- 'label' => __('Color', 'livemesh-el-addons'),
356
- 'type' => Controls_Manager::COLOR,
357
- 'selectors' => [
358
- '{{WRAPPER}} .lae-odometers .lae-odometer .lae-number' => 'color: {{VALUE}};',
359
- ],
360
- ]
361
- );
362
-
363
- $this->add_group_control(
364
- Group_Control_Typography::get_type(),
365
- [
366
- 'name' => 'stats_number_typography',
367
- 'selector' => '{{WRAPPER}} .lae-odometers .lae-odometer .lae-number span',
368
- ]
369
- );
370
-
371
  $this->end_controls_section();
372
-
373
- $this->start_controls_section(
374
- 'section_stats_prefix_suffix',
375
- [
376
- 'label' => __('Stats Prefix and Suffix', 'livemesh-el-addons'),
377
- 'tab' => Controls_Manager::TAB_STYLE,
378
- ]
379
- );
380
-
381
- $this->add_control(
382
- 'stats_prefix_suffix_color',
383
- [
384
- 'label' => __('Color', 'livemesh-el-addons'),
385
- 'type' => Controls_Manager::COLOR,
386
- 'selectors' => [
387
- '{{WRAPPER}} .lae-odometers .lae-odometer .lae-prefix, .lae-odometers .lae-odometer .lae-suffix' => 'color: {{VALUE}};',
388
- ],
389
- ]
390
- );
391
-
392
- $this->add_group_control(
393
- Group_Control_Typography::get_type(),
394
- [
395
- 'name' => 'stats_prefix_suffix_typography',
396
- 'selector' => '{{WRAPPER}} .lae-odometers .lae-odometer .lae-prefix, .lae-odometers .lae-odometer .lae-suffix',
397
- ]
398
- );
399
-
400
  $this->end_controls_section();
401
-
402
- $this->start_controls_section(
403
- 'section_styling',
404
- [
405
- 'label' => __('Stats Title', 'livemesh-el-addons'),
406
- 'tab' => Controls_Manager::TAB_STYLE,
407
- ]
408
- );
409
-
410
- $this->add_control(
411
- 'stats_title_color',
412
- [
413
- 'label' => __('Color', 'livemesh-el-addons'),
414
- 'type' => Controls_Manager::COLOR,
415
- 'default' => '',
416
- 'selectors' => [
417
- '{{WRAPPER}} .lae-odometers .lae-odometer .lae-stats-title' => 'color: {{VALUE}};',
418
- ],
419
- ]
420
- );
421
-
422
- $this->add_group_control(
423
- Group_Control_Typography::get_type(),
424
- [
425
- 'name' => 'stats_title_typography',
426
- 'label' => __('Typography', 'livemesh-el-addons'),
427
- 'selector' => '{{WRAPPER}} .lae-odometers .lae-odometer .lae-stats-title',
428
- ]
429
- );
430
-
431
  $this->end_controls_section();
432
-
433
- $this->start_controls_section(
434
- 'section_icon_styling',
435
- [
436
- 'label' => __('Icons', 'livemesh-el-addons'),
437
- 'tab' => Controls_Manager::TAB_STYLE,
438
- ]
439
- );
440
-
441
- $this->add_control(
442
- 'icon_size',
443
- [
444
- 'label' => __('Icon or Icon Image size in pixels', 'livemesh-el-addons'),
445
- 'type' => Controls_Manager::SLIDER,
446
- 'size_units' => ['px', '%', 'em'],
447
- 'range' => [
448
- 'px' => [
449
- 'min' => 6,
450
- 'max' => 128,
451
- ],
452
- ],
453
- 'selectors' => [
454
- '{{WRAPPER}} .lae-odometers .lae-odometer .lae-image-wrapper img' => 'width: {{SIZE}}{{UNIT}};',
455
- '{{WRAPPER}} .lae-odometers .lae-odometer .lae-icon-wrapper' => 'font-size: {{SIZE}}{{UNIT}};',
456
- ],
457
- ]
458
- );
459
-
460
- $this->add_control(
461
- 'icon_color',
462
- [
463
- 'label' => __('Icon Color', 'livemesh-el-addons'),
464
- 'type' => Controls_Manager::COLOR,
465
- 'default' => '',
466
- 'selectors' => [
467
- '{{WRAPPER}} .lae-odometers .lae-odometer .lae-stats-title .lae-icon-wrapper' => 'color: {{VALUE}};',
468
- ],
469
- ]
470
- );
471
  }
472
-
473
- protected function render() {
474
-
475
  $settings = $this->get_settings_for_display();
476
-
477
- $settings = apply_filters('lae_odometers_' . $this->get_id() . '_settings', $settings);
478
-
479
  $args['settings'] = $settings;
480
-
481
  $args['widget_instance'] = $this;
482
-
483
- lae_get_template_part('addons/odometers/loop', $args);
484
-
485
  }
486
-
487
- protected function content_template() {
 
488
  }
489
 
490
  }
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
 
9
  namespace LivemeshAddons\Widgets;
10
 
11
+ use Elementor\Repeater ;
12
+ use Elementor\Widget_Base ;
13
+ use Elementor\Controls_Manager ;
14
+ use Elementor\Utils ;
15
+ use Elementor\Scheme_Color ;
16
+ use Elementor\Group_Control_Typography ;
17
+ use Elementor\Scheme_Typography ;
18
+ use Elementor\Modules\DynamicTags\Module as TagsModule ;
19
+ if ( !defined( 'ABSPATH' ) ) {
20
+ exit;
21
+ }
22
+ // Exit if accessed directly
23
+ class LAE_Odometers_Widget extends LAE_Widget_Base
24
+ {
25
+ public function get_name()
26
+ {
27
  return 'lae-odometers';
28
  }
29
+
30
+ public function get_title()
31
+ {
32
+ return __( 'Odometers', 'livemesh-el-addons' );
33
  }
34
+
35
+ public function get_icon()
36
+ {
37
  return 'eicon-counter';
38
  }
39
+
40
+ public function get_categories()
41
+ {
42
+ return array( 'livemesh-addons' );
43
  }
44
+
45
+ public function get_custom_help_url()
46
+ {
47
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/statistics-addons/';
48
  }
49
+
50
+ public function get_script_depends()
51
+ {
52
  return [
53
  'lae-waypoints',
54
  'jquery-stats',
56
  'lae-odometers-scripts'
57
  ];
58
  }
59
+
60
+ public function get_style_depends()
61
+ {
62
+ return [ 'lae-animate-styles', 'lae-frontend-styles', 'lae-odometers-styles' ];
 
 
 
63
  }
64
+
65
+ protected function _register_controls()
66
+ {
67
+ $this->start_controls_section( 'section_odometers', [
68
+ 'label' => __( 'Odometers', 'livemesh-el-addons' ),
69
+ ] );
 
 
 
 
70
  $repeater = new Repeater();
71
+ $repeater->add_control( 'stats_title', [
72
+ 'label' => __( 'Stats Title', 'livemesh-el-addons' ),
73
+ 'default' => __( 'My stats title', 'livemesh-el-addons' ),
74
+ 'type' => Controls_Manager::TEXT,
75
+ 'label_block' => true,
76
+ 'dynamic' => [
77
+ 'active' => true,
78
+ ],
79
+ ] );
80
+ $repeater->add_control( 'start_value', [
81
+ 'label' => __( 'Start Value', 'livemesh-el-addons' ),
82
+ 'type' => Controls_Manager::NUMBER,
83
+ 'default' => 0,
84
+ ] );
85
+ $repeater->add_control( 'stop_value', [
86
+ 'label' => __( 'Stop Value', 'livemesh-el-addons' ),
87
+ 'type' => Controls_Manager::NUMBER,
88
+ 'default' => 100,
89
+ ] );
90
+ $repeater->add_control( 'icon_type', [
91
+ 'label' => __( 'Choose Icon Type', 'livemesh-el-addons' ),
92
+ 'type' => Controls_Manager::SELECT,
93
+ 'default' => 'icon',
94
+ 'options' => [
95
+ 'icon' => __( 'Icon', 'livemesh-el-addons' ),
96
+ 'icon_image' => __( 'Icon Image', 'livemesh-el-addons' ),
97
+ ],
98
+ ] );
99
+ $repeater->add_control( 'icon_image', [
100
+ 'label' => __( 'Stats Image', 'livemesh-el-addons' ),
101
+ 'type' => Controls_Manager::MEDIA,
102
+ 'default' => [
103
+ 'url' => Utils::get_placeholder_image_src(),
104
+ ],
105
+ 'label_block' => true,
106
+ 'condition' => [
107
+ 'icon_type' => 'icon_image',
108
+ ],
109
+ 'dynamic' => [
110
+ 'active' => true,
111
+ ],
112
+ ] );
113
+ $repeater->add_control( 'selected_icon', [
114
+ 'label' => __( 'Stats Icon', 'livemesh-el-addons' ),
115
+ 'type' => Controls_Manager::ICONS,
116
+ 'label_block' => true,
117
+ 'condition' => [
118
+ 'icon_type' => 'icon',
119
+ ],
120
+ 'fa4compatibility' => 'icon',
121
+ ] );
122
+ $repeater->add_control( 'prefix', [
123
+ 'label' => __( 'Prefix', 'livemesh-el-addons' ),
124
+ 'type' => Controls_Manager::TEXT,
125
+ 'description' => __( 'The prefix string like currency symbols like $ to indicate a monetary value.', 'livemesh-el-addons' ),
126
+ 'dynamic' => [
127
+ 'active' => true,
128
+ 'categories' => [ TagsModule::POST_META_CATEGORY ],
129
+ ],
130
+ ] );
131
+ $repeater->add_control( 'suffix', [
132
+ 'label' => __( 'Suffix', 'livemesh-el-addons' ),
133
+ 'type' => Controls_Manager::TEXT,
134
+ 'description' => __( 'The suffix string like hr for hours or m for million.', 'livemesh-el-addons' ),
135
+ 'dynamic' => [
136
+ 'active' => true,
137
+ 'categories' => [ TagsModule::POST_META_CATEGORY ],
138
+ ],
139
+ ] );
140
+ $this->add_control( 'odometers', [
141
+ 'label' => __( 'Odometers', 'livemesh-el-addons' ),
142
+ 'type' => Controls_Manager::REPEATER,
143
+ 'default' => [
144
  [
145
+ 'stats_title' => __( 'No of Customers', 'livemesh-el-addons' ),
146
+ 'start_value' => 1000,
147
+ 'stop_value' => 65600,
148
+ 'prefix' => '',
149
+ 'suffix' => '',
150
+ ],
 
 
 
 
 
 
 
151
  [
152
+ 'stats_title' => __( 'Hours Worked', 'livemesh-el-addons' ),
153
+ 'start_value' => 1,
154
+ 'stop_value' => 34000,
155
+ 'prefix' => '',
156
+ 'suffix' => '',
157
+ ],
 
 
 
158
  [
159
+ 'stats_title' => __( 'Support Tickets', 'livemesh-el-addons' ),
160
+ 'start_value' => 1,
161
+ 'stop_value' => 348,
162
+ 'prefix' => '',
163
+ 'suffix' => 'k',
164
+ ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  [
166
+ 'stats_title' => __( 'Product Revenue', 'livemesh-el-addons' ),
167
+ 'start_value' => 1,
168
+ 'stop_value' => 35,
169
+ 'prefix' => '$',
170
+ 'suffix' => 'm',
171
+ ]
172
+ ],
173
+ 'fields' => $repeater->get_controls(),
174
+ 'title_field' => '{{{ stats_title }}}',
175
+ ] );
176
+ $this->add_control( 'upgrade_notice', [
177
+ 'type' => Controls_Manager::RAW_HTML,
178
+ 'separator' => 'before',
179
+ 'raw' => '<div style="text-align:center;line-height:1.6;"><p>' . __( 'Unlock new possibilities with premium widgets and styles of <strong>Livemesh Addons for Elementor <i>Premium</i></strong>. ', 'livemesh-el-addons' ) . '</p><p style="padding-top:15px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://livemeshelementor.com/pricing/#pricing-plans" target="_blank"><i class="fa fa-hand-o-right" aria-hidden="true"></i>' . __( 'Go Pro', 'livemesh-el-addons' ) . '</a></p></div>',
180
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  $this->end_controls_section();
182
+ $this->start_controls_section( 'section_grid_settings', [
183
+ 'label' => __( 'Grid Settings', 'livemesh-el-addons' ),
184
+ 'tab' => Controls_Manager::TAB_SETTINGS,
185
+ ] );
186
+ $this->add_control( 'column_layout', [
187
+ 'label' => __( 'Column Layout', 'livemesh-el-addons' ),
188
+ 'type' => Controls_Manager::SELECT,
189
+ 'options' => array(
190
+ 'auto' => __( 'Auto', 'livemesh-el-addons' ),
191
+ 'custom' => __( 'Custom', 'livemesh-el-addons' ),
192
+ ),
193
+ 'default' => 'auto',
194
+ 'description' => __( 'Set column layout to be <strong>Auto</strong> to let the widget auto calculate number of columns based on minimum column size specified. The option <strong>Custom</strong> lets you explicitly control number of columns based on screen width.', 'livemesh-el-addons' ),
195
+ ] );
196
+ $this->add_control( 'min_column_size', [
197
+ 'label' => __( 'Minimum Column Size', 'livemesh-el-addons' ),
198
+ 'type' => Controls_Manager::SLIDER,
199
+ 'size_units' => [ 'px' ],
200
+ 'default' => [
201
+ 'size' => 210,
202
+ ],
203
+ 'range' => [
204
+ 'px' => [
205
+ 'min' => 50,
206
+ 'max' => 500,
207
+ ],
208
+ ],
209
+ 'selectors' => [
210
+ '{{WRAPPER}} .lae-uber-grid-container.lae-grid-auto-column-layout' => 'grid-template-columns: repeat(auto-fit, minmax({{SIZE}}{{UNIT}}, 1fr));',
211
+ ],
212
+ 'condition' => [
213
+ 'column_layout' => 'auto',
214
+ ],
215
+ ] );
216
+ $this->add_responsive_control( 'per_line', [
217
+ 'label' => __( 'Odometers per row', 'livemesh-el-addons' ),
218
+ 'type' => Controls_Manager::SELECT,
219
+ 'default' => '4',
220
+ 'tablet_default' => '3',
221
+ 'mobile_default' => '1',
222
+ 'options' => [
223
+ '1' => '1',
224
+ '2' => '2',
225
+ '3' => '3',
226
+ '4' => '4',
227
+ '5' => '5',
228
+ '6' => '6',
229
+ ],
230
+ 'frontend_available' => true,
231
+ 'condition' => [
232
+ 'column_layout' => 'custom',
233
+ ],
234
+ ] );
235
+ $this->add_control( 'column_gap', [
236
+ 'label' => __( 'Column Gap', 'livemesh-el-addons' ),
237
+ 'type' => Controls_Manager::SLIDER,
238
+ 'size_units' => [ 'px' ],
239
+ 'default' => [
240
+ 'size' => 30,
241
+ ],
242
+ 'range' => [
243
+ 'px' => [
244
+ 'min' => 0,
245
+ 'max' => 100,
246
+ ],
247
+ ],
248
+ 'selectors' => [
249
+ '{{WRAPPER}} .lae-uber-grid-container' => 'column-gap: {{SIZE}}{{UNIT}};',
250
+ ],
251
+ ] );
252
+ $this->add_control( 'row_gap', [
253
+ 'label' => __( 'Row Gap', 'livemesh-el-addons' ),
254
+ 'type' => Controls_Manager::SLIDER,
255
+ 'size_units' => [ 'px' ],
256
+ 'default' => [
257
+ 'size' => 30,
258
+ ],
259
+ 'range' => [
260
+ 'px' => [
261
+ 'min' => 0,
262
+ 'max' => 100,
263
+ ],
264
+ ],
265
+ 'selectors' => [
266
+ '{{WRAPPER}} .lae-uber-grid-container' => 'row-gap: {{SIZE}}{{UNIT}};',
267
+ ],
268
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
  $this->end_controls_section();
270
+ $this->start_controls_section( 'section_stats_number', [
271
+ 'label' => __( 'Stats Number', 'livemesh-el-addons' ),
272
+ 'tab' => Controls_Manager::TAB_STYLE,
273
+ ] );
274
+ $this->add_control( 'stats_number_color', [
275
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
276
+ 'type' => Controls_Manager::COLOR,
277
+ 'selectors' => [
278
+ '{{WRAPPER}} .lae-odometers .lae-odometer .lae-number' => 'color: {{VALUE}};',
279
+ ],
280
+ ] );
281
+ $this->add_group_control( Group_Control_Typography::get_type(), [
282
+ 'name' => 'stats_number_typography',
283
+ 'selector' => '{{WRAPPER}} .lae-odometers .lae-odometer .lae-number span',
284
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
285
  $this->end_controls_section();
286
+ $this->start_controls_section( 'section_stats_prefix_suffix', [
287
+ 'label' => __( 'Stats Prefix and Suffix', 'livemesh-el-addons' ),
288
+ 'tab' => Controls_Manager::TAB_STYLE,
289
+ ] );
290
+ $this->add_control( 'stats_prefix_suffix_color', [
291
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
292
+ 'type' => Controls_Manager::COLOR,
293
+ 'selectors' => [
294
+ '{{WRAPPER}} .lae-odometers .lae-odometer .lae-prefix, .lae-odometers .lae-odometer .lae-suffix' => 'color: {{VALUE}};',
295
+ ],
296
+ ] );
297
+ $this->add_group_control( Group_Control_Typography::get_type(), [
298
+ 'name' => 'stats_prefix_suffix_typography',
299
+ 'selector' => '{{WRAPPER}} .lae-odometers .lae-odometer .lae-prefix, .lae-odometers .lae-odometer .lae-suffix',
300
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
301
  $this->end_controls_section();
302
+ $this->start_controls_section( 'section_styling', [
303
+ 'label' => __( 'Stats Title', 'livemesh-el-addons' ),
304
+ 'tab' => Controls_Manager::TAB_STYLE,
305
+ ] );
306
+ $this->add_control( 'stats_title_color', [
307
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
308
+ 'type' => Controls_Manager::COLOR,
309
+ 'default' => '',
310
+ 'selectors' => [
311
+ '{{WRAPPER}} .lae-odometers .lae-odometer .lae-stats-title' => 'color: {{VALUE}};',
312
+ ],
313
+ ] );
314
+ $this->add_group_control( Group_Control_Typography::get_type(), [
315
+ 'name' => 'stats_title_typography',
316
+ 'label' => __( 'Typography', 'livemesh-el-addons' ),
317
+ 'selector' => '{{WRAPPER}} .lae-odometers .lae-odometer .lae-stats-title',
318
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
319
  $this->end_controls_section();
320
+ $this->start_controls_section( 'section_icon_styling', [
321
+ 'label' => __( 'Icons', 'livemesh-el-addons' ),
322
+ 'tab' => Controls_Manager::TAB_STYLE,
323
+ ] );
324
+ $this->add_control( 'icon_size', [
325
+ 'label' => __( 'Icon or Icon Image size in pixels', 'livemesh-el-addons' ),
326
+ 'type' => Controls_Manager::SLIDER,
327
+ 'size_units' => [ 'px', '%', 'em' ],
328
+ 'range' => [
329
+ 'px' => [
330
+ 'min' => 6,
331
+ 'max' => 128,
332
+ ],
333
+ ],
334
+ 'selectors' => [
335
+ '{{WRAPPER}} .lae-odometers .lae-odometer .lae-image-wrapper img' => 'width: {{SIZE}}{{UNIT}};',
336
+ '{{WRAPPER}} .lae-odometers .lae-odometer .lae-icon-wrapper' => 'font-size: {{SIZE}}{{UNIT}};',
337
+ ],
338
+ ] );
339
+ $this->add_control( 'icon_color', [
340
+ 'label' => __( 'Icon Color', 'livemesh-el-addons' ),
341
+ 'type' => Controls_Manager::COLOR,
342
+ 'default' => '',
343
+ 'selectors' => [
344
+ '{{WRAPPER}} .lae-odometers .lae-odometer .lae-stats-title .lae-icon-wrapper' => 'color: {{VALUE}};',
345
+ ],
346
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
347
  }
348
+
349
+ protected function render()
350
+ {
351
  $settings = $this->get_settings_for_display();
352
+ $settings = apply_filters( 'lae_odometers_' . $this->get_id() . '_settings', $settings );
 
 
353
  $args['settings'] = $settings;
 
354
  $args['widget_instance'] = $this;
355
+ lae_get_template_part( 'addons/odometers/loop', $args );
 
 
356
  }
357
+
358
+ protected function content_template()
359
+ {
360
  }
361
 
362
  }
includes/widgets/piecharts.php CHANGED
@@ -6,44 +6,47 @@ Description: Display one or more piecharts depicting a percentage value in a mul
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
9
-
10
  namespace LivemeshAddons\Widgets;
11
 
12
- use Elementor\Repeater;
13
- use Elementor\Widget_Base;
14
- use Elementor\Controls_Manager;
15
-
16
- use Elementor\Scheme_Color;
17
- use Elementor\Group_Control_Typography;
18
- use Elementor\Scheme_Typography;
19
-
20
- if (!defined('ABSPATH'))
21
- exit; // Exit if accessed directly
22
-
23
-
24
- class LAE_Piecharts_Widget extends LAE_Widget_Base {
25
-
26
- public function get_name() {
27
  return 'lae-piecharts';
28
  }
29
-
30
- public function get_title() {
31
- return __('Piecharts', 'livemesh-el-addons');
 
32
  }
33
-
34
- public function get_icon() {
 
35
  return 'lae-icon-piechart3';
36
  }
37
-
38
- public function get_categories() {
39
- return array('livemesh-addons');
 
40
  }
41
-
42
- public function get_custom_help_url() {
 
43
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/statistics-addons/';
44
  }
45
-
46
- public function get_script_depends() {
 
47
  return [
48
  'lae-waypoints',
49
  'jquery-stats',
@@ -51,332 +54,228 @@ class LAE_Piecharts_Widget extends LAE_Widget_Base {
51
  'lae-piecharts-scripts'
52
  ];
53
  }
54
-
55
- public function get_style_depends() {
56
- return [
57
- 'lae-animate-styles',
58
- 'lae-frontend-styles',
59
- 'lae-piecharts-styles'
60
- ];
61
  }
62
-
63
- protected function _register_controls() {
64
-
65
- $this->start_controls_section(
66
- 'section_piecharts',
67
- [
68
- 'label' => __('Piecharts', 'livemesh-el-addons'),
69
- ]
70
- );
71
-
72
  $repeater = new Repeater();
73
-
74
-
75
- $repeater->add_control(
76
- 'stats_title',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  [
78
-
79
- 'label' => __('Stats Title', 'livemesh-el-addons'),
80
- 'type' => Controls_Manager::TEXT,
81
- 'default' => __('My stats title', 'livemesh-el-addons'),
82
- 'description' => __('The title for the piechart', 'livemesh-el-addons'),
83
- 'dynamic' => [
84
- 'active' => true,
85
- ],
86
- ]
87
- );
88
-
89
- $repeater->add_control(
90
- 'percentage_value',
91
- [
92
-
93
- 'label' => __('Percentage Value', 'livemesh-el-addons'),
94
- 'type' => Controls_Manager::NUMBER,
95
- 'min' => 1,
96
- 'max' => 100,
97
- 'step' => 1,
98
- 'default' => 30,
99
- 'description' => __('The percentage value for the stats.', 'livemesh-el-addons'),
100
- ]
101
- );
102
-
103
-
104
- $this->add_control(
105
- 'piecharts',
106
- [
107
- 'type' => Controls_Manager::REPEATER,
108
- 'default' => [
109
- [
110
- 'stats_title' => __('Web Design', 'livemesh-el-addons'),
111
- 'percentage_value' => 87,
112
- ],
113
- [
114
- 'stats_title' => __('SEO Services', 'livemesh-el-addons'),
115
- 'percentage_value' => 76,
116
- ],
117
- [
118
- 'stats_title' => __('WordPress Development', 'livemesh-el-addons'),
119
- 'percentage_value' => 90,
120
- ],
121
- [
122
- 'stats_title' => __('Brand Marketing', 'livemesh-el-addons'),
123
- 'percentage_value' => 40,
124
- ],
125
- ],
126
- 'fields' => $repeater->get_controls(),
127
- 'title_field' => '{{{ stats_title }}}',
128
- ]
129
- );
130
-
131
- $this->end_controls_section();
132
-
133
- $this->start_controls_section(
134
- 'section_grid_settings',
135
  [
136
- 'label' => __('Grid Settings', 'livemesh-el-addons'),
137
- 'tab' => Controls_Manager::TAB_SETTINGS,
138
- ]
139
- );
140
-
141
- $this->add_control(
142
- 'column_layout',
143
- [
144
- 'label' => __('Column Layout', 'livemesh-el-addons'),
145
- 'type' => Controls_Manager::SELECT,
146
- 'options' => array(
147
- 'auto' => __('Auto', 'livemesh-el-addons'),
148
- 'custom' => __('Custom', 'livemesh-el-addons'),
149
- ),
150
- 'default' => 'auto',
151
- 'description' => __('Set column layout to be <strong>Auto</strong> to let the widget auto calculate number of columns based on minimum column size specified. The option <strong>Custom</strong> lets you explicitly control number of columns based on screen width.', 'livemesh-el-addons'),
152
- ]
153
- );
154
-
155
- $this->add_control(
156
- 'min_column_size',
157
- [
158
- 'label' => __('Minimum Column Size', 'livemesh-el-addons'),
159
- 'type' => Controls_Manager::SLIDER,
160
- 'size_units' => ['px'],
161
- 'default' => [
162
- 'size' => 240,
163
- ],
164
- 'range' => [
165
- 'px' => [
166
- 'min' => 50,
167
- 'max' => 500,
168
- ],
169
- ],
170
- 'selectors' => [
171
- '{{WRAPPER}} .lae-uber-grid-container.lae-grid-auto-column-layout' => 'grid-template-columns: repeat(auto-fit, minmax({{SIZE}}{{UNIT}}, 1fr));',
172
- ],
173
- 'condition' => [
174
- 'column_layout' => 'auto'
175
- ]
176
- ]
177
- );
178
-
179
- $this->add_responsive_control(
180
- 'per_line',
181
  [
182
- 'label' => __('Piecharts per row', 'livemesh-el-addons'),
183
- 'type' => Controls_Manager::SELECT,
184
- 'default' => '4',
185
- 'tablet_default' => '2',
186
- 'mobile_default' => '1',
187
- 'options' => [
188
- '1' => '1',
189
- '2' => '2',
190
- '3' => '3',
191
- '4' => '4',
192
- '5' => '5',
193
- '6' => '6',
194
- ],
195
- 'frontend_available' => true,
196
- 'condition' => [
197
- 'column_layout' => 'custom'
198
- ]
199
- ]
200
- );
201
-
202
- $this->add_control(
203
- 'column_gap',
204
- [
205
- 'label' => __('Column Gap', 'livemesh-el-addons'),
206
- 'type' => Controls_Manager::SLIDER,
207
- 'size_units' => ['px'],
208
- 'default' => [
209
- 'size' => 30,
210
- ],
211
- 'range' => [
212
- 'px' => [
213
- 'min' => 0,
214
- 'max' => 100,
215
- ],
216
- ],
217
- 'selectors' => [
218
- '{{WRAPPER}} .lae-uber-grid-container' => 'column-gap: {{SIZE}}{{UNIT}};',
219
- ],
220
- ]
221
- );
222
-
223
- $this->add_control(
224
- 'row_gap',
225
  [
226
- 'label' => __('Row Gap', 'livemesh-el-addons'),
227
- 'type' => Controls_Manager::SLIDER,
228
- 'size_units' => ['px'],
229
- 'default' => [
230
- 'size' => 30,
231
- ],
232
- 'range' => [
233
- 'px' => [
234
- 'min' => 0,
235
- 'max' => 100,
236
- ],
237
- ],
238
- 'selectors' => [
239
- '{{WRAPPER}} .lae-uber-grid-container' => 'row-gap: {{SIZE}}{{UNIT}};',
240
- ],
241
- ]
242
- );
243
-
244
  $this->end_controls_section();
245
-
246
- $this->start_controls_section(
247
- 'section_styling',
248
- [
249
- 'label' => __('Piechart Styling', 'livemesh-el-addons'),
250
- 'tab' => Controls_Manager::TAB_STYLE,
251
- ]
252
- );
253
-
254
- $this->add_control(
255
- 'bar_color',
256
- [
257
- 'label' => __('Bar color', 'livemesh-el-addons'),
258
- 'type' => Controls_Manager::COLOR,
259
- 'default' => '#f94213',
260
- ]
261
- );
262
-
263
-
264
- $this->add_control(
265
- 'track_color',
266
- [
267
- 'label' => __('Track color', 'livemesh-el-addons'),
268
- 'type' => Controls_Manager::COLOR,
269
- 'default' => '#dddddd',
270
- ]
271
- );
272
-
273
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  $this->end_controls_section();
275
-
276
-
277
- $this->start_controls_section(
278
- 'section_stats_title',
279
- [
280
- 'label' => __('Stats Title', 'livemesh-el-addons'),
281
- 'tab' => Controls_Manager::TAB_STYLE,
282
- ]
283
- );
284
-
285
- $this->add_control(
286
- 'stats_title_color',
287
- [
288
- 'label' => __('Color', 'livemesh-el-addons'),
289
- 'type' => Controls_Manager::COLOR,
290
- 'selectors' => [
291
- '{{WRAPPER}} .lae-piechart .lae-label' => 'color: {{VALUE}};',
292
- ],
293
- ]
294
- );
295
-
296
- $this->add_group_control(
297
- Group_Control_Typography::get_type(),
298
- [
299
- 'name' => 'stats_title_typography',
300
- 'selector' => '{{WRAPPER}} .lae-piechart .lae-label',
301
- ]
302
- );
303
-
304
  $this->end_controls_section();
305
-
306
- $this->start_controls_section(
307
- 'section_stats_percentage',
308
- [
309
- 'label' => __('Stats Percentage', 'livemesh-el-addons'),
310
- 'tab' => Controls_Manager::TAB_STYLE,
311
- ]
312
- );
313
-
314
- $this->add_control(
315
- 'stats_percentage_color',
316
- [
317
- 'label' => __('Color', 'livemesh-el-addons'),
318
- 'type' => Controls_Manager::COLOR,
319
- 'selectors' => [
320
- '{{WRAPPER}} .lae-piechart .lae-percentage span' => 'color: {{VALUE}};',
321
- ],
322
- ]
323
- );
324
-
325
- $this->add_group_control(
326
- Group_Control_Typography::get_type(),
327
- [
328
- 'name' => 'stats_percentage_typography',
329
- 'selector' => '{{WRAPPER}} .lae-piechart .lae-percentage span',
330
- ]
331
- );
332
-
333
  $this->end_controls_section();
334
-
335
- $this->start_controls_section(
336
- 'section_stats_percentage_symbol',
337
- [
338
- 'label' => __('Stats Percentage Symbol', 'livemesh-el-addons'),
339
- 'tab' => Controls_Manager::TAB_STYLE,
340
- ]
341
- );
342
-
343
- $this->add_control(
344
- 'stats_percentage_symbol_color',
345
- [
346
- 'label' => __('Color', 'livemesh-el-addons'),
347
- 'type' => Controls_Manager::COLOR,
348
- 'selectors' => [
349
- '{{WRAPPER}} .lae-piechart .lae-percentage sup' => 'color: {{VALUE}};',
350
- ],
351
- ]
352
- );
353
-
354
- $this->add_group_control(
355
- Group_Control_Typography::get_type(),
356
- [
357
- 'name' => 'stats_percentage_symbol_typography',
358
- 'selector' => '{{WRAPPER}} .lae-piechart .lae-percentage sup',
359
- ]
360
- );
361
-
362
-
 
 
363
  }
364
-
365
- protected function render() {
366
-
367
  $settings = $this->get_settings_for_display();
368
-
369
- $settings = apply_filters('lae_piecharts_' . $this->get_id() . '_settings', $settings);
370
-
371
  $args['settings'] = $settings;
372
-
373
  $args['widget_instance'] = $this;
374
-
375
- lae_get_template_part('addons/piecharts/loop', $args);
376
-
377
  }
378
-
379
- protected function content_template() {
 
380
  }
381
 
382
  }
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
 
9
  namespace LivemeshAddons\Widgets;
10
 
11
+ use Elementor\Repeater ;
12
+ use Elementor\Widget_Base ;
13
+ use Elementor\Controls_Manager ;
14
+ use Elementor\Scheme_Color ;
15
+ use Elementor\Group_Control_Typography ;
16
+ use Elementor\Scheme_Typography ;
17
+ if ( !defined( 'ABSPATH' ) ) {
18
+ exit;
19
+ }
20
+ // Exit if accessed directly
21
+ class LAE_Piecharts_Widget extends LAE_Widget_Base
22
+ {
23
+ public function get_name()
24
+ {
 
25
  return 'lae-piecharts';
26
  }
27
+
28
+ public function get_title()
29
+ {
30
+ return __( 'Piecharts', 'livemesh-el-addons' );
31
  }
32
+
33
+ public function get_icon()
34
+ {
35
  return 'lae-icon-piechart3';
36
  }
37
+
38
+ public function get_categories()
39
+ {
40
+ return array( 'livemesh-addons' );
41
  }
42
+
43
+ public function get_custom_help_url()
44
+ {
45
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/statistics-addons/';
46
  }
47
+
48
+ public function get_script_depends()
49
+ {
50
  return [
51
  'lae-waypoints',
52
  'jquery-stats',
54
  'lae-piecharts-scripts'
55
  ];
56
  }
57
+
58
+ public function get_style_depends()
59
+ {
60
+ return [ 'lae-animate-styles', 'lae-frontend-styles', 'lae-piecharts-styles' ];
 
 
 
61
  }
62
+
63
+ protected function _register_controls()
64
+ {
65
+ $this->start_controls_section( 'section_piecharts', [
66
+ 'label' => __( 'Piecharts', 'livemesh-el-addons' ),
67
+ ] );
 
 
 
 
68
  $repeater = new Repeater();
69
+ $repeater->add_control( 'stats_title', [
70
+ 'label' => __( 'Stats Title', 'livemesh-el-addons' ),
71
+ 'type' => Controls_Manager::TEXT,
72
+ 'default' => __( 'My stats title', 'livemesh-el-addons' ),
73
+ 'description' => __( 'The title for the piechart', 'livemesh-el-addons' ),
74
+ 'dynamic' => [
75
+ 'active' => true,
76
+ ],
77
+ ] );
78
+ $repeater->add_control( 'percentage_value', [
79
+ 'label' => __( 'Percentage Value', 'livemesh-el-addons' ),
80
+ 'type' => Controls_Manager::NUMBER,
81
+ 'min' => 1,
82
+ 'max' => 100,
83
+ 'step' => 1,
84
+ 'default' => 30,
85
+ 'description' => __( 'The percentage value for the stats.', 'livemesh-el-addons' ),
86
+ ] );
87
+ $this->add_control( 'piecharts', [
88
+ 'type' => Controls_Manager::REPEATER,
89
+ 'default' => [
90
  [
91
+ 'stats_title' => __( 'Web Design', 'livemesh-el-addons' ),
92
+ 'percentage_value' => 87,
93
+ ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  [
95
+ 'stats_title' => __( 'SEO Services', 'livemesh-el-addons' ),
96
+ 'percentage_value' => 76,
97
+ ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  [
99
+ 'stats_title' => __( 'WordPress Development', 'livemesh-el-addons' ),
100
+ 'percentage_value' => 90,
101
+ ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  [
103
+ 'stats_title' => __( 'Brand Marketing', 'livemesh-el-addons' ),
104
+ 'percentage_value' => 40,
105
+ ]
106
+ ],
107
+ 'fields' => $repeater->get_controls(),
108
+ 'title_field' => '{{{ stats_title }}}',
109
+ ] );
110
+ $this->add_control( 'upgrade_notice', [
111
+ 'type' => Controls_Manager::RAW_HTML,
112
+ 'separator' => 'before',
113
+ 'raw' => '<div style="text-align:center;line-height:1.6;"><p>' . __( 'Unlock new possibilities with premium widgets and styles of <strong>Livemesh Addons for Elementor <i>Premium</i></strong>. ', 'livemesh-el-addons' ) . '</p><p style="padding-top:15px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://livemeshelementor.com/pricing/#pricing-plans" target="_blank"><i class="fa fa-hand-o-right" aria-hidden="true"></i>' . __( 'Go Pro', 'livemesh-el-addons' ) . '</a></p></div>',
114
+ ] );
 
 
 
 
 
 
115
  $this->end_controls_section();
116
+ $this->start_controls_section( 'section_grid_settings', [
117
+ 'label' => __( 'Grid Settings', 'livemesh-el-addons' ),
118
+ 'tab' => Controls_Manager::TAB_SETTINGS,
119
+ ] );
120
+ $this->add_control( 'column_layout', [
121
+ 'label' => __( 'Column Layout', 'livemesh-el-addons' ),
122
+ 'type' => Controls_Manager::SELECT,
123
+ 'options' => array(
124
+ 'auto' => __( 'Auto', 'livemesh-el-addons' ),
125
+ 'custom' => __( 'Custom', 'livemesh-el-addons' ),
126
+ ),
127
+ 'default' => 'auto',
128
+ 'description' => __( 'Set column layout to be <strong>Auto</strong> to let the widget auto calculate number of columns based on minimum column size specified. The option <strong>Custom</strong> lets you explicitly control number of columns based on screen width.', 'livemesh-el-addons' ),
129
+ ] );
130
+ $this->add_control( 'min_column_size', [
131
+ 'label' => __( 'Minimum Column Size', 'livemesh-el-addons' ),
132
+ 'type' => Controls_Manager::SLIDER,
133
+ 'size_units' => [ 'px' ],
134
+ 'default' => [
135
+ 'size' => 240,
136
+ ],
137
+ 'range' => [
138
+ 'px' => [
139
+ 'min' => 50,
140
+ 'max' => 500,
141
+ ],
142
+ ],
143
+ 'selectors' => [
144
+ '{{WRAPPER}} .lae-uber-grid-container.lae-grid-auto-column-layout' => 'grid-template-columns: repeat(auto-fit, minmax({{SIZE}}{{UNIT}}, 1fr));',
145
+ ],
146
+ 'condition' => [
147
+ 'column_layout' => 'auto',
148
+ ],
149
+ ] );
150
+ $this->add_responsive_control( 'per_line', [
151
+ 'label' => __( 'Piecharts per row', 'livemesh-el-addons' ),
152
+ 'type' => Controls_Manager::SELECT,
153
+ 'default' => '4',
154
+ 'tablet_default' => '2',
155
+ 'mobile_default' => '1',
156
+ 'options' => [
157
+ '1' => '1',
158
+ '2' => '2',
159
+ '3' => '3',
160
+ '4' => '4',
161
+ '5' => '5',
162
+ '6' => '6',
163
+ ],
164
+ 'frontend_available' => true,
165
+ 'condition' => [
166
+ 'column_layout' => 'custom',
167
+ ],
168
+ ] );
169
+ $this->add_control( 'column_gap', [
170
+ 'label' => __( 'Column Gap', 'livemesh-el-addons' ),
171
+ 'type' => Controls_Manager::SLIDER,
172
+ 'size_units' => [ 'px' ],
173
+ 'default' => [
174
+ 'size' => 30,
175
+ ],
176
+ 'range' => [
177
+ 'px' => [
178
+ 'min' => 0,
179
+ 'max' => 100,
180
+ ],
181
+ ],
182
+ 'selectors' => [
183
+ '{{WRAPPER}} .lae-uber-grid-container' => 'column-gap: {{SIZE}}{{UNIT}};',
184
+ ],
185
+ ] );
186
+ $this->add_control( 'row_gap', [
187
+ 'label' => __( 'Row Gap', 'livemesh-el-addons' ),
188
+ 'type' => Controls_Manager::SLIDER,
189
+ 'size_units' => [ 'px' ],
190
+ 'default' => [
191
+ 'size' => 30,
192
+ ],
193
+ 'range' => [
194
+ 'px' => [
195
+ 'min' => 0,
196
+ 'max' => 100,
197
+ ],
198
+ ],
199
+ 'selectors' => [
200
+ '{{WRAPPER}} .lae-uber-grid-container' => 'row-gap: {{SIZE}}{{UNIT}};',
201
+ ],
202
+ ] );
203
  $this->end_controls_section();
204
+ $this->start_controls_section( 'section_styling', [
205
+ 'label' => __( 'Piechart Styling', 'livemesh-el-addons' ),
206
+ 'tab' => Controls_Manager::TAB_STYLE,
207
+ ] );
208
+ $this->add_control( 'bar_color', [
209
+ 'label' => __( 'Bar color', 'livemesh-el-addons' ),
210
+ 'type' => Controls_Manager::COLOR,
211
+ 'default' => '#f94213',
212
+ ] );
213
+ $this->add_control( 'track_color', [
214
+ 'label' => __( 'Track color', 'livemesh-el-addons' ),
215
+ 'type' => Controls_Manager::COLOR,
216
+ 'default' => '#dddddd',
217
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
  $this->end_controls_section();
219
+ $this->start_controls_section( 'section_stats_title', [
220
+ 'label' => __( 'Stats Title', 'livemesh-el-addons' ),
221
+ 'tab' => Controls_Manager::TAB_STYLE,
222
+ ] );
223
+ $this->add_control( 'stats_title_color', [
224
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
225
+ 'type' => Controls_Manager::COLOR,
226
+ 'selectors' => [
227
+ '{{WRAPPER}} .lae-piechart .lae-label' => 'color: {{VALUE}};',
228
+ ],
229
+ ] );
230
+ $this->add_group_control( Group_Control_Typography::get_type(), [
231
+ 'name' => 'stats_title_typography',
232
+ 'selector' => '{{WRAPPER}} .lae-piechart .lae-label',
233
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  $this->end_controls_section();
235
+ $this->start_controls_section( 'section_stats_percentage', [
236
+ 'label' => __( 'Stats Percentage', 'livemesh-el-addons' ),
237
+ 'tab' => Controls_Manager::TAB_STYLE,
238
+ ] );
239
+ $this->add_control( 'stats_percentage_color', [
240
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
241
+ 'type' => Controls_Manager::COLOR,
242
+ 'selectors' => [
243
+ '{{WRAPPER}} .lae-piechart .lae-percentage span' => 'color: {{VALUE}};',
244
+ ],
245
+ ] );
246
+ $this->add_group_control( Group_Control_Typography::get_type(), [
247
+ 'name' => 'stats_percentage_typography',
248
+ 'selector' => '{{WRAPPER}} .lae-piechart .lae-percentage span',
249
+ ] );
250
+ $this->end_controls_section();
251
+ $this->start_controls_section( 'section_stats_percentage_symbol', [
252
+ 'label' => __( 'Stats Percentage Symbol', 'livemesh-el-addons' ),
253
+ 'tab' => Controls_Manager::TAB_STYLE,
254
+ ] );
255
+ $this->add_control( 'stats_percentage_symbol_color', [
256
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
257
+ 'type' => Controls_Manager::COLOR,
258
+ 'selectors' => [
259
+ '{{WRAPPER}} .lae-piechart .lae-percentage sup' => 'color: {{VALUE}};',
260
+ ],
261
+ ] );
262
+ $this->add_group_control( Group_Control_Typography::get_type(), [
263
+ 'name' => 'stats_percentage_symbol_typography',
264
+ 'selector' => '{{WRAPPER}} .lae-piechart .lae-percentage sup',
265
+ ] );
266
  }
267
+
268
+ protected function render()
269
+ {
270
  $settings = $this->get_settings_for_display();
271
+ $settings = apply_filters( 'lae_piecharts_' . $this->get_id() . '_settings', $settings );
 
 
272
  $args['settings'] = $settings;
 
273
  $args['widget_instance'] = $this;
274
+ lae_get_template_part( 'addons/piecharts/loop', $args );
 
 
275
  }
276
+
277
+ protected function content_template()
278
+ {
279
  }
280
 
281
  }
includes/widgets/portfolio.php CHANGED
@@ -6,42 +6,45 @@ Description: Display posts or custom post types in a multi-column grid.
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
9
-
10
  namespace LivemeshAddons\Widgets;
11
 
12
- use Elementor\Widget_Base;
13
- use Elementor\Controls_Manager;
14
- use Elementor\Group_Control_Image_Size;
15
- use Elementor\Group_Control_Typography;
16
-
17
-
18
- if (!defined('ABSPATH'))
19
- exit; // Exit if accessed directly
20
-
21
-
22
- class LAE_Portfolio_Widget extends LAE_Widget_Base {
23
-
24
- public function get_name() {
25
  return 'lae-portfolio';
26
  }
27
-
28
- public function get_title() {
29
- return __('Posts Grid', 'livemesh-el-addons');
 
30
  }
31
-
32
- public function get_icon() {
 
33
  return 'lae-icon-posts-grid-masonry';
34
  }
35
-
36
- public function get_categories() {
37
- return array('livemesh-addons');
 
38
  }
39
-
40
- public function get_custom_help_url() {
 
41
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/posts-portfolio-grid/';
42
  }
43
-
44
- public function get_script_depends() {
 
45
  return [
46
  'isotope.pkgd',
47
  'imagesloaded.pkgd',
@@ -49,1363 +52,969 @@ class LAE_Portfolio_Widget extends LAE_Widget_Base {
49
  'lae-portfolio-scripts'
50
  ];
51
  }
52
-
53
- public function get_style_depends() {
54
- return [
55
- 'lae-frontend-styles',
56
- 'lae-grid-styles',
57
- 'lae-portfolio-styles'
58
- ];
59
  }
60
-
61
- protected function _register_controls() {
62
-
63
- $this->start_controls_section(
64
- 'section_query',
65
- [
66
- 'label' => __('Post Query', 'livemesh-el-addons'),
67
- ]
68
- );
69
-
70
- $this->add_control(
71
- 'query_type',
72
- [
73
- 'label' => __('Source', 'livemesh-el-addons'),
74
- 'type' => Controls_Manager::SELECT,
75
- 'options' => array(
76
- 'custom_query' => __('Custom Query', 'livemesh-el-addons'),
77
- 'current_query' => __('Current Query', 'livemesh-el-addons'),
78
- 'related' => __('Related', 'livemesh-el-addons'),
79
- ),
80
- 'default' => 'custom_query',
81
- ]
82
- );
83
-
84
- $this->add_control(
85
- 'post_types',
86
- [
87
- 'label' => __('Post Types', 'livemesh-el-addons'),
88
- 'type' => Controls_Manager::SELECT2,
89
- 'default' => 'post',
90
- 'options' => lae_get_all_post_type_options(),
91
- 'multiple' => true,
92
- 'condition' => [
93
- 'query_type' => 'custom_query'
94
- ]
95
- ]
96
- );
97
-
98
- $this->add_control(
99
- 'taxonomies',
100
- [
101
- 'type' => Controls_Manager::SELECT2,
102
- 'label' => __('Choose the taxonomies to display related posts.', 'livemesh-el-addons'),
103
- 'label_block' => true,
104
- 'description' => __('Choose the taxonomies to be used for displaying posts related to current post, page or custom post type.', 'livemesh-el-addons'),
105
- 'options' => lae_get_taxonomies_map(),
106
- 'default' => 'category',
107
- 'multiple' => true,
108
- 'condition' => [
109
- 'query_type' => 'related'
110
- ]
111
- ]
112
- );
113
-
114
- $this->add_control(
115
- 'tax_query',
116
- [
117
- 'label' => __('Taxonomies', 'livemesh-el-addons'),
118
- 'type' => Controls_Manager::SELECT2,
119
- 'options' => lae_get_all_taxonomy_options(),
120
- 'multiple' => true,
121
- 'label_block' => true,
122
- 'condition' => [
123
- 'query_type' => 'custom_query'
124
- ]
125
- ]
126
- );
127
-
128
- $this->add_control(
129
- 'post_in',
130
- [
131
- 'label' => __('Post In', 'livemesh-el-addons'),
132
- 'description' => __('Provide a comma separated list of Post IDs to display in the grid.', 'livemesh-el-addons'),
133
- 'type' => Controls_Manager::TEXT,
134
- 'label_block' => true,
135
- 'condition' => [
136
- 'query_type' => 'custom_query'
137
- ]
138
- ]
139
- );
140
-
141
- $this->add_control(
142
- 'posts_per_page',
143
- [
144
- 'label' => __('Posts Per Page', 'livemesh-el-addons'),
145
- 'type' => Controls_Manager::NUMBER,
146
- 'min' => 1,
147
- 'max' => 50,
148
- 'step' => 1,
149
- 'default' => 6,
150
- 'condition' => [
151
- 'query_type' => ['custom_query', 'related']
152
- ]
153
- ]
154
- );
155
-
156
- $this->add_control(
157
- 'advanced',
158
- [
159
- 'label' => __('Advanced', 'livemesh-el-addons'),
160
- 'type' => Controls_Manager::HEADING,
161
- 'condition' => [
162
- 'query_type' => ['custom_query', 'related']
163
- ]
164
- ]
165
- );
166
-
167
- $this->add_control(
168
- 'orderby',
169
- [
170
- 'label' => __('Order By', 'livemesh-el-addons'),
171
- 'type' => Controls_Manager::SELECT,
172
- 'options' => array(
173
- 'none' => __('No order', 'livemesh-el-addons'),
174
- 'ID' => __('Post ID', 'livemesh-el-addons'),
175
- 'author' => __('Author', 'livemesh-el-addons'),
176
- 'title' => __('Title', 'livemesh-el-addons'),
177
- 'date' => __('Published date', 'livemesh-el-addons'),
178
- 'modified' => __('Modified date', 'livemesh-el-addons'),
179
- 'parent' => __('By parent', 'livemesh-el-addons'),
180
- 'rand' => __('Random order', 'livemesh-el-addons'),
181
- 'comment_count' => __('Comment count', 'livemesh-el-addons'),
182
- 'menu_order' => __('Menu order', 'livemesh-el-addons'),
183
- 'post__in' => __('By include order', 'livemesh-el-addons'),
184
- ),
185
- 'default' => 'date',
186
- 'condition' => [
187
- 'query_type' => ['custom_query', 'related']
188
- ]
189
- ]
190
- );
191
-
192
- $this->add_control(
193
- 'order',
194
- [
195
- 'label' => __('Order', 'livemesh-el-addons'),
196
- 'type' => Controls_Manager::SELECT,
197
- 'options' => array(
198
- 'ASC' => __('Ascending', 'livemesh-el-addons'),
199
- 'DESC' => __('Descending', 'livemesh-el-addons'),
200
- ),
201
- 'default' => 'DESC',
202
- 'condition' => [
203
- 'query_type' => ['custom_query', 'related']
204
- ]
205
- ]
206
- );
207
-
208
-
209
- $this->add_control(
210
- 'offset',
211
- [
212
- 'label' => __('Offset', 'livemesh-el-addons'),
213
- 'description' => __('Number of posts to skip or pass over.', 'livemesh-el-addons'),
214
- 'type' => Controls_Manager::NUMBER,
215
- 'default' => 0,
216
- 'condition' => [
217
- 'query_type' => 'custom_query'
218
- ]
219
- ]
220
- );
221
-
222
  $this->end_controls_section();
223
-
224
- $this->start_controls_section(
225
- 'section_grid_skin',
226
- [
227
- 'label' => __('Grid Skin', 'livemesh-el-addons'),
228
- ]
229
- );
230
-
231
- $this->add_control(
232
- 'grid_skin',
233
- [
234
- 'label' => __('Choose Grid Skin', 'livemesh-el-addons'),
235
- 'description' => __('The "Classic Skin" is the built-in styling provided for the grid items. Choose "Custom Skin" if you want to use theme builder template for the grid item. The option "Custom Grid" is the most flexible one that lets you use a theme builder template for the grid layout with choice of custom template for one or more of its items.', 'livemesh-el-addons'),
236
- 'type' => Controls_Manager::SELECT,
237
- 'options' => array(
238
- 'classic_skin' => __('Classic Skin', 'livemesh-el-addons'),
239
- 'custom_skin' => __('Custom Skin', 'livemesh-el-addons'),
240
- 'custom_grid' => __('Custom Grid', 'livemesh-el-addons'),
241
- ),
242
- 'default' => 'classic_skin',
243
- ]
244
- );
245
-
246
- $this->add_control(
247
- 'item_template',
248
- [
249
- 'label' => __('Select the custom skin template for the grid item', 'livemesh-el-addons'),
250
- 'description' => '<div style="text-align:center;font-style: normal;">'
251
- . '<a target="_blank" class="elementor-button elementor-button-default" href="'
252
- . esc_url(admin_url('/edit.php?post_type=elementor_library&tabs_group=theme&elementor_library_type=livemesh_item'))
253
- . '">'
254
- . __('Create/Edit the Item Skin Builder Templates', 'livemesh-el-addons')
255
- . '</a>'
256
- . '</div>',
257
- 'type' => Controls_Manager::SELECT,
258
- 'label_block' => true,
259
- 'default' => [],
260
- 'options' => $this->get_item_template_options(),
261
- 'condition' => [
262
- 'grid_skin' => 'custom_skin'
263
- ],
264
- ]
265
- );
266
-
267
- $this->add_control(
268
- 'grid_template',
269
- [
270
- 'label' => __('Select the custom grid template for the grid item', 'livemesh-el-addons'),
271
- 'description' => '<div style="text-align:center;font-style: normal;">'
272
- . '<a target="_blank" class="elementor-button elementor-button-default" href="'
273
- . esc_url(admin_url('/edit.php?post_type=elementor_library&tabs_group=theme&elementor_library_type=livemesh_grid'))
274
- . '">'
275
- . __('Create/Edit the Grid Builder Templates', 'livemesh-el-addons')
276
- . '</a>'
277
- . '</div>',
278
- 'type' => Controls_Manager::SELECT,
279
- 'label_block' => true,
280
- 'default' => [],
281
- 'options' => $this->get_grid_template_options(),
282
- 'condition' => [
283
- 'grid_skin' => 'custom_grid'
284
- ],
285
- ]
286
- );
287
-
288
  $this->end_controls_section();
289
-
290
- $this->start_controls_section(
291
- 'section_post_content',
292
- [
293
- 'label' => __('Post Content', 'livemesh-el-addons'),
294
- 'condition' => [
295
- 'grid_skin' => 'classic_skin'
296
- ],
297
- ]
298
- );
299
-
300
- $this->add_group_control(
301
- Group_Control_Image_Size::get_type(),
302
- [
303
- 'name' => 'thumbnail_size',
304
- 'label' => __('Image Size', 'livemesh-el-addons'),
305
- 'default' => 'large',
306
- ]
307
- );
308
-
309
- $this->add_control(
310
- 'image_linkable',
311
- [
312
- 'label' => __('Link Images to Posts?', 'livemesh-el-addons'),
313
- 'type' => Controls_Manager::SWITCHER,
314
- 'label_on' => __('Yes', 'livemesh-el-addons'),
315
- 'label_off' => __('No', 'livemesh-el-addons'),
316
- 'return_value' => 'yes',
317
- 'default' => 'yes',
318
- ]
319
- );
320
-
321
- $this->add_control(
322
- 'post_link_new_window',
323
- [
324
- 'label' => __('Open post links in new window?', 'livemesh-el-addons'),
325
- 'type' => Controls_Manager::SWITCHER,
326
- 'label_on' => __('Yes', 'livemesh-el-addons'),
327
- 'label_off' => __('No', 'livemesh-el-addons'),
328
- 'return_value' => 'yes',
329
- 'default' => '',
330
- ]
331
- );
332
-
333
- $this->add_control(
334
- 'display_title_on_thumbnail',
335
- [
336
- 'label' => __('Display posts title on the post/portfolio thumbnail?', 'livemesh-el-addons'),
337
- 'type' => Controls_Manager::SWITCHER,
338
- 'label_on' => __('Yes', 'livemesh-el-addons'),
339
- 'label_off' => __('No', 'livemesh-el-addons'),
340
- 'return_value' => 'yes',
341
- 'default' => 'yes',
342
- ]
343
- );
344
-
345
- $this->add_control(
346
- 'display_taxonomy_on_thumbnail',
347
- [
348
- 'label' => __('Display taxonomy info on post/project thumbnail?', 'livemesh-el-addons'),
349
- 'type' => Controls_Manager::SWITCHER,
350
- 'label_on' => __('Yes', 'livemesh-el-addons'),
351
- 'label_off' => __('No', 'livemesh-el-addons'),
352
- 'return_value' => 'yes',
353
- 'default' => 'yes',
354
- ]
355
- );
356
-
357
- $this->add_control(
358
- 'display_title',
359
- [
360
- 'label' => __('Display posts title for the post/portfolio item?', 'livemesh-el-addons'),
361
- 'type' => Controls_Manager::SWITCHER,
362
- 'label_on' => __('Yes', 'livemesh-el-addons'),
363
- 'label_off' => __('No', 'livemesh-el-addons'),
364
- 'return_value' => 'yes',
365
- 'default' => 'yes',
366
- ]
367
- );
368
-
369
- $this->add_control(
370
- 'display_summary',
371
- [
372
- 'label' => __('Display post excerpt/summary for the post/portfolio item?', 'livemesh-el-addons'),
373
- 'type' => Controls_Manager::SWITCHER,
374
- 'label_on' => __('Yes', 'livemesh-el-addons'),
375
- 'label_off' => __('No', 'livemesh-el-addons'),
376
- 'return_value' => 'yes',
377
- 'default' => 'yes',
378
- ]
379
- );
380
-
381
-
382
- $this->add_control(
383
- 'display_author',
384
- [
385
- 'label' => __('Display post author info for the post/portfolio item?', 'livemesh-el-addons'),
386
- 'type' => Controls_Manager::SWITCHER,
387
- 'label_on' => __('Yes', 'livemesh-el-addons'),
388
- 'label_off' => __('No', 'livemesh-el-addons'),
389
- 'return_value' => 'yes',
390
- 'default' => 'yes',
391
- ]
392
- );
393
-
394
-
395
- $this->add_control(
396
- 'display_post_date',
397
- [
398
- 'label' => __('Display post date info for the post item?', 'livemesh-el-addons'),
399
- 'type' => Controls_Manager::SWITCHER,
400
- 'label_on' => __('Yes', 'livemesh-el-addons'),
401
- 'label_off' => __('No', 'livemesh-el-addons'),
402
- 'return_value' => 'yes',
403
- 'default' => 'yes',
404
- ]
405
- );
406
-
407
-
408
- $this->add_control(
409
- 'display_taxonomy',
410
- [
411
- 'label' => __('Display taxonomy info for the post item?', 'livemesh-el-addons'),
412
- 'type' => Controls_Manager::SWITCHER,
413
- 'label_on' => __('Yes', 'livemesh-el-addons'),
414
- 'label_off' => __('No', 'livemesh-el-addons'),
415
- 'return_value' => 'yes',
416
- 'default' => 'yes',
417
- ]
418
- );
419
-
420
- $this->add_control(
421
- 'display_read_more',
422
- [
423
- 'label' => __('Display read more link to the post/portfolio?', 'livemesh-el-addons'),
424
- 'type' => Controls_Manager::SWITCHER,
425
- 'label_on' => __('Yes', 'livemesh-el-addons'),
426
- 'label_off' => __('No', 'livemesh-el-addons'),
427
- 'return_value' => 'yes',
428
- 'default' => 'no',
429
- ]
430
- );
431
-
432
- $this->add_control(
433
- 'read_more_text',
434
- [
435
- 'label' => __('Read more text', 'livemesh-el-addons'),
436
- 'type' => Controls_Manager::TEXT,
437
- "description" => __('Specify the text for the read more link/button', 'livemesh-el-addons'),
438
- 'default' => __('Read More', 'livemesh-el-addons'),
439
- 'condition' => [
440
- 'display_read_more' => ['yes']
441
- ],
442
- ]
443
- );
444
-
445
  $this->end_controls_section();
446
-
447
- $this->start_controls_section(
448
- 'section_general_settings',
449
- [
450
- 'label' => __('General', 'livemesh-el-addons'),
451
- 'tab' => Controls_Manager::TAB_SETTINGS,
452
- ]
453
- );
454
-
455
- $this->add_control(
456
- 'heading',
457
- [
458
- 'label' => __('Heading for the grid', 'livemesh-el-addons'),
459
- 'type' => Controls_Manager::TEXT,
460
- 'placeholder' => __('My Posts', 'livemesh-el-addons'),
461
- 'default' => __('My Posts', 'livemesh-el-addons'),
462
- 'dynamic' => [
463
- 'active' => true,
464
- ],
465
- ]
466
- );
467
-
468
- $this->add_control(
469
- 'filterable',
470
- [
471
- 'label' => __('Filterable?', 'livemesh-el-addons'),
472
- 'type' => Controls_Manager::SWITCHER,
473
- 'label_on' => __('Yes', 'livemesh-el-addons'),
474
- 'label_off' => __('No', 'livemesh-el-addons'),
475
- 'return_value' => 'yes',
476
- 'default' => 'yes',
477
- 'condition' => [
478
- 'grid_skin' => ['classic_skin', 'custom_skin']
479
- ]
480
- ]
481
- );
482
-
483
- $this->add_control(
484
- 'taxonomy_filter',
485
- [
486
- 'type' => Controls_Manager::SELECT,
487
- 'label' => __('Choose the taxonomy to display and filter on.', 'livemesh-el-addons'),
488
- 'label_block' => true,
489
- 'description' => __('Choose the taxonomy information to display for posts/portfolio and the taxonomy that is used to filter the portfolio/post. Takes effect only if no taxonomy filters are specified when building query.', 'livemesh-el-addons'),
490
- 'options' => lae_get_taxonomies_map(),
491
- 'default' => 'category',
492
- ]
493
- );
494
-
495
- $this->add_responsive_control(
496
- 'per_line',
497
- [
498
- 'label' => __('Columns per row', 'livemesh-el-addons'),
499
- 'type' => Controls_Manager::SELECT,
500
- 'default' => '3',
501
- 'tablet_default' => '2',
502
- 'mobile_default' => '1',
503
- 'options' => [
504
- '1' => '1',
505
- '2' => '2',
506
- '3' => '3',
507
- '4' => '4',
508
- '5' => '5',
509
- '6' => '6',
510
- ],
511
- 'frontend_available' => true,
512
- ]
513
- );
514
-
515
- $this->add_control(
516
- 'layout_mode',
517
- [
518
- 'type' => Controls_Manager::SELECT,
519
- 'label' => __('Choose a layout for the grid', 'livemesh-el-addons'),
520
- 'options' => array(
521
- 'fitRows' => __('Fit Rows', 'livemesh-el-addons'),
522
- 'masonry' => __('Masonry', 'livemesh-el-addons'),
523
- ),
524
- 'default' => 'fitRows',
525
- ]
526
- );
527
-
528
  $this->end_controls_section();
529
-
530
- $this->start_controls_section(
531
- 'section_responsive',
532
- [
533
- 'label' => __('Gutter Options', 'livemesh-el-addons'),
534
- 'tab' => Controls_Manager::TAB_SETTINGS,
535
- ]
536
- );
537
-
538
- $this->add_control(
539
- 'heading_desktop',
540
- [
541
- 'label' => __('Desktop', 'livemesh-el-addons'),
542
- 'type' => Controls_Manager::HEADING,
543
- 'separator' => 'after',
544
- ]
545
- );
546
-
547
- $this->add_control(
548
- 'gutter',
549
- [
550
- 'label' => __('Gutter', 'livemesh-el-addons'),
551
- 'description' => __('Space between columns in the grid.', 'livemesh-el-addons'),
552
- 'type' => Controls_Manager::NUMBER,
553
- 'default' => 20,
554
- 'selectors' => [
555
- '{{WRAPPER}} .lae-portfolio' => 'margin-left: -{{VALUE}}px; margin-right: -{{VALUE}}px;',
556
- '{{WRAPPER}} .lae-portfolio .lae-portfolio-item' => 'padding: {{VALUE}}px;',
557
- ],
558
- ]
559
- );
560
-
561
- $this->add_control(
562
- 'heading_tablet',
563
- [
564
- 'label' => __('Tablet', 'livemesh-el-addons'),
565
- 'type' => Controls_Manager::HEADING,
566
- 'separator' => 'after',
567
- ]
568
- );
569
-
570
- $this->add_control(
571
- 'tablet_gutter',
572
- [
573
- 'label' => __('Gutter', 'livemesh-el-addons'),
574
- 'description' => __('Space between columns.', 'livemesh-el-addons'),
575
- 'type' => Controls_Manager::NUMBER,
576
- 'default' => 10,
577
- 'selectors' => [
578
- '(tablet-){{WRAPPER}} .lae-portfolio' => 'margin-left: -{{VALUE}}px; margin-right: -{{VALUE}}px;',
579
- '(tablet-){{WRAPPER}} .lae-portfolio .lae-portfolio-item' => 'padding: {{VALUE}}px;',
580
- ],
581
- ]
582
- );
583
-
584
-
585
- $this->add_control(
586
- 'heading_mobile',
587
- [
588
- 'label' => __('Mobile Phone', 'livemesh-el-addons'),
589
- 'type' => Controls_Manager::HEADING,
590
- 'separator' => 'after',
591
- ]
592
- );
593
-
594
- $this->add_control(
595
- 'mobile_gutter',
596
- [
597
- 'label' => __('Gutter', 'livemesh-el-addons'),
598
- 'description' => __('Space between columns.', 'livemesh-el-addons'),
599
- 'type' => Controls_Manager::NUMBER,
600
- 'default' => 10,
601
- 'selectors' => [
602
- '(mobile-){{WRAPPER}} .lae-portfolio' => 'margin-left: -{{VALUE}}px; margin-right: -{{VALUE}}px;',
603
- '(mobile-){{WRAPPER}} .lae-portfolio .lae-portfolio-item' => 'padding: {{VALUE}}px;',
604
- ],
605
- ]
606
- );
607
-
608
-
609
  $this->end_controls_section();
610
-
611
- $this->start_controls_section(
612
- 'section_heading_styling',
613
- [
614
- 'label' => __('Grid Heading', 'livemesh-el-addons'),
615
- 'tab' => Controls_Manager::TAB_STYLE,
616
- ]
617
- );
618
-
619
- $this->add_control(
620
- 'heading_tag',
621
- [
622
- 'label' => __('Heading HTML Tag', 'livemesh-el-addons'),
623
- 'type' => Controls_Manager::SELECT,
624
- 'options' => [
625
- 'h1' => __('H1', 'livemesh-el-addons'),
626
- 'h2' => __('H2', 'livemesh-el-addons'),
627
- 'h3' => __('H3', 'livemesh-el-addons'),
628
- 'h4' => __('H4', 'livemesh-el-addons'),
629
- 'h5' => __('H5', 'livemesh-el-addons'),
630
- 'h6' => __('H6', 'livemesh-el-addons'),
631
- 'div' => __('div', 'livemesh-el-addons'),
632
- ],
633
- 'default' => 'h3',
634
- ]
635
- );
636
-
637
- $this->add_control(
638
- 'heading_color',
639
- [
640
- 'label' => __('Heading Color', 'livemesh-el-addons'),
641
- 'type' => Controls_Manager::COLOR,
642
- 'selectors' => [
643
- '{{WRAPPER}} .lae-portfolio-wrap .lae-heading' => 'color: {{VALUE}};',
644
- ],
645
- ]
646
- );
647
-
648
- $this->add_group_control(
649
- Group_Control_Typography::get_type(),
650
- [
651
- 'name' => 'heading_typography',
652
- 'selector' => '{{WRAPPER}} .lae-portfolio-wrap .lae-heading',
653
- ]
654
- );
655
-
656
  $this->end_controls_section();
657
-
658
- $this->start_controls_section(
659
- 'section_filters_styling',
660
- [
661
- 'label' => __('Grid Filters', 'livemesh-el-addons'),
662
- 'tab' => Controls_Manager::TAB_STYLE,
663
- ]
664
- );
665
-
666
- $this->add_control(
667
- 'filter_color',
668
- [
669
- 'label' => __('Filter Color', 'livemesh-el-addons'),
670
- 'type' => Controls_Manager::COLOR,
671
- 'selectors' => [
672
- '{{WRAPPER}} .lae-portfolio-wrap .lae-taxonomy-filter .lae-filter-item a' => 'color: {{VALUE}};',
673
- ],
674
- ]
675
- );
676
-
677
- $this->add_control(
678
- 'filter_hover_color',
679
- [
680
- 'label' => __('Filter Hover Color', 'livemesh-el-addons'),
681
- 'type' => Controls_Manager::COLOR,
682
- 'selectors' => [
683
- '{{WRAPPER}} .lae-portfolio-wrap .lae-taxonomy-filter .lae-filter-item a:hover, {{WRAPPER}} .lae-portfolio-wrap .lae-taxonomy-filter .lae-filter-item.lae-active a' => 'color: {{VALUE}};',
684
- ],
685
- ]
686
- );
687
-
688
- $this->add_control(
689
- 'filter_active_border',
690
- [
691
- 'label' => __('Active Filter Border Color', 'livemesh-el-addons'),
692
- 'type' => Controls_Manager::COLOR,
693
- 'selectors' => [
694
- '{{WRAPPER}} .lae-portfolio-wrap .lae-taxonomy-filter .lae-filter-item.lae-active:after ' => 'border-color: {{VALUE}};',
695
- ],
696
- ]
697
- );
698
-
699
- $this->add_group_control(
700
- Group_Control_Typography::get_type(),
701
- [
702
- 'name' => 'filter_typography',
703
- 'selector' => '{{WRAPPER}} .lae-portfolio-wrap .lae-taxonomy-filter .lae-filter-item a',
704
- ]
705
- );
706
-
707
  $this->end_controls_section();
708
-
709
- $this->start_controls_section(
710
- 'section_grid_thumbnail_styling',
711
- [
712
- 'label' => __('Grid Thumbnail', 'livemesh-el-addons'),
713
- 'tab' => Controls_Manager::TAB_STYLE,
714
- 'condition' => [
715
- 'grid_skin' => 'classic_skin'
716
- ],
717
- ]
718
- );
719
-
720
- $this->add_control(
721
- 'heading_thumbnail_info',
722
- [
723
- 'label' => __('Thumbnail Info Entry Title', 'livemesh-el-addons'),
724
- 'type' => Controls_Manager::HEADING,
725
- 'separator' => 'after',
726
- ]
727
- );
728
-
729
- $this->add_control(
730
- 'title_tag',
731
- [
732
- 'label' => __('Title HTML Tag', 'livemesh-el-addons'),
733
- 'type' => Controls_Manager::SELECT,
734
- 'options' => [
735
- 'h1' => __('H1', 'livemesh-el-addons'),
736
- 'h2' => __('H2', 'livemesh-el-addons'),
737
- 'h3' => __('H3', 'livemesh-el-addons'),
738
- 'h4' => __('H4', 'livemesh-el-addons'),
739
- 'h5' => __('H5', 'livemesh-el-addons'),
740
- 'h6' => __('H6', 'livemesh-el-addons'),
741
- 'div' => __('div', 'livemesh-el-addons'),
742
- ],
743
- 'default' => 'h3',
744
- ]
745
- );
746
-
747
- $this->add_control(
748
- 'title_color',
749
- [
750
- 'label' => __('Title Color', 'livemesh-el-addons'),
751
- 'type' => Controls_Manager::COLOR,
752
- 'selectors' => [
753
- '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-project-image .lae-image-info .lae-post-title a' => 'color: {{VALUE}};',
754
- ],
755
- ]
756
- );
757
-
758
- $this->add_control(
759
- 'title_hover_border_color',
760
- [
761
- 'label' => __('Title Hover Border Color', 'livemesh-el-addons'),
762
- 'type' => Controls_Manager::COLOR,
763
- 'selectors' => [
764
- '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-project-image .lae-image-info .lae-post-title a:hover' => 'border-color: {{VALUE}};',
765
- ],
766
- ]
767
- );
768
-
769
- $this->add_group_control(
770
- Group_Control_Typography::get_type(),
771
- [
772
- 'name' => 'title_typography',
773
- 'selector' => '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-project-image .lae-image-info .lae-post-title',
774
- ]
775
- );
776
-
777
- $this->add_control(
778
- 'heading_thumbnail_info_taxonomy',
779
- [
780
- 'label' => __('Thumbnail Info Taxonomy Terms', 'livemesh-el-addons'),
781
- 'type' => Controls_Manager::HEADING,
782
- 'separator' => 'after',
783
- ]
784
- );
785
-
786
- $this->add_control(
787
- 'thumbnail_info_tags_color',
788
- [
789
- 'label' => __('Taxonomy Terms Color', 'livemesh-el-addons'),
790
- 'type' => Controls_Manager::COLOR,
791
- 'selectors' => [
792
- '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-project-image .lae-image-info .lae-terms, {{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-project-image .lae-image-info .lae-terms a' => 'color: {{VALUE}};',
793
- ],
794
- ]
795
- );
796
-
797
- $this->add_control(
798
- 'thumbnail_info_tags_hover_color',
799
- [
800
- 'label' => __('Taxonomy Terms Hover Color', 'livemesh-el-addons'),
801
- 'type' => Controls_Manager::COLOR,
802
- 'selectors' => [
803
- '{{WRAPPER}} .lae-block-grid .lae-module .lae-module-image .lae-terms a:hover' => 'color: {{VALUE}};',
804
- ],
805
- ]
806
- );
807
-
808
- $this->add_group_control(
809
- Group_Control_Typography::get_type(),
810
- [
811
- 'name' => 'tags_typography',
812
- 'selector' => '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-project-image .lae-image-info .lae-terms:hover, {{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-project-image .lae-image-info .lae-terms a:hover',
813
- ]
814
- );
815
-
816
  $this->end_controls_section();
817
-
818
- $this->start_controls_section(
819
- 'section_entry_title_styling',
820
- [
821
- 'label' => __('Grid Item Entry Title', 'livemesh-el-addons'),
822
- 'tab' => Controls_Manager::TAB_STYLE,
823
- 'condition' => [
824
- 'grid_skin' => 'classic_skin'
825
- ],
826
- ]
827
- );
828
-
829
- $this->add_control(
830
- 'entry_title_tag',
831
- [
832
- 'label' => __('Entry Title HTML Tag', 'livemesh-el-addons'),
833
- 'type' => Controls_Manager::SELECT,
834
- 'options' => [
835
- 'h1' => __('H1', 'livemesh-el-addons'),
836
- 'h2' => __('H2', 'livemesh-el-addons'),
837
- 'h3' => __('H3', 'livemesh-el-addons'),
838
- 'h4' => __('H4', 'livemesh-el-addons'),
839
- 'h5' => __('H5', 'livemesh-el-addons'),
840
- 'h6' => __('H6', 'livemesh-el-addons'),
841
- 'div' => __('div', 'livemesh-el-addons'),
842
- ],
843
- 'default' => 'h3',
844
- ]
845
- );
846
-
847
- $this->add_control(
848
- 'entry_title_color',
849
- [
850
- 'label' => __('Entry Title Color', 'livemesh-el-addons'),
851
- 'type' => Controls_Manager::COLOR,
852
- 'selectors' => [
853
- '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .entry-title a' => 'color: {{VALUE}};',
854
- ],
855
- ]
856
- );
857
-
858
- $this->add_control(
859
- 'entry_title_hover_color',
860
- [
861
- 'label' => __('Entry Title Hover Color', 'livemesh-el-addons'),
862
- 'type' => Controls_Manager::COLOR,
863
- 'selectors' => [
864
- '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .entry-title a:hover' => 'color: {{VALUE}};',
865
- ],
866
- ]
867
- );
868
-
869
- $this->add_group_control(
870
- Group_Control_Typography::get_type(),
871
- [
872
- 'name' => 'entry_title_typography',
873
- 'selector' => '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .entry-title',
874
- ]
875
- );
876
-
877
  $this->end_controls_section();
878
-
879
- $this->start_controls_section(
880
- 'section_entry_summary_styling',
881
- [
882
- 'label' => __('Grid Item Entry Summary', 'livemesh-el-addons'),
883
- 'tab' => Controls_Manager::TAB_STYLE,
884
- ]
885
- );
886
-
887
- $this->add_control(
888
- 'entry_summary_color',
889
- [
890
- 'label' => __('Entry Summary Color', 'livemesh-el-addons'),
891
- 'type' => Controls_Manager::COLOR,
892
- 'selectors' => [
893
- '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .entry-summary' => 'color: {{VALUE}};',
894
- ],
895
- ]
896
- );
897
-
898
- $this->add_group_control(
899
- Group_Control_Typography::get_type(),
900
- [
901
- 'name' => 'entry_summary_typography',
902
- 'selector' => '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .entry-summary',
903
- ]
904
- );
905
-
906
  $this->end_controls_section();
907
-
908
- $this->start_controls_section(
909
- 'section_entry_meta_styling',
910
- [
911
- 'label' => __('Grid Item Entry Meta', 'livemesh-el-addons'),
912
- 'tab' => Controls_Manager::TAB_STYLE,
913
- 'condition' => [
914
- 'grid_skin' => 'classic_skin'
915
- ],
916
- ]
917
- );
918
-
919
- $this->add_control(
920
- 'heading_entry_meta',
921
- [
922
- 'label' => __('Entry Meta', 'livemesh-el-addons'),
923
- 'type' => Controls_Manager::HEADING,
924
- 'separator' => 'after',
925
- ]
926
- );
927
-
928
- $this->add_control(
929
- 'entry_meta_color',
930
- [
931
- 'label' => __('Entry Meta Color', 'livemesh-el-addons'),
932
- 'type' => Controls_Manager::COLOR,
933
- 'selectors' => [
934
- '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-entry-meta span' => 'color: {{VALUE}};',
935
- ],
936
- ]
937
- );
938
-
939
- $this->add_group_control(
940
- Group_Control_Typography::get_type(),
941
- [
942
- 'name' => 'entry_meta_typography',
943
- 'selector' => '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-entry-meta span',
944
- ]
945
- );
946
-
947
-
948
- $this->add_control(
949
- 'heading_entry_meta_link',
950
- [
951
- 'label' => __('Entry Meta Link', 'livemesh-el-addons'),
952
- 'type' => Controls_Manager::HEADING,
953
- 'separator' => 'after',
954
- ]
955
- );
956
-
957
- $this->add_control(
958
- 'entry_meta_link_color',
959
- [
960
- 'label' => __('Entry Meta Link Color', 'livemesh-el-addons'),
961
- 'type' => Controls_Manager::COLOR,
962
- 'selectors' => [
963
- '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-entry-meta span a' => 'color: {{VALUE}};',
964
- ],
965
- ]
966
- );
967
-
968
- $this->add_group_control(
969
- Group_Control_Typography::get_type(),
970
- [
971
- 'name' => 'entry_meta_link_typography',
972
- 'selector' => '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-entry-meta span a',
973
- ]
974
- );
975
-
976
  $this->end_controls_section();
977
-
978
- $this->start_controls_section(
979
- 'section_read_more_styling',
980
- [
981
- 'label' => __('Read More', 'livemesh-el-addons'),
982
- 'tab' => Controls_Manager::TAB_STYLE,
983
- 'condition' => [
984
- 'grid_skin' => 'classic_skin'
985
- ],
986
- ]
987
- );
988
-
989
- $this->add_control(
990
- 'read_more_color',
991
- [
992
- 'label' => __('Read More Color', 'livemesh-el-addons'),
993
- 'type' => Controls_Manager::COLOR,
994
- 'selectors' => [
995
- '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio-item .lae-read-more, {{WRAPPER}} .lae-portfolio-wrap .lae-portfolio-item .lae-read-more a' => 'color: {{VALUE}};',
996
- ],
997
- ]
998
- );
999
-
1000
- $this->add_control(
1001
- 'read_more_hover_color',
1002
- [
1003
- 'label' => __('Read More Hover Color', 'livemesh-el-addons'),
1004
- 'type' => Controls_Manager::COLOR,
1005
- 'selectors' => [
1006
- '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio-item .lae-read-more:hover, {{WRAPPER}} .lae-portfolio-wrap .lae-portfolio-item .lae-read-more a:hover' => 'color: {{VALUE}};',
1007
- ],
1008
- ]
1009
- );
1010
-
1011
- $this->add_group_control(
1012
- Group_Control_Typography::get_type(),
1013
- [
1014
- 'name' => 'read_more_typography',
1015
- 'selector' => '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio-item .lae-read-more, {{WRAPPER}} .lae-portfolio-wrap .lae-portfolio-item .lae-read-more a',
1016
- ]
1017
- );
1018
-
1019
  $this->end_controls_section();
1020
-
1021
-
1022
  }
1023
-
1024
- protected function get_item_template_content($template_id, $settings) {
1025
-
1026
  /* Initialize the theme builder templates - Requires elementor pro plugin */
1027
- if (!is_plugin_active('elementor-pro/elementor-pro.php')) {
1028
- $output = lae_template_error(__('Custom skin requires Elementor Pro but the plugin is not installed/active', 'livemesh-el-addons'));
1029
- }
1030
- else {
1031
- $output = lae_get_item_template_content($template_id, $settings);
1032
  }
1033
-
1034
  return $output;
1035
-
1036
  }
1037
-
1038
- protected function get_grid_template_content($template_id, $settings) {
1039
-
1040
  /* Initialize the theme builder templates - Requires elementor pro plugin */
1041
- if (!is_plugin_active('elementor-pro/elementor-pro.php')) {
1042
- $output = lae_template_error(__('Custom skin requires Elementor Pro but the plugin is not installed/active', 'livemesh-el-addons'));
1043
- }
1044
- else {
1045
- $output = lae_get_template_content($template_id, $settings);
1046
  }
1047
-
1048
  return $output;
1049
-
1050
  }
1051
-
1052
- protected function get_item_template_options() {
1053
-
1054
  $template_options = array();
1055
-
1056
  /* Initialize the theme builder templates - Requires elementor pro plugin */
1057
- if (!is_plugin_active('elementor-pro/elementor-pro.php')) {
1058
- $template_options = [0 => __('No templates found. Elementor Pro is not installed/active', 'livemesh-el-addons')];
1059
- }
1060
- else {
 
 
1061
  $templates = lae_get_livemesh_item_templates();
1062
-
1063
  //$template_options = [0 => __('Select a template', 'livemesh-el-addons')];
1064
-
1065
- foreach ($templates as $template) {
1066
  $template_options[$template->ID] = $template->post_title;
1067
  }
1068
  }
1069
-
1070
  return $template_options;
1071
  }
1072
-
1073
- protected function get_grid_template_options() {
1074
-
1075
  $template_options = array();
1076
-
1077
  /* Initialize the theme builder templates - Requires elementor pro plugin */
1078
- if (!is_plugin_active('elementor-pro/elementor-pro.php')) {
1079
- $template_options = [0 => __('No templates found. Elementor Pro is not installed/active', 'livemesh-el-addons')];
1080
- }
1081
- else {
 
 
1082
  $templates = lae_get_livemesh_grid_templates();
1083
-
1084
  //$template_options = [0 => __('Select a template', 'livemesh-el-addons')];
1085
-
1086
- foreach ($templates as $template) {
1087
  $template_options[$template->ID] = $template->post_title;
1088
  }
1089
  }
1090
-
1091
  return $template_options;
1092
  }
1093
-
1094
- protected function get_item_templates($shortcode_pattern, $grid_template_content) {
1095
-
1096
  $matches = array();
1097
-
1098
- preg_match_all($shortcode_pattern, $grid_template_content, $matches);
1099
-
1100
- $attributes = array_pop($matches); // fetch last array element
1101
-
1102
  $item_templates = array();
1103
-
1104
- foreach ($attributes as $attribute) {
1105
-
1106
- list($key, $val) = explode("=", $attribute);
1107
-
1108
- $item_templates[] = trim($val, '"');
1109
-
1110
  }
1111
  return $item_templates;
1112
  }
1113
-
1114
- protected function render() {
1115
-
1116
  $settings = $this->get_settings_for_display();
1117
-
1118
- $settings = apply_filters('lae_posts_grid_' . $this->get_id() . '_settings', $settings);
1119
-
1120
  // Use the processed post selector query to find posts.
1121
- $query_args = lae_build_query_args($settings);
1122
-
1123
- $query_args = apply_filters('lae_posts_grid_' . $this->get_id() . '_query_args', $query_args, $settings);
1124
-
1125
- $loop = new \WP_Query($query_args);
1126
-
1127
  // Loop through the posts and do something with them.
1128
- if ($loop->have_posts()) :
1129
-
1130
- $dir = is_rtl() ? ' dir="rtl"' : '';
1131
-
1132
- $target = $settings['post_link_new_window'] == 'yes' ? ' target="_blank"' : '';
1133
-
1134
  // Check if any taxonomy filter has been applied
1135
- list($chosen_terms, $taxonomies) = lae_get_chosen_terms($query_args);
1136
-
1137
- if (empty($chosen_terms))
1138
  $taxonomies[] = $settings['taxonomy_filter'];
1139
-
1140
  $output = '<div class="lae-portfolio-wrap lae-gapless-grid">';
1141
-
1142
- if (!empty($settings['heading']) || $settings['filterable'] == 'yes'):
1143
-
1144
- $header_class = (trim($settings['heading']) === '') ? ' lae-no-heading' : '';
1145
-
1146
  $grid_header = '<div class="lae-portfolio-header ' . $header_class . '">';
1147
-
1148
- if (!empty($settings['heading'])) :
1149
-
1150
- $grid_header .= '<' . $settings['heading_tag']
1151
- . ' class="lae-heading">' . wp_kses_post($settings['heading'])
1152
- . '</' . $settings['heading_tag'] . '>';
1153
-
1154
- endif;
1155
-
1156
- if ($settings['filterable'] == 'yes')
1157
- $grid_header .= lae_get_taxonomy_terms_filter($taxonomies, $chosen_terms);
1158
-
1159
  $grid_header .= '</div>';
1160
-
1161
- $output .= apply_filters('lae_posts_grid_header', $grid_header, $settings);
1162
-
1163
- endif;
1164
-
1165
- if ($settings['grid_skin'] == 'custom_grid') :
1166
-
1167
  $grid_template_id = $settings['grid_template'];
1168
-
1169
- if (!$grid_template_id) :
1170
-
1171
- $output .= lae_template_error(__('Choose a custom template for the grid', 'livemesh-el-addons'));
1172
-
1173
- else :
1174
-
1175
- $shortcode_pattern = "/\[livemesh_grid_item (.+?)\]/";
1176
-
1177
- $grid_template_content = $this->get_grid_template_content($grid_template_id, $settings);
1178
-
1179
- $item_templates = $this->get_item_templates($shortcode_pattern, $grid_template_content);
1180
-
1181
  $item_template_walker = array();
1182
-
1183
- $output .= '<div' . $dir . ' id="lae-portfolio-' . uniqid()
1184
- . '" class="lae-portfolio lae-grid-container '
1185
- . 'lae-' . str_replace('_', '-', $settings['grid_skin'])
1186
- . '">';
1187
-
1188
  $template_output = '';
1189
-
1190
- while ($loop->have_posts()) : $loop->the_post();
1191
-
1192
- if (empty($item_template_walker)) {
1193
  $template_output .= $grid_template_content;
1194
-
1195
  $item_template_walker = $item_templates;
1196
-
1197
  }
1198
-
1199
- $item_template_id = array_shift($item_template_walker);
1200
-
1201
- $item_template_content = $this->get_item_template_content($item_template_id, $settings);
1202
-
1203
  // Replace the first element with the grid template content for the item
1204
- $template_output = preg_replace($shortcode_pattern, $item_template_content, $template_output, 1);
1205
-
1206
- endwhile;
1207
-
 
 
 
1208
  // Replace the remaining shortcode occurrences in the grid template content with a placeholder string
1209
- $template_output = preg_replace($shortcode_pattern, '', $template_output);
1210
-
1211
- $output .= apply_filters('lae_posts_grid_template_output', $template_output, $loop, $settings);
1212
-
1213
- endif;
1214
-
1215
- else :
1216
-
1217
- $output .= '<div' . $dir . ' id="lae-portfolio-' . uniqid()
1218
- . '" class="lae-portfolio js-isotope lae-' . esc_attr($settings['layout_mode']) . ' lae-grid-container '
1219
- . 'lae-' . str_replace('_', '-', $settings['grid_skin'])
1220
- . lae_get_grid_classes($settings)
1221
- . '" data-isotope-options=\'{ "itemSelector": ".lae-portfolio-item", "layoutMode": "' . esc_attr($settings['layout_mode']) . '", "originLeft": ' . esc_attr(!is_rtl() ? 'true' : 'false') . '}\'>';
1222
-
1223
  $current_page = get_queried_object_id();
1224
-
1225
- while ($loop->have_posts()) : $loop->the_post();
1226
-
1227
  $post_id = get_the_ID();
1228
-
1229
- if ($post_id === $current_page)
1230
- continue; // skip current page since we can run into infinite loop when users choose All option in build query
1231
-
1232
  $style = '';
1233
- foreach ($taxonomies as $taxonomy) {
1234
- $terms = get_the_terms($post_id, $taxonomy);
1235
- if (!empty($terms) && !is_wp_error($terms)) {
1236
- foreach ($terms as $term) {
1237
  $style .= ' term-' . $term->term_id;
1238
  }
1239
  }
1240
  }
1241
-
1242
  $entry_output = '<div data-id="id-' . $post_id . '" class="lae-grid-item lae-portfolio-item ' . $style . '">';
1243
-
1244
- $entry_output .= '<article id="post-' . $post_id . '" class="' . join(' ', get_post_class('', $post_id)) . '">';
1245
-
1246
- if ($settings['grid_skin'] == 'custom_skin') :
1247
-
1248
  $item_template_id = $settings['item_template'];
1249
-
1250
- if ($item_template_id) :
1251
-
1252
- $item_template_output = $this->get_item_template_content($item_template_id, $settings);
1253
-
1254
- $entry_output .= apply_filters('lae_posts_grid_item_template_output', $item_template_output, $item_template_id, $post_id, $settings);
1255
-
1256
- else :
1257
-
1258
- $entry_output .= lae_template_error(__('Choose a custom skin template for the grid item', 'livemesh-el-addons'));
1259
-
1260
- endif;
1261
-
1262
- else :
1263
-
1264
- if ($thumbnail_exists = has_post_thumbnail()) :
1265
-
1266
  $entry_image = '<div class="lae-project-image">';
1267
-
1268
- $image_setting = ['id' => get_post_thumbnail_id($post_id)];
1269
-
1270
- $thumbnail_html = lae_get_image_html($image_setting, 'thumbnail_size', $settings, true);
1271
-
1272
- if ($settings['image_linkable'] == 'yes'):
1273
-
 
 
 
1274
  $thumbnail_html = '<a href="' . get_the_permalink() . '"̌̌' . $target . '>' . $thumbnail_html . '</a>';
1275
-
1276
- endif;
1277
-
1278
- $entry_image .= apply_filters('lae_posts_grid_thumbnail_html', $thumbnail_html, $image_setting, $settings);
1279
-
1280
- if (($settings['display_title_on_thumbnail'] == 'yes') || ($settings['display_taxonomy_on_thumbnail'] == 'yes')):
1281
-
 
 
1282
  $image_info = '<div class="lae-image-info">';
1283
-
1284
  $image_info .= '<div class="lae-entry-info">';
1285
-
1286
- if ($settings['display_title_on_thumbnail'] == 'yes'):
1287
-
1288
  $image_info .= '<' . $settings['title_tag'] . ' class="lae-post-title"><a href="' . get_permalink() . '" title="' . get_the_title() . '" rel="bookmark"' . $target . '>' . get_the_title() . '</a></' . $settings['title_tag'] . '>';
1289
-
1290
- endif;
1291
-
1292
- if ($settings['display_taxonomy_on_thumbnail'] == 'yes'):
1293
-
1294
- $image_info .= lae_get_info_for_taxonomies($taxonomies);
1295
-
1296
- endif;
1297
-
1298
  $image_info .= '</div>';
1299
-
1300
  $image_info .= '</div><!-- .lae-image-info -->';
1301
-
1302
- $entry_image .= apply_filters('lae_posts_grid_image_info', $image_info, $post_id, $settings);
1303
-
 
 
 
1304
  $entry_image .= '</div>';
1305
-
1306
- endif;
1307
-
1308
- $entry_output .= apply_filters('lae_posts_grid_entry_image', $entry_image, $image_setting, $settings);
1309
-
1310
- endif;
1311
-
1312
- if (($settings['display_title'] == 'yes') || ($settings['display_summary'] == 'yes')) :
1313
-
1314
- $entry_text = '<div class="lae-entry-text-wrap ' . ($thumbnail_exists ? '' : ' nothumbnail') . '">';
1315
-
1316
- if ($settings['display_title'] == 'yes') :
1317
-
 
 
1318
  $entry_title = '<' . $settings['entry_title_tag'] . ' class="entry-title"><a href="' . get_permalink() . '" title="' . get_the_title() . '" rel="bookmark"' . $target . '>' . get_the_title() . '</a></' . $settings['entry_title_tag'] . '>';
1319
-
1320
- $entry_text .= apply_filters('lae_posts_grid_entry_title', $entry_title, $post_id, $settings);
1321
-
1322
- endif;
1323
-
1324
- if (($settings['display_post_date'] == 'yes') || ($settings['display_author'] == 'yes') || ($settings['display_taxonomy'] == 'yes')) :
1325
-
 
 
 
1326
  $entry_meta = '<div class="lae-entry-meta">';
1327
-
1328
- if ($settings['display_author'] == 'yes'):
1329
-
1330
  $entry_meta .= lae_entry_author();
1331
-
1332
- endif;
1333
-
1334
- if ($settings['display_post_date'] == 'yes'):
1335
-
1336
  $entry_meta .= lae_entry_published();
1337
-
1338
- endif;
1339
-
1340
- if ($settings['display_taxonomy'] == 'yes'):
1341
-
1342
- $entry_meta .= lae_get_info_for_taxonomies($taxonomies);
1343
-
1344
- endif;
1345
-
1346
  $entry_meta .= '</div>';
1347
-
1348
- $entry_text .= apply_filters('lae_posts_grid_entry_meta', $entry_meta, $post_id, $settings);
1349
-
1350
- endif;
1351
-
1352
- if ($settings['display_summary'] == 'yes') :
1353
-
 
 
 
1354
  $excerpt = '<div class="entry-summary">';
1355
-
1356
  $excerpt .= get_the_excerpt();
1357
-
1358
  $excerpt .= '</div>';
1359
-
1360
- $entry_text .= apply_filters('lae_posts_grid_entry_excerpt', $excerpt, $post_id, $settings);
1361
-
1362
- endif;
1363
-
1364
- if ($settings['display_read_more'] == 'yes') :
1365
-
 
 
 
1366
  $read_more_text = $settings['read_more_text'];
1367
-
1368
  $read_more = '<div class="lae-read-more">';
1369
-
1370
  $read_more .= '<a href="' . get_the_permalink() . '"' . $target . '>' . $read_more_text . '</a>';
1371
-
1372
  $read_more .= '</div>';
1373
-
1374
- $entry_text .= apply_filters('lae_posts_grid_read_more_link', $read_more, $post_id, $settings);
1375
-
1376
- endif;
1377
-
 
 
 
1378
  $entry_text .= '</div>';
1379
-
1380
- $entry_output .= apply_filters('lae_posts_grid_entry_text', $entry_text, $post_id, $settings);
1381
-
1382
- endif;
1383
-
1384
- endif;
1385
-
 
 
 
1386
  $entry_output .= '</article><!-- .hentry -->';
1387
-
1388
  $entry_output .= '</div>';
1389
-
1390
- $output .= apply_filters('lae_posts_grid_entry_output', $entry_output, $post_id, $settings);
1391
-
1392
- endwhile;
1393
-
 
 
1394
  wp_reset_postdata();
1395
-
1396
  $output .= '</div><!-- .lae-portfolio -->';
1397
-
1398
  $output .= '</div><!-- .lae-portfolio-wrap -->';
1399
-
1400
- endif;
1401
-
1402
- echo apply_filters('lae_posts_grid_output', $output, $settings);
1403
-
1404
- endif;
1405
-
1406
  }
1407
-
1408
- protected function content_template() {
 
1409
  }
1410
 
1411
  }
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
 
9
  namespace LivemeshAddons\Widgets;
10
 
11
+ use Elementor\Widget_Base ;
12
+ use Elementor\Controls_Manager ;
13
+ use Elementor\Group_Control_Image_Size ;
14
+ use Elementor\Group_Control_Typography ;
15
+ if ( !defined( 'ABSPATH' ) ) {
16
+ exit;
17
+ }
18
+ // Exit if accessed directly
19
+ class LAE_Portfolio_Widget extends LAE_Widget_Base
20
+ {
21
+ public function get_name()
22
+ {
 
23
  return 'lae-portfolio';
24
  }
25
+
26
+ public function get_title()
27
+ {
28
+ return __( 'Posts Grid', 'livemesh-el-addons' );
29
  }
30
+
31
+ public function get_icon()
32
+ {
33
  return 'lae-icon-posts-grid-masonry';
34
  }
35
+
36
+ public function get_categories()
37
+ {
38
+ return array( 'livemesh-addons' );
39
  }
40
+
41
+ public function get_custom_help_url()
42
+ {
43
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/posts-portfolio-grid/';
44
  }
45
+
46
+ public function get_script_depends()
47
+ {
48
  return [
49
  'isotope.pkgd',
50
  'imagesloaded.pkgd',
52
  'lae-portfolio-scripts'
53
  ];
54
  }
55
+
56
+ public function get_style_depends()
57
+ {
58
+ return [ 'lae-frontend-styles', 'lae-grid-styles', 'lae-portfolio-styles' ];
 
 
 
59
  }
60
+
61
+ protected function _register_controls()
62
+ {
63
+ $this->start_controls_section( 'section_query', [
64
+ 'label' => __( 'Post Query', 'livemesh-el-addons' ),
65
+ ] );
66
+ $this->add_control( 'query_type', [
67
+ 'label' => __( 'Source', 'livemesh-el-addons' ),
68
+ 'type' => Controls_Manager::SELECT,
69
+ 'options' => array(
70
+ 'custom_query' => __( 'Custom Query', 'livemesh-el-addons' ),
71
+ 'current_query' => __( 'Current Query', 'livemesh-el-addons' ),
72
+ 'related' => __( 'Related', 'livemesh-el-addons' ),
73
+ ),
74
+ 'default' => 'custom_query',
75
+ ] );
76
+ $this->add_control( 'post_types', [
77
+ 'label' => __( 'Post Types', 'livemesh-el-addons' ),
78
+ 'type' => Controls_Manager::SELECT2,
79
+ 'default' => 'post',
80
+ 'options' => lae_get_all_post_type_options(),
81
+ 'multiple' => true,
82
+ 'condition' => [
83
+ 'query_type' => 'custom_query',
84
+ ],
85
+ ] );
86
+ $this->add_control( 'taxonomies', [
87
+ 'type' => Controls_Manager::SELECT2,
88
+ 'label' => __( 'Choose the taxonomies to display related posts.', 'livemesh-el-addons' ),
89
+ 'label_block' => true,
90
+ 'description' => __( 'Choose the taxonomies to be used for displaying posts related to current post, page or custom post type.', 'livemesh-el-addons' ),
91
+ 'options' => lae_get_taxonomies_map(),
92
+ 'default' => 'category',
93
+ 'multiple' => true,
94
+ 'condition' => [
95
+ 'query_type' => 'related',
96
+ ],
97
+ ] );
98
+ $this->add_control( 'tax_query', [
99
+ 'label' => __( 'Taxonomies', 'livemesh-el-addons' ),
100
+ 'type' => Controls_Manager::SELECT2,
101
+ 'options' => lae_get_all_taxonomy_options(),
102
+ 'multiple' => true,
103
+ 'label_block' => true,
104
+ 'condition' => [
105
+ 'query_type' => 'custom_query',
106
+ ],
107
+ ] );
108
+ $this->add_control( 'post_in', [
109
+ 'label' => __( 'Post In', 'livemesh-el-addons' ),
110
+ 'description' => __( 'Provide a comma separated list of Post IDs to display in the grid.', 'livemesh-el-addons' ),
111
+ 'type' => Controls_Manager::TEXT,
112
+ 'label_block' => true,
113
+ 'condition' => [
114
+ 'query_type' => 'custom_query',
115
+ ],
116
+ ] );
117
+ $this->add_control( 'posts_per_page', [
118
+ 'label' => __( 'Posts Per Page', 'livemesh-el-addons' ),
119
+ 'type' => Controls_Manager::NUMBER,
120
+ 'min' => 1,
121
+ 'max' => 50,
122
+ 'step' => 1,
123
+ 'default' => 6,
124
+ 'condition' => [
125
+ 'query_type' => [ 'custom_query', 'related' ],
126
+ ],
127
+ ] );
128
+ $this->add_control( 'advanced', [
129
+ 'label' => __( 'Advanced', 'livemesh-el-addons' ),
130
+ 'type' => Controls_Manager::HEADING,
131
+ 'condition' => [
132
+ 'query_type' => [ 'custom_query', 'related' ],
133
+ ],
134
+ ] );
135
+ $this->add_control( 'orderby', [
136
+ 'label' => __( 'Order By', 'livemesh-el-addons' ),
137
+ 'type' => Controls_Manager::SELECT,
138
+ 'options' => array(
139
+ 'none' => __( 'No order', 'livemesh-el-addons' ),
140
+ 'ID' => __( 'Post ID', 'livemesh-el-addons' ),
141
+ 'author' => __( 'Author', 'livemesh-el-addons' ),
142
+ 'title' => __( 'Title', 'livemesh-el-addons' ),
143
+ 'date' => __( 'Published date', 'livemesh-el-addons' ),
144
+ 'modified' => __( 'Modified date', 'livemesh-el-addons' ),
145
+ 'parent' => __( 'By parent', 'livemesh-el-addons' ),
146
+ 'rand' => __( 'Random order', 'livemesh-el-addons' ),
147
+ 'comment_count' => __( 'Comment count', 'livemesh-el-addons' ),
148
+ 'menu_order' => __( 'Menu order', 'livemesh-el-addons' ),
149
+ 'post__in' => __( 'By include order', 'livemesh-el-addons' ),
150
+ ),
151
+ 'default' => 'date',
152
+ 'condition' => [
153
+ 'query_type' => [ 'custom_query', 'related' ],
154
+ ],
155
+ ] );
156
+ $this->add_control( 'order', [
157
+ 'label' => __( 'Order', 'livemesh-el-addons' ),
158
+ 'type' => Controls_Manager::SELECT,
159
+ 'options' => array(
160
+ 'ASC' => __( 'Ascending', 'livemesh-el-addons' ),
161
+ 'DESC' => __( 'Descending', 'livemesh-el-addons' ),
162
+ ),
163
+ 'default' => 'DESC',
164
+ 'condition' => [
165
+ 'query_type' => [ 'custom_query', 'related' ],
166
+ ],
167
+ ] );
168
+ $this->add_control( 'offset', [
169
+ 'label' => __( 'Offset', 'livemesh-el-addons' ),
170
+ 'description' => __( 'Number of posts to skip or pass over.', 'livemesh-el-addons' ),
171
+ 'type' => Controls_Manager::NUMBER,
172
+ 'default' => 0,
173
+ 'condition' => [
174
+ 'query_type' => 'custom_query',
175
+ ],
176
+ ] );
177
+ $this->add_control( 'upgrade_notice', [
178
+ 'type' => Controls_Manager::RAW_HTML,
179
+ 'separator' => 'before',
180
+ 'raw' => '<div style="text-align:center;line-height:1.6;"><p>' . __( 'Unlock new possibilities with premium widgets and styles of <strong>Livemesh Addons for Elementor <i>Premium</i></strong>. ', 'livemesh-el-addons' ) . '</p><p style="padding-top:15px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://livemeshelementor.com/pricing/#pricing-plans" target="_blank"><i class="fa fa-hand-o-right" aria-hidden="true"></i>' . __( 'Go Pro', 'livemesh-el-addons' ) . '</a></p></div>',
181
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  $this->end_controls_section();
183
+ $this->start_controls_section( 'section_grid_skin', [
184
+ 'label' => __( 'Grid Skin', 'livemesh-el-addons' ),
185
+ ] );
186
+ $this->add_control( 'grid_skin', [
187
+ 'label' => __( 'Choose Grid Skin', 'livemesh-el-addons' ),
188
+ 'description' => __( 'The "Classic Skin" is the built-in styling provided for the grid items. Choose "Custom Skin" if you want to use theme builder template for the grid item. The option "Custom Grid" is the most flexible one that lets you use a theme builder template for the grid layout with choice of custom template for one or more of its items.', 'livemesh-el-addons' ),
189
+ 'type' => Controls_Manager::SELECT,
190
+ 'options' => array(
191
+ 'classic_skin' => __( 'Classic Skin', 'livemesh-el-addons' ),
192
+ 'custom_skin' => __( 'Custom Skin', 'livemesh-el-addons' ),
193
+ 'custom_grid' => __( 'Custom Grid', 'livemesh-el-addons' ),
194
+ ),
195
+ 'default' => 'classic_skin',
196
+ ] );
197
+ $this->add_control( 'item_template', [
198
+ 'label' => __( 'Select the custom skin template for the grid item', 'livemesh-el-addons' ),
199
+ 'description' => '<div style="text-align:center;font-style: normal;">' . '<a target="_blank" class="elementor-button elementor-button-default" href="' . esc_url( admin_url( '/edit.php?post_type=elementor_library&tabs_group=theme&elementor_library_type=livemesh_item' ) ) . '">' . __( 'Create/Edit the Item Skin Builder Templates', 'livemesh-el-addons' ) . '</a>' . '</div>',
200
+ 'type' => Controls_Manager::SELECT,
201
+ 'label_block' => true,
202
+ 'default' => [],
203
+ 'options' => $this->get_item_template_options(),
204
+ 'condition' => [
205
+ 'grid_skin' => 'custom_skin',
206
+ ],
207
+ ] );
208
+ $this->add_control( 'grid_template', [
209
+ 'label' => __( 'Select the custom grid template for the grid item', 'livemesh-el-addons' ),
210
+ 'description' => '<div style="text-align:center;font-style: normal;">' . '<a target="_blank" class="elementor-button elementor-button-default" href="' . esc_url( admin_url( '/edit.php?post_type=elementor_library&tabs_group=theme&elementor_library_type=livemesh_grid' ) ) . '">' . __( 'Create/Edit the Grid Builder Templates', 'livemesh-el-addons' ) . '</a>' . '</div>',
211
+ 'type' => Controls_Manager::SELECT,
212
+ 'label_block' => true,
213
+ 'default' => [],
214
+ 'options' => $this->get_grid_template_options(),
215
+ 'condition' => [
216
+ 'grid_skin' => 'custom_grid',
217
+ ],
218
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  $this->end_controls_section();
220
+ $this->start_controls_section( 'section_post_content', [
221
+ 'label' => __( 'Post Content', 'livemesh-el-addons' ),
222
+ 'condition' => [
223
+ 'grid_skin' => 'classic_skin',
224
+ ],
225
+ ] );
226
+ $this->add_group_control( Group_Control_Image_Size::get_type(), [
227
+ 'name' => 'thumbnail_size',
228
+ 'label' => __( 'Image Size', 'livemesh-el-addons' ),
229
+ 'default' => 'large',
230
+ ] );
231
+ $this->add_control( 'image_linkable', [
232
+ 'label' => __( 'Link Images to Posts?', 'livemesh-el-addons' ),
233
+ 'type' => Controls_Manager::SWITCHER,
234
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
235
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
236
+ 'return_value' => 'yes',
237
+ 'default' => 'yes',
238
+ ] );
239
+ $this->add_control( 'post_link_new_window', [
240
+ 'label' => __( 'Open post links in new window?', 'livemesh-el-addons' ),
241
+ 'type' => Controls_Manager::SWITCHER,
242
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
243
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
244
+ 'return_value' => 'yes',
245
+ 'default' => '',
246
+ ] );
247
+ $this->add_control( 'display_title_on_thumbnail', [
248
+ 'label' => __( 'Display posts title on the post/portfolio thumbnail?', 'livemesh-el-addons' ),
249
+ 'type' => Controls_Manager::SWITCHER,
250
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
251
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
252
+ 'return_value' => 'yes',
253
+ 'default' => 'yes',
254
+ ] );
255
+ $this->add_control( 'display_taxonomy_on_thumbnail', [
256
+ 'label' => __( 'Display taxonomy info on post/project thumbnail?', 'livemesh-el-addons' ),
257
+ 'type' => Controls_Manager::SWITCHER,
258
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
259
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
260
+ 'return_value' => 'yes',
261
+ 'default' => 'yes',
262
+ ] );
263
+ $this->add_control( 'display_title', [
264
+ 'label' => __( 'Display posts title for the post/portfolio item?', 'livemesh-el-addons' ),
265
+ 'type' => Controls_Manager::SWITCHER,
266
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
267
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
268
+ 'return_value' => 'yes',
269
+ 'default' => 'yes',
270
+ ] );
271
+ $this->add_control( 'display_summary', [
272
+ 'label' => __( 'Display post excerpt/summary for the post/portfolio item?', 'livemesh-el-addons' ),
273
+ 'type' => Controls_Manager::SWITCHER,
274
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
275
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
276
+ 'return_value' => 'yes',
277
+ 'default' => 'yes',
278
+ ] );
279
+ $this->add_control( 'display_author', [
280
+ 'label' => __( 'Display post author info for the post/portfolio item?', 'livemesh-el-addons' ),
281
+ 'type' => Controls_Manager::SWITCHER,
282
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
283
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
284
+ 'return_value' => 'yes',
285
+ 'default' => 'yes',
286
+ ] );
287
+ $this->add_control( 'display_post_date', [
288
+ 'label' => __( 'Display post date info for the post item?', 'livemesh-el-addons' ),
289
+ 'type' => Controls_Manager::SWITCHER,
290
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
291
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
292
+ 'return_value' => 'yes',
293
+ 'default' => 'yes',
294
+ ] );
295
+ $this->add_control( 'display_taxonomy', [
296
+ 'label' => __( 'Display taxonomy info for the post item?', 'livemesh-el-addons' ),
297
+ 'type' => Controls_Manager::SWITCHER,
298
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
299
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
300
+ 'return_value' => 'yes',
301
+ 'default' => 'yes',
302
+ ] );
303
+ $this->add_control( 'display_read_more', [
304
+ 'label' => __( 'Display read more link to the post/portfolio?', 'livemesh-el-addons' ),
305
+ 'type' => Controls_Manager::SWITCHER,
306
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
307
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
308
+ 'return_value' => 'yes',
309
+ 'default' => 'no',
310
+ ] );
311
+ $this->add_control( 'read_more_text', [
312
+ 'label' => __( 'Read more text', 'livemesh-el-addons' ),
313
+ 'type' => Controls_Manager::TEXT,
314
+ "description" => __( 'Specify the text for the read more link/button', 'livemesh-el-addons' ),
315
+ 'default' => __( 'Read More', 'livemesh-el-addons' ),
316
+ 'condition' => [
317
+ 'display_read_more' => [ 'yes' ],
318
+ ],
319
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
320
  $this->end_controls_section();
321
+ $this->start_controls_section( 'section_general_settings', [
322
+ 'label' => __( 'General', 'livemesh-el-addons' ),
323
+ 'tab' => Controls_Manager::TAB_SETTINGS,
324
+ ] );
325
+ $this->add_control( 'heading', [
326
+ 'label' => __( 'Heading for the grid', 'livemesh-el-addons' ),
327
+ 'type' => Controls_Manager::TEXT,
328
+ 'placeholder' => __( 'My Posts', 'livemesh-el-addons' ),
329
+ 'default' => __( 'My Posts', 'livemesh-el-addons' ),
330
+ 'dynamic' => [
331
+ 'active' => true,
332
+ ],
333
+ ] );
334
+ $this->add_control( 'filterable', [
335
+ 'label' => __( 'Filterable?', 'livemesh-el-addons' ),
336
+ 'type' => Controls_Manager::SWITCHER,
337
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
338
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
339
+ 'return_value' => 'yes',
340
+ 'default' => 'yes',
341
+ 'condition' => [
342
+ 'grid_skin' => [ 'classic_skin', 'custom_skin' ],
343
+ ],
344
+ ] );
345
+ $this->add_control( 'taxonomy_filter', [
346
+ 'type' => Controls_Manager::SELECT,
347
+ 'label' => __( 'Choose the taxonomy to display and filter on.', 'livemesh-el-addons' ),
348
+ 'label_block' => true,
349
+ 'description' => __( 'Choose the taxonomy information to display for posts/portfolio and the taxonomy that is used to filter the portfolio/post. Takes effect only if no taxonomy filters are specified when building query.', 'livemesh-el-addons' ),
350
+ 'options' => lae_get_taxonomies_map(),
351
+ 'default' => 'category',
352
+ ] );
353
+ $this->add_responsive_control( 'per_line', [
354
+ 'label' => __( 'Columns per row', 'livemesh-el-addons' ),
355
+ 'type' => Controls_Manager::SELECT,
356
+ 'default' => '3',
357
+ 'tablet_default' => '2',
358
+ 'mobile_default' => '1',
359
+ 'options' => [
360
+ '1' => '1',
361
+ '2' => '2',
362
+ '3' => '3',
363
+ '4' => '4',
364
+ '5' => '5',
365
+ '6' => '6',
366
+ ],
367
+ 'frontend_available' => true,
368
+ ] );
369
+ $this->add_control( 'layout_mode', [
370
+ 'type' => Controls_Manager::SELECT,
371
+ 'label' => __( 'Choose a layout for the grid', 'livemesh-el-addons' ),
372
+ 'options' => array(
373
+ 'fitRows' => __( 'Fit Rows', 'livemesh-el-addons' ),
374
+ 'masonry' => __( 'Masonry', 'livemesh-el-addons' ),
375
+ ),
376
+ 'default' => 'fitRows',
377
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
378
  $this->end_controls_section();
379
+ $this->start_controls_section( 'section_responsive', [
380
+ 'label' => __( 'Gutter Options', 'livemesh-el-addons' ),
381
+ 'tab' => Controls_Manager::TAB_SETTINGS,
382
+ ] );
383
+ $this->add_control( 'heading_desktop', [
384
+ 'label' => __( 'Desktop', 'livemesh-el-addons' ),
385
+ 'type' => Controls_Manager::HEADING,
386
+ 'separator' => 'after',
387
+ ] );
388
+ $this->add_control( 'gutter', [
389
+ 'label' => __( 'Gutter', 'livemesh-el-addons' ),
390
+ 'description' => __( 'Space between columns in the grid.', 'livemesh-el-addons' ),
391
+ 'type' => Controls_Manager::NUMBER,
392
+ 'default' => 20,
393
+ 'selectors' => [
394
+ '{{WRAPPER}} .lae-portfolio' => 'margin-left: -{{VALUE}}px; margin-right: -{{VALUE}}px;',
395
+ '{{WRAPPER}} .lae-portfolio .lae-portfolio-item' => 'padding: {{VALUE}}px;',
396
+ ],
397
+ ] );
398
+ $this->add_control( 'heading_tablet', [
399
+ 'label' => __( 'Tablet', 'livemesh-el-addons' ),
400
+ 'type' => Controls_Manager::HEADING,
401
+ 'separator' => 'after',
402
+ ] );
403
+ $this->add_control( 'tablet_gutter', [
404
+ 'label' => __( 'Gutter', 'livemesh-el-addons' ),
405
+ 'description' => __( 'Space between columns.', 'livemesh-el-addons' ),
406
+ 'type' => Controls_Manager::NUMBER,
407
+ 'default' => 10,
408
+ 'selectors' => [
409
+ '(tablet-){{WRAPPER}} .lae-portfolio' => 'margin-left: -{{VALUE}}px; margin-right: -{{VALUE}}px;',
410
+ '(tablet-){{WRAPPER}} .lae-portfolio .lae-portfolio-item' => 'padding: {{VALUE}}px;',
411
+ ],
412
+ ] );
413
+ $this->add_control( 'heading_mobile', [
414
+ 'label' => __( 'Mobile Phone', 'livemesh-el-addons' ),
415
+ 'type' => Controls_Manager::HEADING,
416
+ 'separator' => 'after',
417
+ ] );
418
+ $this->add_control( 'mobile_gutter', [
419
+ 'label' => __( 'Gutter', 'livemesh-el-addons' ),
420
+ 'description' => __( 'Space between columns.', 'livemesh-el-addons' ),
421
+ 'type' => Controls_Manager::NUMBER,
422
+ 'default' => 10,
423
+ 'selectors' => [
424
+ '(mobile-){{WRAPPER}} .lae-portfolio' => 'margin-left: -{{VALUE}}px; margin-right: -{{VALUE}}px;',
425
+ '(mobile-){{WRAPPER}} .lae-portfolio .lae-portfolio-item' => 'padding: {{VALUE}}px;',
426
+ ],
427
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
428
  $this->end_controls_section();
429
+ $this->start_controls_section( 'section_heading_styling', [
430
+ 'label' => __( 'Grid Heading', 'livemesh-el-addons' ),
431
+ 'tab' => Controls_Manager::TAB_STYLE,
432
+ ] );
433
+ $this->add_control( 'heading_tag', [
434
+ 'label' => __( 'Heading HTML Tag', 'livemesh-el-addons' ),
435
+ 'type' => Controls_Manager::SELECT,
436
+ 'options' => [
437
+ 'h1' => __( 'H1', 'livemesh-el-addons' ),
438
+ 'h2' => __( 'H2', 'livemesh-el-addons' ),
439
+ 'h3' => __( 'H3', 'livemesh-el-addons' ),
440
+ 'h4' => __( 'H4', 'livemesh-el-addons' ),
441
+ 'h5' => __( 'H5', 'livemesh-el-addons' ),
442
+ 'h6' => __( 'H6', 'livemesh-el-addons' ),
443
+ 'div' => __( 'div', 'livemesh-el-addons' ),
444
+ ],
445
+ 'default' => 'h3',
446
+ ] );
447
+ $this->add_control( 'heading_color', [
448
+ 'label' => __( 'Heading Color', 'livemesh-el-addons' ),
449
+ 'type' => Controls_Manager::COLOR,
450
+ 'selectors' => [
451
+ '{{WRAPPER}} .lae-portfolio-wrap .lae-heading' => 'color: {{VALUE}};',
452
+ ],
453
+ ] );
454
+ $this->add_group_control( Group_Control_Typography::get_type(), [
455
+ 'name' => 'heading_typography',
456
+ 'selector' => '{{WRAPPER}} .lae-portfolio-wrap .lae-heading',
457
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
458
  $this->end_controls_section();
459
+ $this->start_controls_section( 'section_filters_styling', [
460
+ 'label' => __( 'Grid Filters', 'livemesh-el-addons' ),
461
+ 'tab' => Controls_Manager::TAB_STYLE,
462
+ ] );
463
+ $this->add_control( 'filter_color', [
464
+ 'label' => __( 'Filter Color', 'livemesh-el-addons' ),
465
+ 'type' => Controls_Manager::COLOR,
466
+ 'selectors' => [
467
+ '{{WRAPPER}} .lae-portfolio-wrap .lae-taxonomy-filter .lae-filter-item a' => 'color: {{VALUE}};',
468
+ ],
469
+ ] );
470
+ $this->add_control( 'filter_hover_color', [
471
+ 'label' => __( 'Filter Hover Color', 'livemesh-el-addons' ),
472
+ 'type' => Controls_Manager::COLOR,
473
+ 'selectors' => [
474
+ '{{WRAPPER}} .lae-portfolio-wrap .lae-taxonomy-filter .lae-filter-item a:hover, {{WRAPPER}} .lae-portfolio-wrap .lae-taxonomy-filter .lae-filter-item.lae-active a' => 'color: {{VALUE}};',
475
+ ],
476
+ ] );
477
+ $this->add_control( 'filter_active_border', [
478
+ 'label' => __( 'Active Filter Border Color', 'livemesh-el-addons' ),
479
+ 'type' => Controls_Manager::COLOR,
480
+ 'selectors' => [
481
+ '{{WRAPPER}} .lae-portfolio-wrap .lae-taxonomy-filter .lae-filter-item.lae-active:after ' => 'border-color: {{VALUE}};',
482
+ ],
483
+ ] );
484
+ $this->add_group_control( Group_Control_Typography::get_type(), [
485
+ 'name' => 'filter_typography',
486
+ 'selector' => '{{WRAPPER}} .lae-portfolio-wrap .lae-taxonomy-filter .lae-filter-item a',
487
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
488
  $this->end_controls_section();
489
+ $this->start_controls_section( 'section_grid_thumbnail_styling', [
490
+ 'label' => __( 'Grid Thumbnail', 'livemesh-el-addons' ),
491
+ 'tab' => Controls_Manager::TAB_STYLE,
492
+ 'condition' => [
493
+ 'grid_skin' => 'classic_skin',
494
+ ],
495
+ ] );
496
+ $this->add_control( 'heading_thumbnail_info', [
497
+ 'label' => __( 'Thumbnail Info Entry Title', 'livemesh-el-addons' ),
498
+ 'type' => Controls_Manager::HEADING,
499
+ 'separator' => 'after',
500
+ ] );
501
+ $this->add_control( 'title_tag', [
502
+ 'label' => __( 'Title HTML Tag', 'livemesh-el-addons' ),
503
+ 'type' => Controls_Manager::SELECT,
504
+ 'options' => [
505
+ 'h1' => __( 'H1', 'livemesh-el-addons' ),
506
+ 'h2' => __( 'H2', 'livemesh-el-addons' ),
507
+ 'h3' => __( 'H3', 'livemesh-el-addons' ),
508
+ 'h4' => __( 'H4', 'livemesh-el-addons' ),
509
+ 'h5' => __( 'H5', 'livemesh-el-addons' ),
510
+ 'h6' => __( 'H6', 'livemesh-el-addons' ),
511
+ 'div' => __( 'div', 'livemesh-el-addons' ),
512
+ ],
513
+ 'default' => 'h3',
514
+ ] );
515
+ $this->add_control( 'title_color', [
516
+ 'label' => __( 'Title Color', 'livemesh-el-addons' ),
517
+ 'type' => Controls_Manager::COLOR,
518
+ 'selectors' => [
519
+ '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-project-image .lae-image-info .lae-post-title a' => 'color: {{VALUE}};',
520
+ ],
521
+ ] );
522
+ $this->add_control( 'title_hover_border_color', [
523
+ 'label' => __( 'Title Hover Border Color', 'livemesh-el-addons' ),
524
+ 'type' => Controls_Manager::COLOR,
525
+ 'selectors' => [
526
+ '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-project-image .lae-image-info .lae-post-title a:hover' => 'border-color: {{VALUE}};',
527
+ ],
528
+ ] );
529
+ $this->add_group_control( Group_Control_Typography::get_type(), [
530
+ 'name' => 'title_typography',
531
+ 'selector' => '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-project-image .lae-image-info .lae-post-title',
532
+ ] );
533
+ $this->add_control( 'heading_thumbnail_info_taxonomy', [
534
+ 'label' => __( 'Thumbnail Info Taxonomy Terms', 'livemesh-el-addons' ),
535
+ 'type' => Controls_Manager::HEADING,
536
+ 'separator' => 'after',
537
+ ] );
538
+ $this->add_control( 'thumbnail_info_tags_color', [
539
+ 'label' => __( 'Taxonomy Terms Color', 'livemesh-el-addons' ),
540
+ 'type' => Controls_Manager::COLOR,
541
+ 'selectors' => [
542
+ '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-project-image .lae-image-info .lae-terms, {{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-project-image .lae-image-info .lae-terms a' => 'color: {{VALUE}};',
543
+ ],
544
+ ] );
545
+ $this->add_control( 'thumbnail_info_tags_hover_color', [
546
+ 'label' => __( 'Taxonomy Terms Hover Color', 'livemesh-el-addons' ),
547
+ 'type' => Controls_Manager::COLOR,
548
+ 'selectors' => [
549
+ '{{WRAPPER}} .lae-block-grid .lae-module .lae-module-image .lae-terms a:hover' => 'color: {{VALUE}};',
550
+ ],
551
+ ] );
552
+ $this->add_group_control( Group_Control_Typography::get_type(), [
553
+ 'name' => 'tags_typography',
554
+ 'selector' => '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-project-image .lae-image-info .lae-terms:hover, {{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-project-image .lae-image-info .lae-terms a:hover',
555
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
556
  $this->end_controls_section();
557
+ $this->start_controls_section( 'section_entry_title_styling', [
558
+ 'label' => __( 'Grid Item Entry Title', 'livemesh-el-addons' ),
559
+ 'tab' => Controls_Manager::TAB_STYLE,
560
+ 'condition' => [
561
+ 'grid_skin' => 'classic_skin',
562
+ ],
563
+ ] );
564
+ $this->add_control( 'entry_title_tag', [
565
+ 'label' => __( 'Entry Title HTML Tag', 'livemesh-el-addons' ),
566
+ 'type' => Controls_Manager::SELECT,
567
+ 'options' => [
568
+ 'h1' => __( 'H1', 'livemesh-el-addons' ),
569
+ 'h2' => __( 'H2', 'livemesh-el-addons' ),
570
+ 'h3' => __( 'H3', 'livemesh-el-addons' ),
571
+ 'h4' => __( 'H4', 'livemesh-el-addons' ),
572
+ 'h5' => __( 'H5', 'livemesh-el-addons' ),
573
+ 'h6' => __( 'H6', 'livemesh-el-addons' ),
574
+ 'div' => __( 'div', 'livemesh-el-addons' ),
575
+ ],
576
+ 'default' => 'h3',
577
+ ] );
578
+ $this->add_control( 'entry_title_color', [
579
+ 'label' => __( 'Entry Title Color', 'livemesh-el-addons' ),
580
+ 'type' => Controls_Manager::COLOR,
581
+ 'selectors' => [
582
+ '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .entry-title a' => 'color: {{VALUE}};',
583
+ ],
584
+ ] );
585
+ $this->add_control( 'entry_title_hover_color', [
586
+ 'label' => __( 'Entry Title Hover Color', 'livemesh-el-addons' ),
587
+ 'type' => Controls_Manager::COLOR,
588
+ 'selectors' => [
589
+ '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .entry-title a:hover' => 'color: {{VALUE}};',
590
+ ],
591
+ ] );
592
+ $this->add_group_control( Group_Control_Typography::get_type(), [
593
+ 'name' => 'entry_title_typography',
594
+ 'selector' => '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .entry-title',
595
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
596
  $this->end_controls_section();
597
+ $this->start_controls_section( 'section_entry_summary_styling', [
598
+ 'label' => __( 'Grid Item Entry Summary', 'livemesh-el-addons' ),
599
+ 'tab' => Controls_Manager::TAB_STYLE,
600
+ ] );
601
+ $this->add_control( 'entry_summary_color', [
602
+ 'label' => __( 'Entry Summary Color', 'livemesh-el-addons' ),
603
+ 'type' => Controls_Manager::COLOR,
604
+ 'selectors' => [
605
+ '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .entry-summary' => 'color: {{VALUE}};',
606
+ ],
607
+ ] );
608
+ $this->add_group_control( Group_Control_Typography::get_type(), [
609
+ 'name' => 'entry_summary_typography',
610
+ 'selector' => '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .entry-summary',
611
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
612
  $this->end_controls_section();
613
+ $this->start_controls_section( 'section_entry_meta_styling', [
614
+ 'label' => __( 'Grid Item Entry Meta', 'livemesh-el-addons' ),
615
+ 'tab' => Controls_Manager::TAB_STYLE,
616
+ 'condition' => [
617
+ 'grid_skin' => 'classic_skin',
618
+ ],
619
+ ] );
620
+ $this->add_control( 'heading_entry_meta', [
621
+ 'label' => __( 'Entry Meta', 'livemesh-el-addons' ),
622
+ 'type' => Controls_Manager::HEADING,
623
+ 'separator' => 'after',
624
+ ] );
625
+ $this->add_control( 'entry_meta_color', [
626
+ 'label' => __( 'Entry Meta Color', 'livemesh-el-addons' ),
627
+ 'type' => Controls_Manager::COLOR,
628
+ 'selectors' => [
629
+ '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-entry-meta span' => 'color: {{VALUE}};',
630
+ ],
631
+ ] );
632
+ $this->add_group_control( Group_Control_Typography::get_type(), [
633
+ 'name' => 'entry_meta_typography',
634
+ 'selector' => '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-entry-meta span',
635
+ ] );
636
+ $this->add_control( 'heading_entry_meta_link', [
637
+ 'label' => __( 'Entry Meta Link', 'livemesh-el-addons' ),
638
+ 'type' => Controls_Manager::HEADING,
639
+ 'separator' => 'after',
640
+ ] );
641
+ $this->add_control( 'entry_meta_link_color', [
642
+ 'label' => __( 'Entry Meta Link Color', 'livemesh-el-addons' ),
643
+ 'type' => Controls_Manager::COLOR,
644
+ 'selectors' => [
645
+ '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-entry-meta span a' => 'color: {{VALUE}};',
646
+ ],
647
+ ] );
648
+ $this->add_group_control( Group_Control_Typography::get_type(), [
649
+ 'name' => 'entry_meta_link_typography',
650
+ 'selector' => '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio .lae-portfolio-item .lae-entry-meta span a',
651
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
652
  $this->end_controls_section();
653
+ $this->start_controls_section( 'section_read_more_styling', [
654
+ 'label' => __( 'Read More', 'livemesh-el-addons' ),
655
+ 'tab' => Controls_Manager::TAB_STYLE,
656
+ 'condition' => [
657
+ 'grid_skin' => 'classic_skin',
658
+ ],
659
+ ] );
660
+ $this->add_control( 'read_more_color', [
661
+ 'label' => __( 'Read More Color', 'livemesh-el-addons' ),
662
+ 'type' => Controls_Manager::COLOR,
663
+ 'selectors' => [
664
+ '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio-item .lae-read-more, {{WRAPPER}} .lae-portfolio-wrap .lae-portfolio-item .lae-read-more a' => 'color: {{VALUE}};',
665
+ ],
666
+ ] );
667
+ $this->add_control( 'read_more_hover_color', [
668
+ 'label' => __( 'Read More Hover Color', 'livemesh-el-addons' ),
669
+ 'type' => Controls_Manager::COLOR,
670
+ 'selectors' => [
671
+ '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio-item .lae-read-more:hover, {{WRAPPER}} .lae-portfolio-wrap .lae-portfolio-item .lae-read-more a:hover' => 'color: {{VALUE}};',
672
+ ],
673
+ ] );
674
+ $this->add_group_control( Group_Control_Typography::get_type(), [
675
+ 'name' => 'read_more_typography',
676
+ 'selector' => '{{WRAPPER}} .lae-portfolio-wrap .lae-portfolio-item .lae-read-more, {{WRAPPER}} .lae-portfolio-wrap .lae-portfolio-item .lae-read-more a',
677
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
678
  $this->end_controls_section();
 
 
679
  }
680
+
681
+ protected function get_item_template_content( $template_id, $settings )
682
+ {
683
  /* Initialize the theme builder templates - Requires elementor pro plugin */
684
+
685
+ if ( !is_plugin_active( 'elementor-pro/elementor-pro.php' ) ) {
686
+ $output = lae_template_error( __( 'Custom skin requires Elementor Pro but the plugin is not installed/active', 'livemesh-el-addons' ) );
687
+ } else {
688
+ $output = lae_get_item_template_content( $template_id, $settings );
689
  }
690
+
691
  return $output;
 
692
  }
693
+
694
+ protected function get_grid_template_content( $template_id, $settings )
695
+ {
696
  /* Initialize the theme builder templates - Requires elementor pro plugin */
697
+
698
+ if ( !is_plugin_active( 'elementor-pro/elementor-pro.php' ) ) {
699
+ $output = lae_template_error( __( 'Custom skin requires Elementor Pro but the plugin is not installed/active', 'livemesh-el-addons' ) );
700
+ } else {
701
+ $output = lae_get_template_content( $template_id, $settings );
702
  }
703
+
704
  return $output;
 
705
  }
706
+
707
+ protected function get_item_template_options()
708
+ {
709
  $template_options = array();
 
710
  /* Initialize the theme builder templates - Requires elementor pro plugin */
711
+
712
+ if ( !is_plugin_active( 'elementor-pro/elementor-pro.php' ) ) {
713
+ $template_options = [
714
+ 0 => __( 'No templates found. Elementor Pro is not installed/active', 'livemesh-el-addons' ),
715
+ ];
716
+ } else {
717
  $templates = lae_get_livemesh_item_templates();
 
718
  //$template_options = [0 => __('Select a template', 'livemesh-el-addons')];
719
+ foreach ( $templates as $template ) {
 
720
  $template_options[$template->ID] = $template->post_title;
721
  }
722
  }
723
+
724
  return $template_options;
725
  }
726
+
727
+ protected function get_grid_template_options()
728
+ {
729
  $template_options = array();
 
730
  /* Initialize the theme builder templates - Requires elementor pro plugin */
731
+
732
+ if ( !is_plugin_active( 'elementor-pro/elementor-pro.php' ) ) {
733
+ $template_options = [
734
+ 0 => __( 'No templates found. Elementor Pro is not installed/active', 'livemesh-el-addons' ),
735
+ ];
736
+ } else {
737
  $templates = lae_get_livemesh_grid_templates();
 
738
  //$template_options = [0 => __('Select a template', 'livemesh-el-addons')];
739
+ foreach ( $templates as $template ) {
 
740
  $template_options[$template->ID] = $template->post_title;
741
  }
742
  }
743
+
744
  return $template_options;
745
  }
746
+
747
+ protected function get_item_templates( $shortcode_pattern, $grid_template_content )
748
+ {
749
  $matches = array();
750
+ preg_match_all( $shortcode_pattern, $grid_template_content, $matches );
751
+ $attributes = array_pop( $matches );
752
+ // fetch last array element
 
 
753
  $item_templates = array();
754
+ foreach ( $attributes as $attribute ) {
755
+ list( $key, $val ) = explode( "=", $attribute );
756
+ $item_templates[] = trim( $val, '"' );
 
 
 
 
757
  }
758
  return $item_templates;
759
  }
760
+
761
+ protected function render()
762
+ {
763
  $settings = $this->get_settings_for_display();
764
+ $settings = apply_filters( 'lae_posts_grid_' . $this->get_id() . '_settings', $settings );
 
 
765
  // Use the processed post selector query to find posts.
766
+ $query_args = lae_build_query_args( $settings );
767
+ $query_args = apply_filters( 'lae_posts_grid_' . $this->get_id() . '_query_args', $query_args, $settings );
768
+ $loop = new \WP_Query( $query_args );
 
 
 
769
  // Loop through the posts and do something with them.
770
+
771
+ if ( $loop->have_posts() ) {
772
+ $dir = ( is_rtl() ? ' dir="rtl"' : '' );
773
+ $target = ( $settings['post_link_new_window'] == 'yes' ? ' target="_blank"' : '' );
 
 
774
  // Check if any taxonomy filter has been applied
775
+ list( $chosen_terms, $taxonomies ) = lae_get_chosen_terms( $query_args );
776
+ if ( empty($chosen_terms) ) {
 
777
  $taxonomies[] = $settings['taxonomy_filter'];
778
+ }
779
  $output = '<div class="lae-portfolio-wrap lae-gapless-grid">';
780
+
781
+ if ( !empty($settings['heading']) || $settings['filterable'] == 'yes' ) {
782
+ $header_class = ( trim( $settings['heading'] ) === '' ? ' lae-no-heading' : '' );
 
 
783
  $grid_header = '<div class="lae-portfolio-header ' . $header_class . '">';
784
+ if ( !empty($settings['heading']) ) {
785
+ $grid_header .= '<' . $settings['heading_tag'] . ' class="lae-heading">' . wp_kses_post( $settings['heading'] ) . '</' . $settings['heading_tag'] . '>';
786
+ }
787
+ if ( $settings['filterable'] == 'yes' ) {
788
+ $grid_header .= lae_get_taxonomy_terms_filter( $taxonomies, $chosen_terms );
789
+ }
 
 
 
 
 
 
790
  $grid_header .= '</div>';
791
+ $output .= apply_filters( 'lae_posts_grid_header', $grid_header, $settings );
792
+ }
793
+
794
+
795
+ if ( $settings['grid_skin'] == 'custom_grid' ) {
 
 
796
  $grid_template_id = $settings['grid_template'];
797
+
798
+ if ( !$grid_template_id ) {
799
+ $output .= lae_template_error( __( 'Choose a custom template for the grid', 'livemesh-el-addons' ) );
800
+ } else {
801
+ $shortcode_pattern = "/\\[livemesh_grid_item (.+?)\\]/";
802
+ $grid_template_content = $this->get_grid_template_content( $grid_template_id, $settings );
803
+ $item_templates = $this->get_item_templates( $shortcode_pattern, $grid_template_content );
 
 
 
 
 
 
804
  $item_template_walker = array();
805
+ $output .= '<div' . $dir . ' id="lae-portfolio-' . uniqid() . '" class="lae-portfolio lae-grid-container ' . 'lae-' . str_replace( '_', '-', $settings['grid_skin'] ) . '">';
 
 
 
 
 
806
  $template_output = '';
807
+ while ( $loop->have_posts() ) {
808
+ $loop->the_post();
809
+
810
+ if ( empty($item_template_walker) ) {
811
  $template_output .= $grid_template_content;
 
812
  $item_template_walker = $item_templates;
 
813
  }
814
+
815
+ $item_template_id = array_shift( $item_template_walker );
816
+ $item_template_content = $this->get_item_template_content( $item_template_id, $settings );
 
 
817
  // Replace the first element with the grid template content for the item
818
+ $template_output = preg_replace(
819
+ $shortcode_pattern,
820
+ $item_template_content,
821
+ $template_output,
822
+ 1
823
+ );
824
+ }
825
  // Replace the remaining shortcode occurrences in the grid template content with a placeholder string
826
+ $template_output = preg_replace( $shortcode_pattern, '', $template_output );
827
+ $output .= apply_filters(
828
+ 'lae_posts_grid_template_output',
829
+ $template_output,
830
+ $loop,
831
+ $settings
832
+ );
833
+ }
834
+
835
+ } else {
836
+ $output .= '<div' . $dir . ' id="lae-portfolio-' . uniqid() . '" class="lae-portfolio js-isotope lae-' . esc_attr( $settings['layout_mode'] ) . ' lae-grid-container ' . 'lae-' . str_replace( '_', '-', $settings['grid_skin'] ) . lae_get_grid_classes( $settings ) . '" data-isotope-options=\'{ "itemSelector": ".lae-portfolio-item", "layoutMode": "' . esc_attr( $settings['layout_mode'] ) . '", "originLeft": ' . esc_attr( ( !is_rtl() ? 'true' : 'false' ) ) . '}\'>';
 
 
 
837
  $current_page = get_queried_object_id();
838
+ while ( $loop->have_posts() ) {
839
+ $loop->the_post();
 
840
  $post_id = get_the_ID();
841
+ if ( $post_id === $current_page ) {
842
+ continue;
843
+ }
844
+ // skip current page since we can run into infinite loop when users choose All option in build query
845
  $style = '';
846
+ foreach ( $taxonomies as $taxonomy ) {
847
+ $terms = get_the_terms( $post_id, $taxonomy );
848
+ if ( !empty($terms) && !is_wp_error( $terms ) ) {
849
+ foreach ( $terms as $term ) {
850
  $style .= ' term-' . $term->term_id;
851
  }
852
  }
853
  }
 
854
  $entry_output = '<div data-id="id-' . $post_id . '" class="lae-grid-item lae-portfolio-item ' . $style . '">';
855
+ $entry_output .= '<article id="post-' . $post_id . '" class="' . join( ' ', get_post_class( '', $post_id ) ) . '">';
856
+
857
+ if ( $settings['grid_skin'] == 'custom_skin' ) {
 
 
858
  $item_template_id = $settings['item_template'];
859
+
860
+ if ( $item_template_id ) {
861
+ $item_template_output = $this->get_item_template_content( $item_template_id, $settings );
862
+ $entry_output .= apply_filters(
863
+ 'lae_posts_grid_item_template_output',
864
+ $item_template_output,
865
+ $item_template_id,
866
+ $post_id,
867
+ $settings
868
+ );
869
+ } else {
870
+ $entry_output .= lae_template_error( __( 'Choose a custom skin template for the grid item', 'livemesh-el-addons' ) );
871
+ }
872
+
873
+ } else {
874
+
875
+ if ( $thumbnail_exists = has_post_thumbnail() ) {
876
  $entry_image = '<div class="lae-project-image">';
877
+ $image_setting = [
878
+ 'id' => get_post_thumbnail_id( $post_id ),
879
+ ];
880
+ $thumbnail_html = lae_get_image_html(
881
+ $image_setting,
882
+ 'thumbnail_size',
883
+ $settings,
884
+ true
885
+ );
886
+ if ( $settings['image_linkable'] == 'yes' ) {
887
  $thumbnail_html = '<a href="' . get_the_permalink() . '"̌̌' . $target . '>' . $thumbnail_html . '</a>';
888
+ }
889
+ $entry_image .= apply_filters(
890
+ 'lae_posts_grid_thumbnail_html',
891
+ $thumbnail_html,
892
+ $image_setting,
893
+ $settings
894
+ );
895
+
896
+ if ( $settings['display_title_on_thumbnail'] == 'yes' || $settings['display_taxonomy_on_thumbnail'] == 'yes' ) {
897
  $image_info = '<div class="lae-image-info">';
 
898
  $image_info .= '<div class="lae-entry-info">';
899
+ if ( $settings['display_title_on_thumbnail'] == 'yes' ) {
 
 
900
  $image_info .= '<' . $settings['title_tag'] . ' class="lae-post-title"><a href="' . get_permalink() . '" title="' . get_the_title() . '" rel="bookmark"' . $target . '>' . get_the_title() . '</a></' . $settings['title_tag'] . '>';
901
+ }
902
+ if ( $settings['display_taxonomy_on_thumbnail'] == 'yes' ) {
903
+ $image_info .= lae_get_info_for_taxonomies( $taxonomies );
904
+ }
 
 
 
 
 
905
  $image_info .= '</div>';
 
906
  $image_info .= '</div><!-- .lae-image-info -->';
907
+ $entry_image .= apply_filters(
908
+ 'lae_posts_grid_image_info',
909
+ $image_info,
910
+ $post_id,
911
+ $settings
912
+ );
913
  $entry_image .= '</div>';
914
+ }
915
+
916
+ $entry_output .= apply_filters(
917
+ 'lae_posts_grid_entry_image',
918
+ $entry_image,
919
+ $image_setting,
920
+ $settings
921
+ );
922
+ }
923
+
924
+
925
+ if ( $settings['display_title'] == 'yes' || $settings['display_summary'] == 'yes' ) {
926
+ $entry_text = '<div class="lae-entry-text-wrap ' . (( $thumbnail_exists ? '' : ' nothumbnail' )) . '">';
927
+
928
+ if ( $settings['display_title'] == 'yes' ) {
929
  $entry_title = '<' . $settings['entry_title_tag'] . ' class="entry-title"><a href="' . get_permalink() . '" title="' . get_the_title() . '" rel="bookmark"' . $target . '>' . get_the_title() . '</a></' . $settings['entry_title_tag'] . '>';
930
+ $entry_text .= apply_filters(
931
+ 'lae_posts_grid_entry_title',
932
+ $entry_title,
933
+ $post_id,
934
+ $settings
935
+ );
936
+ }
937
+
938
+
939
+ if ( $settings['display_post_date'] == 'yes' || $settings['display_author'] == 'yes' || $settings['display_taxonomy'] == 'yes' ) {
940
  $entry_meta = '<div class="lae-entry-meta">';
941
+ if ( $settings['display_author'] == 'yes' ) {
 
 
942
  $entry_meta .= lae_entry_author();
943
+ }
944
+ if ( $settings['display_post_date'] == 'yes' ) {
 
 
 
945
  $entry_meta .= lae_entry_published();
946
+ }
947
+ if ( $settings['display_taxonomy'] == 'yes' ) {
948
+ $entry_meta .= lae_get_info_for_taxonomies( $taxonomies );
949
+ }
 
 
 
 
 
950
  $entry_meta .= '</div>';
951
+ $entry_text .= apply_filters(
952
+ 'lae_posts_grid_entry_meta',
953
+ $entry_meta,
954
+ $post_id,
955
+ $settings
956
+ );
957
+ }
958
+
959
+
960
+ if ( $settings['display_summary'] == 'yes' ) {
961
  $excerpt = '<div class="entry-summary">';
 
962
  $excerpt .= get_the_excerpt();
 
963
  $excerpt .= '</div>';
964
+ $entry_text .= apply_filters(
965
+ 'lae_posts_grid_entry_excerpt',
966
+ $excerpt,
967
+ $post_id,
968
+ $settings
969
+ );
970
+ }
971
+
972
+
973
+ if ( $settings['display_read_more'] == 'yes' ) {
974
  $read_more_text = $settings['read_more_text'];
 
975
  $read_more = '<div class="lae-read-more">';
 
976
  $read_more .= '<a href="' . get_the_permalink() . '"' . $target . '>' . $read_more_text . '</a>';
 
977
  $read_more .= '</div>';
978
+ $entry_text .= apply_filters(
979
+ 'lae_posts_grid_read_more_link',
980
+ $read_more,
981
+ $post_id,
982
+ $settings
983
+ );
984
+ }
985
+
986
  $entry_text .= '</div>';
987
+ $entry_output .= apply_filters(
988
+ 'lae_posts_grid_entry_text',
989
+ $entry_text,
990
+ $post_id,
991
+ $settings
992
+ );
993
+ }
994
+
995
+ }
996
+
997
  $entry_output .= '</article><!-- .hentry -->';
 
998
  $entry_output .= '</div>';
999
+ $output .= apply_filters(
1000
+ 'lae_posts_grid_entry_output',
1001
+ $entry_output,
1002
+ $post_id,
1003
+ $settings
1004
+ );
1005
+ }
1006
  wp_reset_postdata();
 
1007
  $output .= '</div><!-- .lae-portfolio -->';
 
1008
  $output .= '</div><!-- .lae-portfolio-wrap -->';
1009
+ }
1010
+
1011
+ echo apply_filters( 'lae_posts_grid_output', $output, $settings ) ;
1012
+ }
1013
+
 
 
1014
  }
1015
+
1016
+ protected function content_template()
1017
+ {
1018
  }
1019
 
1020
  }
includes/widgets/posts-carousel.php CHANGED
@@ -6,42 +6,47 @@ Description: Display blog posts or custom post types as a carousel.
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
9
-
10
  namespace LivemeshAddons\Widgets;
11
 
12
- use Elementor\Widget_Base;
13
- use Elementor\Controls_Manager;
14
- use Elementor\Scheme_Color;
15
- use Elementor\Group_Control_Typography;
16
- use Elementor\Group_Control_Image_Size;
17
- use Elementor\Scheme_Typography;
18
-
19
- if (!defined('ABSPATH'))
20
- exit; // Exit if accessed directly
21
-
22
- class LAE_Posts_Carousel_Widget extends LAE_Widget_Base {
23
-
24
- public function get_name() {
 
25
  return 'lae-posts-carousel';
26
  }
27
-
28
- public function get_title() {
29
- return __('Posts Carousel', 'livemesh-el-addons');
 
30
  }
31
-
32
- public function get_icon() {
 
33
  return 'lae-icon-posts-carousel';
34
  }
35
-
36
- public function get_categories() {
37
- return array('livemesh-addons');
 
38
  }
39
-
40
- public function get_custom_help_url() {
 
41
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/posts-carousel/';
42
  }
43
-
44
- public function get_script_depends() {
 
45
  return [
46
  'lae-jquery-slick',
47
  'lae-frontend-scripts',
@@ -49,8 +54,9 @@ class LAE_Posts_Carousel_Widget extends LAE_Widget_Base {
49
  'lae-posts-carousel-scripts'
50
  ];
51
  }
52
-
53
- public function get_style_depends() {
 
54
  return [
55
  'lae-icomoon-styles',
56
  'lae-slick-carousel-styles',
@@ -59,1004 +65,659 @@ class LAE_Posts_Carousel_Widget extends LAE_Widget_Base {
59
  'lae-posts-carousel-styles'
60
  ];
61
  }
62
-
63
- protected function _register_controls() {
64
-
65
- $this->start_controls_section(
66
- 'section_query',
67
- [
68
- 'label' => __('Posts Query', 'livemesh-el-addons'),
69
- ]
70
- );
71
-
72
- $this->add_control(
73
- 'query_type',
74
- [
75
- 'label' => __('Source', 'livemesh-el-addons'),
76
- 'type' => Controls_Manager::SELECT,
77
- 'options' => array(
78
- 'custom_query' => __('Custom Query', 'livemesh-el-addons'),
79
- 'current_query' => __('Current Query', 'livemesh-el-addons'),
80
- 'related' => __('Related', 'livemesh-el-addons'),
81
- ),
82
- 'default' => 'custom_query',
83
- ]
84
- );
85
-
86
- $this->add_control(
87
- 'post_types',
88
- [
89
- 'label' => __('Post Types', 'livemesh-el-addons'),
90
- 'type' => Controls_Manager::SELECT2,
91
- 'default' => 'post',
92
- 'options' => lae_get_all_post_type_options(),
93
- 'multiple' => true,
94
- 'condition' => [
95
- 'query_type' => 'custom_query'
96
- ]
97
- ]
98
- );
99
-
100
- $this->add_control(
101
- 'taxonomies',
102
- [
103
- 'type' => Controls_Manager::SELECT2,
104
- 'label' => __('Choose the taxonomies to display related posts.', 'livemesh-el-addons'),
105
- 'label_block' => true,
106
- 'description' => __('Choose the taxonomies to be used for displaying posts related to current post, page or custom post type.', 'livemesh-el-addons'),
107
- 'options' => lae_get_taxonomies_map(),
108
- 'default' => 'category',
109
- 'multiple' => true,
110
- 'condition' => [
111
- 'query_type' => 'related'
112
- ]
113
- ]
114
- );
115
-
116
- $this->add_control(
117
- 'tax_query',
118
- [
119
- 'label' => __('Taxonomies', 'livemesh-el-addons'),
120
- 'type' => Controls_Manager::SELECT2,
121
- 'options' => lae_get_all_taxonomy_options(),
122
- 'multiple' => true,
123
- 'label_block' => true,
124
- 'condition' => [
125
- 'query_type' => 'custom_query'
126
- ]
127
- ]
128
- );
129
-
130
- $this->add_control(
131
- 'post_in',
132
- [
133
- 'label' => __('Post In', 'livemesh-el-addons'),
134
- 'description' => __('Provide a comma separated list of Post IDs to display in the grid.', 'livemesh-el-addons'),
135
- 'type' => Controls_Manager::TEXT,
136
- 'label_block' => true,
137
- 'condition' => [
138
- 'query_type' => 'custom_query'
139
- ]
140
- ]
141
- );
142
-
143
- $this->add_control(
144
- 'posts_per_page',
145
- [
146
- 'label' => __('Posts Per Page', 'livemesh-el-addons'),
147
- 'type' => Controls_Manager::NUMBER,
148
- 'min' => 1,
149
- 'max' => 50,
150
- 'step' => 1,
151
- 'default' => 6,
152
- 'condition' => [
153
- 'query_type' => ['custom_query', 'related']
154
- ]
155
- ]
156
- );
157
-
158
- $this->add_control(
159
- 'advanced',
160
- [
161
- 'label' => __('Advanced', 'livemesh-el-addons'),
162
- 'type' => Controls_Manager::HEADING,
163
- 'condition' => [
164
- 'query_type' => ['custom_query', 'related']
165
- ]
166
- ]
167
- );
168
-
169
- $this->add_control(
170
- 'orderby',
171
- [
172
- 'label' => __('Order By', 'livemesh-el-addons'),
173
- 'type' => Controls_Manager::SELECT,
174
- 'options' => array(
175
- 'none' => __('No order', 'livemesh-el-addons'),
176
- 'ID' => __('Post ID', 'livemesh-el-addons'),
177
- 'author' => __('Author', 'livemesh-el-addons'),
178
- 'title' => __('Title', 'livemesh-el-addons'),
179
- 'date' => __('Published date', 'livemesh-el-addons'),
180
- 'modified' => __('Modified date', 'livemesh-el-addons'),
181
- 'parent' => __('By parent', 'livemesh-el-addons'),
182
- 'rand' => __('Random order', 'livemesh-el-addons'),
183
- 'comment_count' => __('Comment count', 'livemesh-el-addons'),
184
- 'menu_order' => __('Menu order', 'livemesh-el-addons'),
185
- 'post__in' => __('By include order', 'livemesh-el-addons'),
186
- ),
187
- 'default' => 'date',
188
- 'condition' => [
189
- 'query_type' => ['custom_query', 'related']
190
- ]
191
- ]
192
- );
193
-
194
- $this->add_control(
195
- 'order',
196
- [
197
- 'label' => __('Order', 'livemesh-el-addons'),
198
- 'type' => Controls_Manager::SELECT,
199
- 'options' => array(
200
- 'ASC' => __('Ascending', 'livemesh-el-addons'),
201
- 'DESC' => __('Descending', 'livemesh-el-addons'),
202
- ),
203
- 'default' => 'DESC',
204
- 'condition' => [
205
- 'query_type' => ['custom_query', 'related']
206
- ]
207
- ]
208
- );
209
-
210
-
211
- $this->add_control(
212
- 'offset',
213
- [
214
- 'label' => __('Offset', 'livemesh-el-addons'),
215
- 'description' => __('Number of posts to skip or pass over.', 'livemesh-el-addons'),
216
- 'type' => Controls_Manager::NUMBER,
217
- 'default' => 0,
218
- 'condition' => [
219
- 'query_type' => 'custom_query'
220
- ]
221
- ]
222
- );
223
-
224
  $this->end_controls_section();
225
-
226
- $this->start_controls_section(
227
- 'section_carousel_skin',
228
- [
229
- 'label' => __('Carousel Skin', 'livemesh-el-addons'),
230
- ]
231
- );
232
-
233
- $this->add_control(
234
- 'carousel_skin',
235
- [
236
- 'label' => __('Choose Carousel Skin', 'livemesh-el-addons'),
237
- 'description' => __('The "Classic Skin" is the built-in styling provided for the carousel items. Choose "Custom Skin" if you want to use theme builder template for the carousel items.', 'livemesh-el-addons'),
238
- 'type' => Controls_Manager::SELECT,
239
- 'options' => array(
240
- 'classic_skin' => __('Classic Skin', 'livemesh-el-addons'),
241
- 'custom_skin' => __('Custom Skin', 'livemesh-el-addons'),
242
- ),
243
- 'default' => 'classic_skin',
244
- ]
245
- );
246
-
247
- $this->add_control(
248
- 'item_template',
249
- [
250
- 'label' => __('Select the custom skin template for the carousel item', 'livemesh-el-addons'),
251
- 'description' => '<div style="text-align:center;font-style: normal;">'
252
- . '<a target="_blank" class="elementor-button elementor-button-default" href="'
253
- . esc_url(admin_url('/edit.php?post_type=elementor_library&tabs_group=theme&elementor_library_type=livemesh_item'))
254
- . '">'
255
- . __('Create/Edit the Item Skin Builder Templates', 'livemesh-el-addons')
256
- . '</a>'
257
- . '</div>',
258
- 'type' => Controls_Manager::SELECT,
259
- 'label_block' => true,
260
- 'default' => [],
261
- 'options' => $this->get_item_template_options(),
262
- 'condition' => [
263
- 'carousel_skin' => 'custom_skin'
264
- ],
265
- ]
266
- );
267
-
268
  $this->end_controls_section();
269
-
270
- $this->start_controls_section(
271
- 'section_post_content',
272
- [
273
- 'label' => __('Post Content', 'livemesh-el-addons'),
274
- 'condition' => [
275
- 'carousel_skin' => 'classic_skin'
276
- ],
277
- ]
278
- );
279
-
280
- $this->add_control(
281
- 'taxonomy_chosen',
282
- [
283
- 'label' => __('Choose the taxonomy to display info.', 'livemesh-el-addons'),
284
- 'description' => __('Choose the taxonomy to use for display of taxonomy information for posts/custom post types.', 'livemesh-el-addons'),
285
- 'type' => Controls_Manager::SELECT,
286
- 'label_block' => true,
287
- 'default' => 'category',
288
- 'options' => lae_get_taxonomies_map(),
289
- ]
290
- );
291
-
292
-
293
-
294
- $this->add_control(
295
- 'display_thumbnail',
296
- [
297
- 'label' => __('Display post thumbnail?', 'livemesh-el-addons'),
298
- 'type' => Controls_Manager::SWITCHER,
299
- 'label_on' => __('Yes', 'livemesh-el-addons'),
300
- 'label_off' => __('No', 'livemesh-el-addons'),
301
- 'return_value' => 'yes',
302
- 'default' => 'yes',
303
- ]
304
- );
305
-
306
- $this->add_group_control(
307
- Group_Control_Image_Size::get_type(),
308
- [
309
- 'name' => 'thumbnail_size',
310
- 'label' => __('Image Size', 'livemesh-el-addons'),
311
- 'default' => 'large',
312
- 'condition' => [
313
- 'display_thumbnail' => 'yes'
314
- ],
315
- ]
316
- );
317
-
318
- $this->add_control(
319
- 'image_linkable',
320
- [
321
- 'label' => __('Link Images to Posts?', 'livemesh-el-addons'),
322
- 'type' => Controls_Manager::SWITCHER,
323
- 'label_on' => __('Yes', 'livemesh-el-addons'),
324
- 'label_off' => __('No', 'livemesh-el-addons'),
325
- 'return_value' => 'yes',
326
- 'default' => 'yes',
327
- 'condition' => [
328
- 'display_thumbnail' => 'yes'
329
- ],
330
- ]
331
- );
332
-
333
- $this->add_control(
334
- 'post_link_new_window',
335
- [
336
- 'label' => __('Open post links in new window?', 'livemesh-el-addons'),
337
- 'type' => Controls_Manager::SWITCHER,
338
- 'label_on' => __('Yes', 'livemesh-el-addons'),
339
- 'label_off' => __('No', 'livemesh-el-addons'),
340
- 'return_value' => 'yes',
341
- 'default' => '',
342
- ]
343
- );
344
-
345
- $this->add_control(
346
- 'display_title_on_thumbnail',
347
- [
348
- 'label' => __('Display posts title on the post/portfolio thumbnail?', 'livemesh-el-addons'),
349
- 'type' => Controls_Manager::SWITCHER,
350
- 'label_on' => __('Yes', 'livemesh-el-addons'),
351
- 'label_off' => __('No', 'livemesh-el-addons'),
352
- 'return_value' => 'yes',
353
- 'default' => 'yes',
354
- 'condition' => [
355
- 'display_thumbnail' => 'yes'
356
- ],
357
- ]
358
- );
359
-
360
- $this->add_control(
361
- 'display_taxonomy_on_thumbnail',
362
- [
363
- 'label' => __('Display taxonomy info on post/project thumbnail?', 'livemesh-el-addons'),
364
- 'type' => Controls_Manager::SWITCHER,
365
- 'label_on' => __('Yes', 'livemesh-el-addons'),
366
- 'label_off' => __('No', 'livemesh-el-addons'),
367
- 'return_value' => 'yes',
368
- 'default' => 'yes',
369
- 'condition' => [
370
- 'display_thumbnail' => 'yes'
371
- ],
372
- ]
373
- );
374
-
375
- $this->add_control(
376
- 'display_title',
377
- [
378
- 'label' => __('Display posts title?', 'livemesh-el-addons'),
379
- 'type' => Controls_Manager::SWITCHER,
380
- 'label_on' => __('Yes', 'livemesh-el-addons'),
381
- 'label_off' => __('No', 'livemesh-el-addons'),
382
- 'return_value' => 'yes',
383
- 'default' => 'yes',
384
- ]
385
- );
386
-
387
- $this->add_control(
388
- 'display_summary',
389
- [
390
- 'label' => __('Display post excerpt/summary?', 'livemesh-el-addons'),
391
- 'type' => Controls_Manager::SWITCHER,
392
- 'label_on' => __('Yes', 'livemesh-el-addons'),
393
- 'label_off' => __('No', 'livemesh-el-addons'),
394
- 'return_value' => 'yes',
395
- 'default' => 'yes',
396
- ]
397
- );
398
-
399
- $this->add_control(
400
- 'display_author',
401
- [
402
- 'label' => __('Display post author info?', 'livemesh-el-addons'),
403
- 'type' => Controls_Manager::SWITCHER,
404
- 'label_on' => __('Yes', 'livemesh-el-addons'),
405
- 'label_off' => __('No', 'livemesh-el-addons'),
406
- 'return_value' => 'yes',
407
- 'default' => 'no',
408
- ]
409
- );
410
-
411
- $this->add_control(
412
- 'display_post_date',
413
- [
414
- 'label' => __('Display post date info?', 'livemesh-el-addons'),
415
- 'type' => Controls_Manager::SWITCHER,
416
- 'label_on' => __('Yes', 'livemesh-el-addons'),
417
- 'label_off' => __('No', 'livemesh-el-addons'),
418
- 'return_value' => 'yes',
419
- 'default' => 'no',
420
- ]
421
- );
422
-
423
-
424
- $this->add_control(
425
- 'display_taxonomy',
426
- [
427
- 'label' => __('Display taxonomy info?', 'livemesh-el-addons'),
428
- 'type' => Controls_Manager::SWITCHER,
429
- 'label_on' => __('Yes', 'livemesh-el-addons'),
430
- 'label_off' => __('No', 'livemesh-el-addons'),
431
- 'return_value' => 'yes',
432
- 'default' => 'no',
433
- ]
434
- );
435
-
436
- $this->add_control(
437
- 'display_read_more',
438
- [
439
- 'label' => __('Display read more link to the post/portfolio?', 'livemesh-el-addons'),
440
- 'type' => Controls_Manager::SWITCHER,
441
- 'label_on' => __('Yes', 'livemesh-el-addons'),
442
- 'label_off' => __('No', 'livemesh-el-addons'),
443
- 'return_value' => 'yes',
444
- 'default' => 'no',
445
- ]
446
- );
447
-
448
- $this->add_control(
449
- 'read_more_text',
450
- [
451
- 'label' => __('Read more text', 'livemesh-el-addons'),
452
- 'type' => Controls_Manager::TEXT,
453
- "description" => __('Specify the text for the read more link/button', 'livemesh-el-addons'),
454
- 'default' => __('Read More', 'livemesh-el-addons'),
455
- 'condition' => [
456
- 'display_read_more' => ['yes']
457
- ],
458
- ]
459
- );
460
-
461
  $this->end_controls_section();
462
-
463
- $this->start_controls_section(
464
- 'section_carousel_settings',
465
- [
466
- 'label' => __('Carousel Settings', 'livemesh-el-addons'),
467
- 'tab' => Controls_Manager::TAB_SETTINGS,
468
- ]
469
- );
470
-
471
- $this->add_control(
472
- 'arrows',
473
- [
474
- 'type' => Controls_Manager::SWITCHER,
475
- 'label_off' => __('No', 'livemesh-el-addons'),
476
- 'label_on' => __('Yes', 'livemesh-el-addons'),
477
- 'return_value' => 'yes',
478
- 'default' => 'yes',
479
- 'label' => __('Prev/Next Arrows?', 'livemesh-el-addons'),
480
- ]
481
- );
482
-
483
-
484
- $this->add_control(
485
- 'dots',
486
- [
487
- 'type' => Controls_Manager::SWITCHER,
488
- 'label_off' => __('No', 'livemesh-el-addons'),
489
- 'label_on' => __('Yes', 'livemesh-el-addons'),
490
- 'return_value' => 'yes',
491
- 'default' => 'no',
492
- 'label' => __('Show dot indicators for navigation?', 'livemesh-el-addons'),
493
- ]
494
- );
495
-
496
- $this->add_control(
497
- 'pause_on_hover',
498
- [
499
- 'type' => Controls_Manager::SWITCHER,
500
- 'label_off' => __('No', 'livemesh-el-addons'),
501
- 'label_on' => __('Yes', 'livemesh-el-addons'),
502
- 'return_value' => 'yes',
503
- 'default' => 'yes',
504
- 'label' => __('Pause on Hover?', 'livemesh-el-addons'),
505
- ]
506
- );
507
-
508
- $this->add_control(
509
- 'autoplay',
510
- [
511
- 'type' => Controls_Manager::SWITCHER,
512
- 'label_off' => __('No', 'livemesh-el-addons'),
513
- 'label_on' => __('Yes', 'livemesh-el-addons'),
514
- 'return_value' => 'yes',
515
- 'default' => 'no',
516
- 'label' => __('Autoplay?', 'livemesh-el-addons'),
517
- 'description' => __('Should the carousel autoplay as in a slideshow.', 'livemesh-el-addons'),
518
- ]
519
- );
520
-
521
- $this->add_control(
522
- 'adaptive_height',
523
- [
524
- 'type' => Controls_Manager::SWITCHER,
525
- 'label_off' => __('No', 'livemesh-el-addons'),
526
- 'label_on' => __('Yes', 'livemesh-el-addons'),
527
- 'return_value' => 'yes',
528
- 'default' => 'no',
529
- 'label' => __('Adaptive Height?', 'livemesh-el-addons'),
530
- 'description' => __('Enables adaptive height for single slide horizontal carousels.', 'livemesh-el-addons'),
531
- ]
532
- );
533
-
534
- $this->add_control(
535
- 'autoplay_speed',
536
- [
537
- 'label' => __('Autoplay speed in ms', 'livemesh-el-addons'),
538
- 'type' => Controls_Manager::NUMBER,
539
- 'default' => 3000,
540
- ]
541
- );
542
-
543
-
544
- $this->add_control(
545
- 'animation_speed',
546
- [
547
- 'label' => __('Autoplay animation speed in ms', 'livemesh-el-addons'),
548
- 'type' => Controls_Manager::NUMBER,
549
- 'default' => 300,
550
- ]
551
- );
552
-
553
  $this->end_controls_section();
554
-
555
- $this->start_controls_section(
556
- 'section_responsive',
557
- [
558
- 'label' => __('Responsive Options', 'livemesh-el-addons'),
559
- 'tab' => Controls_Manager::TAB_SETTINGS,
560
- ]
561
- );
562
-
563
- $this->add_control(
564
- 'heading_desktop',
565
- [
566
- 'label' => __('Desktop', 'livemesh-el-addons'),
567
- 'type' => Controls_Manager::HEADING,
568
- 'separator' => 'after',
569
- ]
570
- );
571
-
572
-
573
- $this->add_control(
574
- 'gutter',
575
- [
576
- 'label' => __('Gutter', 'livemesh-el-addons'),
577
- 'description' => __('Space between columns.', 'livemesh-el-addons'),
578
- 'type' => Controls_Manager::NUMBER,
579
- 'default' => 10,
580
- 'selectors' => [
581
- '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item' => 'padding: {{VALUE}}px;',
582
- ],
583
- ]
584
- );
585
-
586
- $this->add_control(
587
- 'display_columns',
588
- [
589
- 'label' => __('Columns per row', 'livemesh-el-addons'),
590
- 'type' => Controls_Manager::NUMBER,
591
- 'min' => 1,
592
- 'max' => 5,
593
- 'step' => 1,
594
- 'default' => 3,
595
- ]
596
- );
597
-
598
-
599
- $this->add_control(
600
- 'scroll_columns',
601
- [
602
- 'label' => __('Columns to scroll', 'livemesh-el-addons'),
603
- 'type' => Controls_Manager::NUMBER,
604
- 'min' => 1,
605
- 'max' => 5,
606
- 'step' => 1,
607
- 'default' => 3,
608
- ]
609
- );
610
-
611
- $this->add_control(
612
- 'heading_tablet',
613
- [
614
- 'label' => __('Tablet', 'livemesh-el-addons'),
615
- 'type' => Controls_Manager::HEADING,
616
- 'separator' => 'after',
617
- ]
618
- );
619
-
620
- $this->add_control(
621
- 'tablet_gutter',
622
- [
623
- 'label' => __('Gutter', 'livemesh-el-addons'),
624
- 'description' => __('Space between columns.', 'livemesh-el-addons'),
625
- 'type' => Controls_Manager::NUMBER,
626
- 'default' => 10,
627
- 'selectors' => [
628
- '(tablet-){{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item' => 'padding: {{VALUE}}px;',
629
- ],
630
- ]
631
- );
632
-
633
-
634
- $this->add_control(
635
- 'tablet_display_columns',
636
- [
637
- 'label' => __('Columns per row', 'livemesh-el-addons'),
638
- 'type' => Controls_Manager::NUMBER,
639
- 'min' => 1,
640
- 'max' => 5,
641
- 'step' => 1,
642
- 'default' => 2,
643
- ]
644
- );
645
-
646
- $this->add_control(
647
- 'tablet_scroll_columns',
648
- [
649
- 'label' => __('Columns to scroll', 'livemesh-el-addons'),
650
- 'type' => Controls_Manager::NUMBER,
651
- 'min' => 1,
652
- 'max' => 5,
653
- 'step' => 1,
654
- 'default' => 2,
655
- ]
656
- );
657
-
658
- $this->add_control(
659
- 'tablet_width',
660
- [
661
- 'label' => __('Tablet Resolution', 'livemesh-el-addons'),
662
- 'description' => __('The resolution to treat as a tablet resolution.', 'livemesh-el-addons'),
663
- 'type' => Controls_Manager::NUMBER,
664
- 'default' => 800,
665
- ]
666
- );
667
-
668
-
669
- $this->add_control(
670
- 'heading_mobile',
671
- [
672
- 'label' => __('Mobile Phone', 'livemesh-el-addons'),
673
- 'type' => Controls_Manager::HEADING,
674
- 'separator' => 'after',
675
- ]
676
- );
677
-
678
- $this->add_control(
679
- 'mobile_gutter',
680
- [
681
- 'label' => __('Mobile Gutter', 'livemesh-el-addons'),
682
- 'description' => __('Space between columns.', 'livemesh-el-addons'),
683
- 'type' => Controls_Manager::NUMBER,
684
- 'default' => 10,
685
- 'selectors' => [
686
- '(mobile-){{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item' => 'padding: {{VALUE}}px;',
687
- ],
688
- ]
689
- );
690
-
691
- $this->add_control(
692
- 'mobile_display_columns',
693
- [
694
- 'label' => __('Columns per row', 'livemesh-el-addons'),
695
- 'type' => Controls_Manager::NUMBER,
696
- 'min' => 1,
697
- 'max' => 3,
698
- 'step' => 1,
699
- 'default' => 1,
700
- ]
701
- );
702
-
703
- $this->add_control(
704
- 'mobile_scroll_columns',
705
- [
706
- 'label' => __('Columns to scroll', 'livemesh-el-addons'),
707
- 'type' => Controls_Manager::NUMBER,
708
- 'min' => 1,
709
- 'max' => 3,
710
- 'step' => 1,
711
- 'default' => 1,
712
- ]
713
- );
714
-
715
- $this->add_control(
716
- 'mobile_width',
717
- [
718
- 'label' => __('Mobile Resolution', 'livemesh-el-addons'),
719
- 'description' => __('The resolution to treat as a mobile resolution.', 'livemesh-el-addons'),
720
- 'type' => Controls_Manager::NUMBER,
721
- 'default' => 480,
722
- ]
723
- );
724
-
725
-
726
  $this->end_controls_section();
727
-
728
- $this->start_controls_section(
729
- 'section_carousel_item_thumbnail_styling',
730
- [
731
- 'label' => __('Post Thumbnail', 'livemesh-el-addons'),
732
- 'tab' => Controls_Manager::TAB_STYLE,
733
- 'condition' => [
734
- 'carousel_skin' => 'classic_skin'
735
- ],
736
- ]
737
- );
738
-
739
- $this->add_control(
740
- 'heading_thumbnail_info',
741
- [
742
- 'label' => __('Thumbnail Info Entry Title', 'livemesh-el-addons'),
743
- 'type' => Controls_Manager::HEADING,
744
- 'separator' => 'after',
745
- ]
746
- );
747
-
748
- $this->add_control(
749
- 'title_tag',
750
- [
751
- 'label' => __('Title HTML Tag', 'livemesh-el-addons'),
752
- 'type' => Controls_Manager::SELECT,
753
- 'options' => [
754
- 'h1' => __('H1', 'livemesh-el-addons'),
755
- 'h2' => __('H2', 'livemesh-el-addons'),
756
- 'h3' => __('H3', 'livemesh-el-addons'),
757
- 'h4' => __('H4', 'livemesh-el-addons'),
758
- 'h5' => __('H5', 'livemesh-el-addons'),
759
- 'h6' => __('H6', 'livemesh-el-addons'),
760
- 'div' => __('div', 'livemesh-el-addons'),
761
- ],
762
- 'default' => 'h3',
763
- ]
764
- );
765
-
766
- $this->add_control(
767
- 'title_color',
768
- [
769
- 'label' => __('Title Color', 'livemesh-el-addons'),
770
- 'type' => Controls_Manager::COLOR,
771
- 'selectors' => [
772
- '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-project-image .lae-image-info .lae-post-title a' => 'color: {{VALUE}};',
773
- ],
774
- ]
775
- );
776
-
777
- $this->add_control(
778
- 'title_hover_border_color',
779
- [
780
- 'label' => __('Title Hover Border Color', 'livemesh-el-addons'),
781
- 'type' => Controls_Manager::COLOR,
782
- 'selectors' => [
783
- '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-project-image .lae-image-info .lae-post-title a:hover' => 'border-color: {{VALUE}};',
784
- ],
785
- ]
786
- );
787
-
788
- $this->add_group_control(
789
- Group_Control_Typography::get_type(),
790
- [
791
- 'name' => 'title_typography',
792
- 'selector' => '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-project-image .lae-image-info .lae-post-title',
793
- ]
794
- );
795
-
796
- $this->add_control(
797
- 'heading_thumbnail_info_taxonomy',
798
- [
799
- 'label' => __('Thumbnail Info Taxonomy Terms', 'livemesh-el-addons'),
800
- 'type' => Controls_Manager::HEADING,
801
- 'separator' => 'after',
802
- ]
803
- );
804
-
805
- $this->add_control(
806
- 'thumbnail_info_tags_color',
807
- [
808
- 'label' => __('Taxonomy Terms Color', 'livemesh-el-addons'),
809
- 'type' => Controls_Manager::COLOR,
810
- 'selectors' => [
811
- '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-project-image .lae-image-info .lae-terms, {{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-project-image .lae-image-info .lae-terms a' => 'color: {{VALUE}};',
812
- ],
813
- ]
814
- );
815
-
816
- $this->add_group_control(
817
- Group_Control_Typography::get_type(),
818
- [
819
- 'name' => 'tags_typography',
820
- 'selector' => '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-project-image .lae-image-info .lae-terms, {{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-project-image .lae-image-info .lae-terms a',
821
- ]
822
- );
823
-
824
  $this->end_controls_section();
825
-
826
- $this->start_controls_section(
827
- 'section_entry_title_styling',
828
- [
829
- 'label' => __('Post Entry Title', 'livemesh-el-addons'),
830
- 'tab' => Controls_Manager::TAB_STYLE,
831
- 'condition' => [
832
- 'carousel_skin' => 'classic_skin'
833
- ],
834
- ]
835
- );
836
-
837
- $this->add_control(
838
- 'entry_title_tag',
839
- [
840
- 'label' => __('Entry Title HTML Tag', 'livemesh-el-addons'),
841
- 'type' => Controls_Manager::SELECT,
842
- 'options' => [
843
- 'h1' => __('H1', 'livemesh-el-addons'),
844
- 'h2' => __('H2', 'livemesh-el-addons'),
845
- 'h3' => __('H3', 'livemesh-el-addons'),
846
- 'h4' => __('H4', 'livemesh-el-addons'),
847
- 'h5' => __('H5', 'livemesh-el-addons'),
848
- 'h6' => __('H6', 'livemesh-el-addons'),
849
- 'div' => __('div', 'livemesh-el-addons'),
850
- ],
851
- 'default' => 'h3',
852
- ]
853
- );
854
-
855
- $this->add_control(
856
- 'entry_title_color',
857
- [
858
- 'label' => __('Entry Title Color', 'livemesh-el-addons'),
859
- 'type' => Controls_Manager::COLOR,
860
- 'selectors' => [
861
- '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .entry-title a' => 'color: {{VALUE}};',
862
- ],
863
- ]
864
- );
865
-
866
- $this->add_group_control(
867
- Group_Control_Typography::get_type(),
868
- [
869
- 'name' => 'entry_title_typography',
870
- 'selector' => '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .entry-title',
871
- ]
872
- );
873
-
874
  $this->end_controls_section();
875
-
876
- $this->start_controls_section(
877
- 'section_entry_summary_styling',
878
- [
879
- 'label' => __('Post Entry Summary', 'livemesh-el-addons'),
880
- 'tab' => Controls_Manager::TAB_STYLE,
881
- 'condition' => [
882
- 'carousel_skin' => 'classic_skin'
883
- ],
884
- ]
885
- );
886
-
887
- $this->add_control(
888
- 'entry_summary_color',
889
- [
890
- 'label' => __('Entry Summary Color', 'livemesh-el-addons'),
891
- 'type' => Controls_Manager::COLOR,
892
- 'selectors' => [
893
- '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .entry-summary' => 'color: {{VALUE}};',
894
- ],
895
- ]
896
- );
897
-
898
- $this->add_group_control(
899
- Group_Control_Typography::get_type(),
900
- [
901
- 'name' => 'entry_summary_typography',
902
- 'selector' => '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .entry-summary',
903
- ]
904
- );
905
-
906
  $this->end_controls_section();
907
-
908
- $this->start_controls_section(
909
- 'section_entry_meta_styling',
910
- [
911
- 'label' => __('Post Entry Meta', 'livemesh-el-addons'),
912
- 'tab' => Controls_Manager::TAB_STYLE,
913
- 'condition' => [
914
- 'carousel_skin' => 'classic_skin'
915
- ],
916
- ]
917
- );
918
-
919
- $this->add_control(
920
- 'heading_entry_meta',
921
- [
922
- 'label' => __('Entry Meta', 'livemesh-el-addons'),
923
- 'type' => Controls_Manager::HEADING,
924
- 'separator' => 'after',
925
- ]
926
- );
927
-
928
- $this->add_control(
929
- 'entry_meta_color',
930
- [
931
- 'label' => __('Entry Meta Color', 'livemesh-el-addons'),
932
- 'type' => Controls_Manager::COLOR,
933
- 'selectors' => [
934
- '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-entry-meta span' => 'color: {{VALUE}};',
935
- ],
936
- ]
937
- );
938
-
939
- $this->add_group_control(
940
- Group_Control_Typography::get_type(),
941
- [
942
- 'name' => 'entry_meta_typography',
943
- 'selector' => '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-entry-meta span',
944
- ]
945
- );
946
-
947
-
948
- $this->add_control(
949
- 'heading_entry_meta_link',
950
- [
951
- 'label' => __('Entry Meta Link', 'livemesh-el-addons'),
952
- 'type' => Controls_Manager::HEADING,
953
- 'separator' => 'after',
954
- ]
955
- );
956
-
957
- $this->add_control(
958
- 'entry_meta_link_color',
959
- [
960
- 'label' => __('Entry Meta Link Color', 'livemesh-el-addons'),
961
- 'type' => Controls_Manager::COLOR,
962
- 'selectors' => [
963
- '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-entry-meta span a' => 'color: {{VALUE}};',
964
- ],
965
- ]
966
- );
967
-
968
- $this->add_group_control(
969
- Group_Control_Typography::get_type(),
970
- [
971
- 'name' => 'entry_meta_link_typography',
972
- 'selector' => '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-entry-meta span a',
973
- ]
974
- );
975
-
976
  $this->end_controls_section();
977
-
978
- $this->start_controls_section(
979
- 'section_read_more_styling',
980
- [
981
- 'label' => __('Read More', 'livemesh-el-addons'),
982
- 'tab' => Controls_Manager::TAB_STYLE,
983
- 'condition' => [
984
- 'carousel_skin' => 'classic_skin'
985
- ],
986
- ]
987
- );
988
-
989
- $this->add_control(
990
- 'read_more_color',
991
- [
992
- 'label' => __('Read More Color', 'livemesh-el-addons'),
993
- 'type' => Controls_Manager::COLOR,
994
- 'selectors' => [
995
- '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-read-more, {{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-read-more a' => 'color: {{VALUE}};',
996
- ],
997
- ]
998
- );
999
-
1000
- $this->add_control(
1001
- 'read_more_hover_color',
1002
- [
1003
- 'label' => __('Read More Hover Color', 'livemesh-el-addons'),
1004
- 'type' => Controls_Manager::COLOR,
1005
- 'selectors' => [
1006
- '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-read-more:hover, {{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-read-more a:hover' => 'color: {{VALUE}};',
1007
- ],
1008
- ]
1009
- );
1010
-
1011
- $this->add_group_control(
1012
- Group_Control_Typography::get_type(),
1013
- [
1014
- 'name' => 'read_more_typography',
1015
- 'selector' => '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-read-more, {{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-read-more a',
1016
- ]
1017
- );
1018
-
1019
  $this->end_controls_section();
1020
-
1021
-
1022
  }
1023
-
1024
- protected function get_item_template_options() {
1025
-
1026
  $template_options = array();
1027
-
1028
  /* Initialize the theme builder templates - Requires elementor pro plugin */
1029
- if (!is_plugin_active('elementor-pro/elementor-pro.php')) {
1030
- $template_options = [0 => __('No templates found. Elementor Pro is not installed/active', 'livemesh-el-addons')];
1031
- }
1032
- else {
 
 
1033
  $templates = lae_get_livemesh_item_templates();
1034
-
1035
  //$template_options = [0 => __('Select a template', 'livemesh-el-addons')];
1036
-
1037
- foreach ($templates as $template) {
1038
  $template_options[$template->ID] = $template->post_title;
1039
  }
1040
  }
1041
-
1042
  return $template_options;
1043
  }
1044
-
1045
- protected function render() {
1046
-
1047
  $settings = $this->get_settings_for_display();
1048
-
1049
- $settings = apply_filters('lae_posts_carousel_' . $this->get_id() . '_settings', $settings);
1050
-
1051
  $args['settings'] = $settings;
1052
-
1053
  $args['widget_instance'] = $this;
1054
-
1055
- lae_get_template_part('addons/posts-carousel/loop', $args);
1056
-
1057
  }
1058
-
1059
- protected function content_template() {
 
1060
  }
1061
 
1062
  }
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
 
9
  namespace LivemeshAddons\Widgets;
10
 
11
+ use Elementor\Widget_Base ;
12
+ use Elementor\Controls_Manager ;
13
+ use Elementor\Scheme_Color ;
14
+ use Elementor\Group_Control_Typography ;
15
+ use Elementor\Group_Control_Image_Size ;
16
+ use Elementor\Scheme_Typography ;
17
+ if ( !defined( 'ABSPATH' ) ) {
18
+ exit;
19
+ }
20
+ // Exit if accessed directly
21
+ class LAE_Posts_Carousel_Widget extends LAE_Widget_Base
22
+ {
23
+ public function get_name()
24
+ {
25
  return 'lae-posts-carousel';
26
  }
27
+
28
+ public function get_title()
29
+ {
30
+ return __( 'Posts Carousel', 'livemesh-el-addons' );
31
  }
32
+
33
+ public function get_icon()
34
+ {
35
  return 'lae-icon-posts-carousel';
36
  }
37
+
38
+ public function get_categories()
39
+ {
40
+ return array( 'livemesh-addons' );
41
  }
42
+
43
+ public function get_custom_help_url()
44
+ {
45
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/posts-carousel/';
46
  }
47
+
48
+ public function get_script_depends()
49
+ {
50
  return [
51
  'lae-jquery-slick',
52
  'lae-frontend-scripts',
54
  'lae-posts-carousel-scripts'
55
  ];
56
  }
57
+
58
+ public function get_style_depends()
59
+ {
60
  return [
61
  'lae-icomoon-styles',
62
  'lae-slick-carousel-styles',
65
  'lae-posts-carousel-styles'
66
  ];
67
  }
68
+
69
+ protected function _register_controls()
70
+ {
71
+ $this->start_controls_section( 'section_query', [
72
+ 'label' => __( 'Posts Query', 'livemesh-el-addons' ),
73
+ ] );
74
+ $this->add_control( 'query_type', [
75
+ 'label' => __( 'Source', 'livemesh-el-addons' ),
76
+ 'type' => Controls_Manager::SELECT,
77
+ 'options' => array(
78
+ 'custom_query' => __( 'Custom Query', 'livemesh-el-addons' ),
79
+ 'current_query' => __( 'Current Query', 'livemesh-el-addons' ),
80
+ 'related' => __( 'Related', 'livemesh-el-addons' ),
81
+ ),
82
+ 'default' => 'custom_query',
83
+ ] );
84
+ $this->add_control( 'post_types', [
85
+ 'label' => __( 'Post Types', 'livemesh-el-addons' ),
86
+ 'type' => Controls_Manager::SELECT2,
87
+ 'default' => 'post',
88
+ 'options' => lae_get_all_post_type_options(),
89
+ 'multiple' => true,
90
+ 'condition' => [
91
+ 'query_type' => 'custom_query',
92
+ ],
93
+ ] );
94
+ $this->add_control( 'taxonomies', [
95
+ 'type' => Controls_Manager::SELECT2,
96
+ 'label' => __( 'Choose the taxonomies to display related posts.', 'livemesh-el-addons' ),
97
+ 'label_block' => true,
98
+ 'description' => __( 'Choose the taxonomies to be used for displaying posts related to current post, page or custom post type.', 'livemesh-el-addons' ),
99
+ 'options' => lae_get_taxonomies_map(),
100
+ 'default' => 'category',
101
+ 'multiple' => true,
102
+ 'condition' => [
103
+ 'query_type' => 'related',
104
+ ],
105
+ ] );
106
+ $this->add_control( 'tax_query', [
107
+ 'label' => __( 'Taxonomies', 'livemesh-el-addons' ),
108
+ 'type' => Controls_Manager::SELECT2,
109
+ 'options' => lae_get_all_taxonomy_options(),
110
+ 'multiple' => true,
111
+ 'label_block' => true,
112
+ 'condition' => [
113
+ 'query_type' => 'custom_query',
114
+ ],
115
+ ] );
116
+ $this->add_control( 'post_in', [
117
+ 'label' => __( 'Post In', 'livemesh-el-addons' ),
118
+ 'description' => __( 'Provide a comma separated list of Post IDs to display in the grid.', 'livemesh-el-addons' ),
119
+ 'type' => Controls_Manager::TEXT,
120
+ 'label_block' => true,
121
+ 'condition' => [
122
+ 'query_type' => 'custom_query',
123
+ ],
124
+ ] );
125
+ $this->add_control( 'posts_per_page', [
126
+ 'label' => __( 'Posts Per Page', 'livemesh-el-addons' ),
127
+ 'type' => Controls_Manager::NUMBER,
128
+ 'min' => 1,
129
+ 'max' => 50,
130
+ 'step' => 1,
131
+ 'default' => 6,
132
+ 'condition' => [
133
+ 'query_type' => [ 'custom_query', 'related' ],
134
+ ],
135
+ ] );
136
+ $this->add_control( 'advanced', [
137
+ 'label' => __( 'Advanced', 'livemesh-el-addons' ),
138
+ 'type' => Controls_Manager::HEADING,
139
+ 'condition' => [
140
+ 'query_type' => [ 'custom_query', 'related' ],
141
+ ],
142
+ ] );
143
+ $this->add_control( 'orderby', [
144
+ 'label' => __( 'Order By', 'livemesh-el-addons' ),
145
+ 'type' => Controls_Manager::SELECT,
146
+ 'options' => array(
147
+ 'none' => __( 'No order', 'livemesh-el-addons' ),
148
+ 'ID' => __( 'Post ID', 'livemesh-el-addons' ),
149
+ 'author' => __( 'Author', 'livemesh-el-addons' ),
150
+ 'title' => __( 'Title', 'livemesh-el-addons' ),
151
+ 'date' => __( 'Published date', 'livemesh-el-addons' ),
152
+ 'modified' => __( 'Modified date', 'livemesh-el-addons' ),
153
+ 'parent' => __( 'By parent', 'livemesh-el-addons' ),
154
+ 'rand' => __( 'Random order', 'livemesh-el-addons' ),
155
+ 'comment_count' => __( 'Comment count', 'livemesh-el-addons' ),
156
+ 'menu_order' => __( 'Menu order', 'livemesh-el-addons' ),
157
+ 'post__in' => __( 'By include order', 'livemesh-el-addons' ),
158
+ ),
159
+ 'default' => 'date',
160
+ 'condition' => [
161
+ 'query_type' => [ 'custom_query', 'related' ],
162
+ ],
163
+ ] );
164
+ $this->add_control( 'order', [
165
+ 'label' => __( 'Order', 'livemesh-el-addons' ),
166
+ 'type' => Controls_Manager::SELECT,
167
+ 'options' => array(
168
+ 'ASC' => __( 'Ascending', 'livemesh-el-addons' ),
169
+ 'DESC' => __( 'Descending', 'livemesh-el-addons' ),
170
+ ),
171
+ 'default' => 'DESC',
172
+ 'condition' => [
173
+ 'query_type' => [ 'custom_query', 'related' ],
174
+ ],
175
+ ] );
176
+ $this->add_control( 'offset', [
177
+ 'label' => __( 'Offset', 'livemesh-el-addons' ),
178
+ 'description' => __( 'Number of posts to skip or pass over.', 'livemesh-el-addons' ),
179
+ 'type' => Controls_Manager::NUMBER,
180
+ 'default' => 0,
181
+ 'condition' => [
182
+ 'query_type' => 'custom_query',
183
+ ],
184
+ ] );
185
+ $this->add_control( 'upgrade_notice', [
186
+ 'type' => Controls_Manager::RAW_HTML,
187
+ 'separator' => 'before',
188
+ 'raw' => '<div style="text-align:center;line-height:1.6;"><p>' . __( 'Unlock new possibilities with premium widgets and styles of <strong>Livemesh Addons for Elementor <i>Premium</i></strong>. ', 'livemesh-el-addons' ) . '</p><p style="padding-top:15px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://livemeshelementor.com/pricing/#pricing-plans" target="_blank"><i class="fa fa-hand-o-right" aria-hidden="true"></i>' . __( 'Go Pro', 'livemesh-el-addons' ) . '</a></p></div>',
189
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  $this->end_controls_section();
191
+ $this->start_controls_section( 'section_carousel_skin', [
192
+ 'label' => __( 'Carousel Skin', 'livemesh-el-addons' ),
193
+ ] );
194
+ $this->add_control( 'carousel_skin', [
195
+ 'label' => __( 'Choose Carousel Skin', 'livemesh-el-addons' ),
196
+ 'description' => __( 'The "Classic Skin" is the built-in styling provided for the carousel items. Choose "Custom Skin" if you want to use theme builder template for the carousel items.', 'livemesh-el-addons' ),
197
+ 'type' => Controls_Manager::SELECT,
198
+ 'options' => array(
199
+ 'classic_skin' => __( 'Classic Skin', 'livemesh-el-addons' ),
200
+ 'custom_skin' => __( 'Custom Skin', 'livemesh-el-addons' ),
201
+ ),
202
+ 'default' => 'classic_skin',
203
+ ] );
204
+ $this->add_control( 'item_template', [
205
+ 'label' => __( 'Select the custom skin template for the carousel item', 'livemesh-el-addons' ),
206
+ 'description' => '<div style="text-align:center;font-style: normal;">' . '<a target="_blank" class="elementor-button elementor-button-default" href="' . esc_url( admin_url( '/edit.php?post_type=elementor_library&tabs_group=theme&elementor_library_type=livemesh_item' ) ) . '">' . __( 'Create/Edit the Item Skin Builder Templates', 'livemesh-el-addons' ) . '</a>' . '</div>',
207
+ 'type' => Controls_Manager::SELECT,
208
+ 'label_block' => true,
209
+ 'default' => [],
210
+ 'options' => $this->get_item_template_options(),
211
+ 'condition' => [
212
+ 'carousel_skin' => 'custom_skin',
213
+ ],
214
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
  $this->end_controls_section();
216
+ $this->start_controls_section( 'section_post_content', [
217
+ 'label' => __( 'Post Content', 'livemesh-el-addons' ),
218
+ 'condition' => [
219
+ 'carousel_skin' => 'classic_skin',
220
+ ],
221
+ ] );
222
+ $this->add_control( 'taxonomy_chosen', [
223
+ 'label' => __( 'Choose the taxonomy to display info.', 'livemesh-el-addons' ),
224
+ 'description' => __( 'Choose the taxonomy to use for display of taxonomy information for posts/custom post types.', 'livemesh-el-addons' ),
225
+ 'type' => Controls_Manager::SELECT,
226
+ 'label_block' => true,
227
+ 'default' => 'category',
228
+ 'options' => lae_get_taxonomies_map(),
229
+ ] );
230
+ $this->add_control( 'display_thumbnail', [
231
+ 'label' => __( 'Display post thumbnail?', 'livemesh-el-addons' ),
232
+ 'type' => Controls_Manager::SWITCHER,
233
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
234
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
235
+ 'return_value' => 'yes',
236
+ 'default' => 'yes',
237
+ ] );
238
+ $this->add_group_control( Group_Control_Image_Size::get_type(), [
239
+ 'name' => 'thumbnail_size',
240
+ 'label' => __( 'Image Size', 'livemesh-el-addons' ),
241
+ 'default' => 'large',
242
+ 'condition' => [
243
+ 'display_thumbnail' => 'yes',
244
+ ],
245
+ ] );
246
+ $this->add_control( 'image_linkable', [
247
+ 'label' => __( 'Link Images to Posts?', 'livemesh-el-addons' ),
248
+ 'type' => Controls_Manager::SWITCHER,
249
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
250
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
251
+ 'return_value' => 'yes',
252
+ 'default' => 'yes',
253
+ 'condition' => [
254
+ 'display_thumbnail' => 'yes',
255
+ ],
256
+ ] );
257
+ $this->add_control( 'post_link_new_window', [
258
+ 'label' => __( 'Open post links in new window?', 'livemesh-el-addons' ),
259
+ 'type' => Controls_Manager::SWITCHER,
260
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
261
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
262
+ 'return_value' => 'yes',
263
+ 'default' => '',
264
+ ] );
265
+ $this->add_control( 'display_title_on_thumbnail', [
266
+ 'label' => __( 'Display posts title on the post/portfolio thumbnail?', 'livemesh-el-addons' ),
267
+ 'type' => Controls_Manager::SWITCHER,
268
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
269
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
270
+ 'return_value' => 'yes',
271
+ 'default' => 'yes',
272
+ 'condition' => [
273
+ 'display_thumbnail' => 'yes',
274
+ ],
275
+ ] );
276
+ $this->add_control( 'display_taxonomy_on_thumbnail', [
277
+ 'label' => __( 'Display taxonomy info on post/project thumbnail?', 'livemesh-el-addons' ),
278
+ 'type' => Controls_Manager::SWITCHER,
279
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
280
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
281
+ 'return_value' => 'yes',
282
+ 'default' => 'yes',
283
+ 'condition' => [
284
+ 'display_thumbnail' => 'yes',
285
+ ],
286
+ ] );
287
+ $this->add_control( 'display_title', [
288
+ 'label' => __( 'Display posts title?', 'livemesh-el-addons' ),
289
+ 'type' => Controls_Manager::SWITCHER,
290
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
291
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
292
+ 'return_value' => 'yes',
293
+ 'default' => 'yes',
294
+ ] );
295
+ $this->add_control( 'display_summary', [
296
+ 'label' => __( 'Display post excerpt/summary?', 'livemesh-el-addons' ),
297
+ 'type' => Controls_Manager::SWITCHER,
298
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
299
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
300
+ 'return_value' => 'yes',
301
+ 'default' => 'yes',
302
+ ] );
303
+ $this->add_control( 'display_author', [
304
+ 'label' => __( 'Display post author info?', 'livemesh-el-addons' ),
305
+ 'type' => Controls_Manager::SWITCHER,
306
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
307
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
308
+ 'return_value' => 'yes',
309
+ 'default' => 'no',
310
+ ] );
311
+ $this->add_control( 'display_post_date', [
312
+ 'label' => __( 'Display post date info?', 'livemesh-el-addons' ),
313
+ 'type' => Controls_Manager::SWITCHER,
314
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
315
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
316
+ 'return_value' => 'yes',
317
+ 'default' => 'no',
318
+ ] );
319
+ $this->add_control( 'display_taxonomy', [
320
+ 'label' => __( 'Display taxonomy info?', 'livemesh-el-addons' ),
321
+ 'type' => Controls_Manager::SWITCHER,
322
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
323
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
324
+ 'return_value' => 'yes',
325
+ 'default' => 'no',
326
+ ] );
327
+ $this->add_control( 'display_read_more', [
328
+ 'label' => __( 'Display read more link to the post/portfolio?', 'livemesh-el-addons' ),
329
+ 'type' => Controls_Manager::SWITCHER,
330
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
331
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
332
+ 'return_value' => 'yes',
333
+ 'default' => 'no',
334
+ ] );
335
+ $this->add_control( 'read_more_text', [
336
+ 'label' => __( 'Read more text', 'livemesh-el-addons' ),
337
+ 'type' => Controls_Manager::TEXT,
338
+ "description" => __( 'Specify the text for the read more link/button', 'livemesh-el-addons' ),
339
+ 'default' => __( 'Read More', 'livemesh-el-addons' ),
340
+ 'condition' => [
341
+ 'display_read_more' => [ 'yes' ],
342
+ ],
343
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
344
  $this->end_controls_section();
345
+ $this->start_controls_section( 'section_carousel_settings', [
346
+ 'label' => __( 'Carousel Settings', 'livemesh-el-addons' ),
347
+ 'tab' => Controls_Manager::TAB_SETTINGS,
348
+ ] );
349
+ $this->add_control( 'arrows', [
350
+ 'type' => Controls_Manager::SWITCHER,
351
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
352
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
353
+ 'return_value' => 'yes',
354
+ 'default' => 'yes',
355
+ 'label' => __( 'Prev/Next Arrows?', 'livemesh-el-addons' ),
356
+ ] );
357
+ $this->add_control( 'dots', [
358
+ 'type' => Controls_Manager::SWITCHER,
359
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
360
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
361
+ 'return_value' => 'yes',
362
+ 'default' => 'no',
363
+ 'label' => __( 'Show dot indicators for navigation?', 'livemesh-el-addons' ),
364
+ ] );
365
+ $this->add_control( 'pause_on_hover', [
366
+ 'type' => Controls_Manager::SWITCHER,
367
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
368
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
369
+ 'return_value' => 'yes',
370
+ 'default' => 'yes',
371
+ 'label' => __( 'Pause on Hover?', 'livemesh-el-addons' ),
372
+ ] );
373
+ $this->add_control( 'autoplay', [
374
+ 'type' => Controls_Manager::SWITCHER,
375
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
376
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
377
+ 'return_value' => 'yes',
378
+ 'default' => 'no',
379
+ 'label' => __( 'Autoplay?', 'livemesh-el-addons' ),
380
+ 'description' => __( 'Should the carousel autoplay as in a slideshow.', 'livemesh-el-addons' ),
381
+ ] );
382
+ $this->add_control( 'adaptive_height', [
383
+ 'type' => Controls_Manager::SWITCHER,
384
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
385
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
386
+ 'return_value' => 'yes',
387
+ 'default' => 'no',
388
+ 'label' => __( 'Adaptive Height?', 'livemesh-el-addons' ),
389
+ 'description' => __( 'Enables adaptive height for single slide horizontal carousels.', 'livemesh-el-addons' ),
390
+ ] );
391
+ $this->add_control( 'autoplay_speed', [
392
+ 'label' => __( 'Autoplay speed in ms', 'livemesh-el-addons' ),
393
+ 'type' => Controls_Manager::NUMBER,
394
+ 'default' => 3000,
395
+ ] );
396
+ $this->add_control( 'animation_speed', [
397
+ 'label' => __( 'Autoplay animation speed in ms', 'livemesh-el-addons' ),
398
+ 'type' => Controls_Manager::NUMBER,
399
+ 'default' => 300,
400
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
  $this->end_controls_section();
402
+ $this->start_controls_section( 'section_responsive', [
403
+ 'label' => __( 'Responsive Options', 'livemesh-el-addons' ),
404
+ 'tab' => Controls_Manager::TAB_SETTINGS,
405
+ ] );
406
+ $this->add_control( 'heading_desktop', [
407
+ 'label' => __( 'Desktop', 'livemesh-el-addons' ),
408
+ 'type' => Controls_Manager::HEADING,
409
+ 'separator' => 'after',
410
+ ] );
411
+ $this->add_control( 'gutter', [
412
+ 'label' => __( 'Gutter', 'livemesh-el-addons' ),
413
+ 'description' => __( 'Space between columns.', 'livemesh-el-addons' ),
414
+ 'type' => Controls_Manager::NUMBER,
415
+ 'default' => 10,
416
+ 'selectors' => [
417
+ '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item' => 'padding: {{VALUE}}px;',
418
+ ],
419
+ ] );
420
+ $this->add_control( 'display_columns', [
421
+ 'label' => __( 'Columns per row', 'livemesh-el-addons' ),
422
+ 'type' => Controls_Manager::NUMBER,
423
+ 'min' => 1,
424
+ 'max' => 5,
425
+ 'step' => 1,
426
+ 'default' => 3,
427
+ ] );
428
+ $this->add_control( 'scroll_columns', [
429
+ 'label' => __( 'Columns to scroll', 'livemesh-el-addons' ),
430
+ 'type' => Controls_Manager::NUMBER,
431
+ 'min' => 1,
432
+ 'max' => 5,
433
+ 'step' => 1,
434
+ 'default' => 3,
435
+ ] );
436
+ $this->add_control( 'heading_tablet', [
437
+ 'label' => __( 'Tablet', 'livemesh-el-addons' ),
438
+ 'type' => Controls_Manager::HEADING,
439
+ 'separator' => 'after',
440
+ ] );
441
+ $this->add_control( 'tablet_gutter', [
442
+ 'label' => __( 'Gutter', 'livemesh-el-addons' ),
443
+ 'description' => __( 'Space between columns.', 'livemesh-el-addons' ),
444
+ 'type' => Controls_Manager::NUMBER,
445
+ 'default' => 10,
446
+ 'selectors' => [
447
+ '(tablet-){{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item' => 'padding: {{VALUE}}px;',
448
+ ],
449
+ ] );
450
+ $this->add_control( 'tablet_display_columns', [
451
+ 'label' => __( 'Columns per row', 'livemesh-el-addons' ),
452
+ 'type' => Controls_Manager::NUMBER,
453
+ 'min' => 1,
454
+ 'max' => 5,
455
+ 'step' => 1,
456
+ 'default' => 2,
457
+ ] );
458
+ $this->add_control( 'tablet_scroll_columns', [
459
+ 'label' => __( 'Columns to scroll', 'livemesh-el-addons' ),
460
+ 'type' => Controls_Manager::NUMBER,
461
+ 'min' => 1,
462
+ 'max' => 5,
463
+ 'step' => 1,
464
+ 'default' => 2,
465
+ ] );
466
+ $this->add_control( 'tablet_width', [
467
+ 'label' => __( 'Tablet Resolution', 'livemesh-el-addons' ),
468
+ 'description' => __( 'The resolution to treat as a tablet resolution.', 'livemesh-el-addons' ),
469
+ 'type' => Controls_Manager::NUMBER,
470
+ 'default' => 800,
471
+ ] );
472
+ $this->add_control( 'heading_mobile', [
473
+ 'label' => __( 'Mobile Phone', 'livemesh-el-addons' ),
474
+ 'type' => Controls_Manager::HEADING,
475
+ 'separator' => 'after',
476
+ ] );
477
+ $this->add_control( 'mobile_gutter', [
478
+ 'label' => __( 'Mobile Gutter', 'livemesh-el-addons' ),
479
+ 'description' => __( 'Space between columns.', 'livemesh-el-addons' ),
480
+ 'type' => Controls_Manager::NUMBER,
481
+ 'default' => 10,
482
+ 'selectors' => [
483
+ '(mobile-){{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item' => 'padding: {{VALUE}}px;',
484
+ ],
485
+ ] );
486
+ $this->add_control( 'mobile_display_columns', [
487
+ 'label' => __( 'Columns per row', 'livemesh-el-addons' ),
488
+ 'type' => Controls_Manager::NUMBER,
489
+ 'min' => 1,
490
+ 'max' => 3,
491
+ 'step' => 1,
492
+ 'default' => 1,
493
+ ] );
494
+ $this->add_control( 'mobile_scroll_columns', [
495
+ 'label' => __( 'Columns to scroll', 'livemesh-el-addons' ),
496
+ 'type' => Controls_Manager::NUMBER,
497
+ 'min' => 1,
498
+ 'max' => 3,
499
+ 'step' => 1,
500
+ 'default' => 1,
501
+ ] );
502
+ $this->add_control( 'mobile_width', [
503
+ 'label' => __( 'Mobile Resolution', 'livemesh-el-addons' ),
504
+ 'description' => __( 'The resolution to treat as a mobile resolution.', 'livemesh-el-addons' ),
505
+ 'type' => Controls_Manager::NUMBER,
506
+ 'default' => 480,
507
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
508
  $this->end_controls_section();
509
+ $this->start_controls_section( 'section_carousel_item_thumbnail_styling', [
510
+ 'label' => __( 'Post Thumbnail', 'livemesh-el-addons' ),
511
+ 'tab' => Controls_Manager::TAB_STYLE,
512
+ 'condition' => [
513
+ 'carousel_skin' => 'classic_skin',
514
+ ],
515
+ ] );
516
+ $this->add_control( 'heading_thumbnail_info', [
517
+ 'label' => __( 'Thumbnail Info Entry Title', 'livemesh-el-addons' ),
518
+ 'type' => Controls_Manager::HEADING,
519
+ 'separator' => 'after',
520
+ ] );
521
+ $this->add_control( 'title_tag', [
522
+ 'label' => __( 'Title HTML Tag', 'livemesh-el-addons' ),
523
+ 'type' => Controls_Manager::SELECT,
524
+ 'options' => [
525
+ 'h1' => __( 'H1', 'livemesh-el-addons' ),
526
+ 'h2' => __( 'H2', 'livemesh-el-addons' ),
527
+ 'h3' => __( 'H3', 'livemesh-el-addons' ),
528
+ 'h4' => __( 'H4', 'livemesh-el-addons' ),
529
+ 'h5' => __( 'H5', 'livemesh-el-addons' ),
530
+ 'h6' => __( 'H6', 'livemesh-el-addons' ),
531
+ 'div' => __( 'div', 'livemesh-el-addons' ),
532
+ ],
533
+ 'default' => 'h3',
534
+ ] );
535
+ $this->add_control( 'title_color', [
536
+ 'label' => __( 'Title Color', 'livemesh-el-addons' ),
537
+ 'type' => Controls_Manager::COLOR,
538
+ 'selectors' => [
539
+ '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-project-image .lae-image-info .lae-post-title a' => 'color: {{VALUE}};',
540
+ ],
541
+ ] );
542
+ $this->add_control( 'title_hover_border_color', [
543
+ 'label' => __( 'Title Hover Border Color', 'livemesh-el-addons' ),
544
+ 'type' => Controls_Manager::COLOR,
545
+ 'selectors' => [
546
+ '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-project-image .lae-image-info .lae-post-title a:hover' => 'border-color: {{VALUE}};',
547
+ ],
548
+ ] );
549
+ $this->add_group_control( Group_Control_Typography::get_type(), [
550
+ 'name' => 'title_typography',
551
+ 'selector' => '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-project-image .lae-image-info .lae-post-title',
552
+ ] );
553
+ $this->add_control( 'heading_thumbnail_info_taxonomy', [
554
+ 'label' => __( 'Thumbnail Info Taxonomy Terms', 'livemesh-el-addons' ),
555
+ 'type' => Controls_Manager::HEADING,
556
+ 'separator' => 'after',
557
+ ] );
558
+ $this->add_control( 'thumbnail_info_tags_color', [
559
+ 'label' => __( 'Taxonomy Terms Color', 'livemesh-el-addons' ),
560
+ 'type' => Controls_Manager::COLOR,
561
+ 'selectors' => [
562
+ '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-project-image .lae-image-info .lae-terms, {{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-project-image .lae-image-info .lae-terms a' => 'color: {{VALUE}};',
563
+ ],
564
+ ] );
565
+ $this->add_group_control( Group_Control_Typography::get_type(), [
566
+ 'name' => 'tags_typography',
567
+ 'selector' => '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-project-image .lae-image-info .lae-terms, {{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-project-image .lae-image-info .lae-terms a',
568
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
569
  $this->end_controls_section();
570
+ $this->start_controls_section( 'section_entry_title_styling', [
571
+ 'label' => __( 'Post Entry Title', 'livemesh-el-addons' ),
572
+ 'tab' => Controls_Manager::TAB_STYLE,
573
+ 'condition' => [
574
+ 'carousel_skin' => 'classic_skin',
575
+ ],
576
+ ] );
577
+ $this->add_control( 'entry_title_tag', [
578
+ 'label' => __( 'Entry Title HTML Tag', 'livemesh-el-addons' ),
579
+ 'type' => Controls_Manager::SELECT,
580
+ 'options' => [
581
+ 'h1' => __( 'H1', 'livemesh-el-addons' ),
582
+ 'h2' => __( 'H2', 'livemesh-el-addons' ),
583
+ 'h3' => __( 'H3', 'livemesh-el-addons' ),
584
+ 'h4' => __( 'H4', 'livemesh-el-addons' ),
585
+ 'h5' => __( 'H5', 'livemesh-el-addons' ),
586
+ 'h6' => __( 'H6', 'livemesh-el-addons' ),
587
+ 'div' => __( 'div', 'livemesh-el-addons' ),
588
+ ],
589
+ 'default' => 'h3',
590
+ ] );
591
+ $this->add_control( 'entry_title_color', [
592
+ 'label' => __( 'Entry Title Color', 'livemesh-el-addons' ),
593
+ 'type' => Controls_Manager::COLOR,
594
+ 'selectors' => [
595
+ '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .entry-title a' => 'color: {{VALUE}};',
596
+ ],
597
+ ] );
598
+ $this->add_group_control( Group_Control_Typography::get_type(), [
599
+ 'name' => 'entry_title_typography',
600
+ 'selector' => '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .entry-title',
601
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
602
  $this->end_controls_section();
603
+ $this->start_controls_section( 'section_entry_summary_styling', [
604
+ 'label' => __( 'Post Entry Summary', 'livemesh-el-addons' ),
605
+ 'tab' => Controls_Manager::TAB_STYLE,
606
+ 'condition' => [
607
+ 'carousel_skin' => 'classic_skin',
608
+ ],
609
+ ] );
610
+ $this->add_control( 'entry_summary_color', [
611
+ 'label' => __( 'Entry Summary Color', 'livemesh-el-addons' ),
612
+ 'type' => Controls_Manager::COLOR,
613
+ 'selectors' => [
614
+ '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .entry-summary' => 'color: {{VALUE}};',
615
+ ],
616
+ ] );
617
+ $this->add_group_control( Group_Control_Typography::get_type(), [
618
+ 'name' => 'entry_summary_typography',
619
+ 'selector' => '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .entry-summary',
620
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
621
  $this->end_controls_section();
622
+ $this->start_controls_section( 'section_entry_meta_styling', [
623
+ 'label' => __( 'Post Entry Meta', 'livemesh-el-addons' ),
624
+ 'tab' => Controls_Manager::TAB_STYLE,
625
+ 'condition' => [
626
+ 'carousel_skin' => 'classic_skin',
627
+ ],
628
+ ] );
629
+ $this->add_control( 'heading_entry_meta', [
630
+ 'label' => __( 'Entry Meta', 'livemesh-el-addons' ),
631
+ 'type' => Controls_Manager::HEADING,
632
+ 'separator' => 'after',
633
+ ] );
634
+ $this->add_control( 'entry_meta_color', [
635
+ 'label' => __( 'Entry Meta Color', 'livemesh-el-addons' ),
636
+ 'type' => Controls_Manager::COLOR,
637
+ 'selectors' => [
638
+ '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-entry-meta span' => 'color: {{VALUE}};',
639
+ ],
640
+ ] );
641
+ $this->add_group_control( Group_Control_Typography::get_type(), [
642
+ 'name' => 'entry_meta_typography',
643
+ 'selector' => '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-entry-meta span',
644
+ ] );
645
+ $this->add_control( 'heading_entry_meta_link', [
646
+ 'label' => __( 'Entry Meta Link', 'livemesh-el-addons' ),
647
+ 'type' => Controls_Manager::HEADING,
648
+ 'separator' => 'after',
649
+ ] );
650
+ $this->add_control( 'entry_meta_link_color', [
651
+ 'label' => __( 'Entry Meta Link Color', 'livemesh-el-addons' ),
652
+ 'type' => Controls_Manager::COLOR,
653
+ 'selectors' => [
654
+ '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-entry-meta span a' => 'color: {{VALUE}};',
655
+ ],
656
+ ] );
657
+ $this->add_group_control( Group_Control_Typography::get_type(), [
658
+ 'name' => 'entry_meta_link_typography',
659
+ 'selector' => '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-entry-meta span a',
660
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
661
  $this->end_controls_section();
662
+ $this->start_controls_section( 'section_read_more_styling', [
663
+ 'label' => __( 'Read More', 'livemesh-el-addons' ),
664
+ 'tab' => Controls_Manager::TAB_STYLE,
665
+ 'condition' => [
666
+ 'carousel_skin' => 'classic_skin',
667
+ ],
668
+ ] );
669
+ $this->add_control( 'read_more_color', [
670
+ 'label' => __( 'Read More Color', 'livemesh-el-addons' ),
671
+ 'type' => Controls_Manager::COLOR,
672
+ 'selectors' => [
673
+ '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-read-more, {{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-read-more a' => 'color: {{VALUE}};',
674
+ ],
675
+ ] );
676
+ $this->add_control( 'read_more_hover_color', [
677
+ 'label' => __( 'Read More Hover Color', 'livemesh-el-addons' ),
678
+ 'type' => Controls_Manager::COLOR,
679
+ 'selectors' => [
680
+ '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-read-more:hover, {{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-read-more a:hover' => 'color: {{VALUE}};',
681
+ ],
682
+ ] );
683
+ $this->add_group_control( Group_Control_Typography::get_type(), [
684
+ 'name' => 'read_more_typography',
685
+ 'selector' => '{{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-read-more, {{WRAPPER}} .lae-posts-carousel .lae-posts-carousel-item .lae-read-more a',
686
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
687
  $this->end_controls_section();
 
 
688
  }
689
+
690
+ protected function get_item_template_options()
691
+ {
692
  $template_options = array();
 
693
  /* Initialize the theme builder templates - Requires elementor pro plugin */
694
+
695
+ if ( !is_plugin_active( 'elementor-pro/elementor-pro.php' ) ) {
696
+ $template_options = [
697
+ 0 => __( 'No templates found. Elementor Pro is not installed/active', 'livemesh-el-addons' ),
698
+ ];
699
+ } else {
700
  $templates = lae_get_livemesh_item_templates();
 
701
  //$template_options = [0 => __('Select a template', 'livemesh-el-addons')];
702
+ foreach ( $templates as $template ) {
 
703
  $template_options[$template->ID] = $template->post_title;
704
  }
705
  }
706
+
707
  return $template_options;
708
  }
709
+
710
+ protected function render()
711
+ {
712
  $settings = $this->get_settings_for_display();
713
+ $settings = apply_filters( 'lae_posts_carousel_' . $this->get_id() . '_settings', $settings );
 
 
714
  $args['settings'] = $settings;
 
715
  $args['widget_instance'] = $this;
716
+ lae_get_template_part( 'addons/posts-carousel/loop', $args );
 
 
717
  }
718
+
719
+ protected function content_template()
720
+ {
721
  }
722
 
723
  }
includes/widgets/posts-gridbox-slider.php CHANGED
@@ -177,6 +177,11 @@ class LAE_Posts_GridBox_Slider_Widget extends LAE_Widget_Base
177
  'query_type' => 'custom_query',
178
  ],
179
  ] );
 
 
 
 
 
180
  $this->end_controls_section();
181
  $this->start_controls_section( 'section_post_content', [
182
  'label' => __( 'Post Content', 'livemesh-el-addons' ),
177
  'query_type' => 'custom_query',
178
  ],
179
  ] );
180
+ $this->add_control( 'upgrade_notice', [
181
+ 'type' => Controls_Manager::RAW_HTML,
182
+ 'separator' => 'before',
183
+ 'raw' => '<div style="text-align:center;line-height:1.6;"><p>' . __( 'Unlock new possibilities with premium widgets and styles of <strong>Livemesh Addons for Elementor <i>Premium</i></strong>. ', 'livemesh-el-addons' ) . '</p><p style="padding-top:15px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://livemeshelementor.com/pricing/#pricing-plans" target="_blank"><i class="fa fa-hand-o-right" aria-hidden="true"></i>' . __( 'Go Pro', 'livemesh-el-addons' ) . '</a></p></div>',
184
+ ] );
185
  $this->end_controls_section();
186
  $this->start_controls_section( 'section_post_content', [
187
  'label' => __( 'Post Content', 'livemesh-el-addons' ),
includes/widgets/posts-multislider.php CHANGED
@@ -182,6 +182,11 @@ class LAE_Posts_Multislider_Widget extends LAE_Widget_Base
182
  'query_type' => 'custom_query',
183
  ],
184
  ] );
 
 
 
 
 
185
  $this->end_controls_section();
186
  $this->start_controls_section( 'section_post_content', [
187
  'label' => __( 'Post Content', 'livemesh-el-addons' ),
182
  'query_type' => 'custom_query',
183
  ],
184
  ] );
185
+ $this->add_control( 'upgrade_notice', [
186
+ 'type' => Controls_Manager::RAW_HTML,
187
+ 'separator' => 'before',
188
+ 'raw' => '<div style="text-align:center;line-height:1.6;"><p>' . __( 'Unlock new possibilities with premium widgets and styles of <strong>Livemesh Addons for Elementor <i>Premium</i></strong>. ', 'livemesh-el-addons' ) . '</p><p style="padding-top:15px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://livemeshelementor.com/pricing/#pricing-plans" target="_blank"><i class="fa fa-hand-o-right" aria-hidden="true"></i>' . __( 'Go Pro', 'livemesh-el-addons' ) . '</a></p></div>',
189
+ ] );
190
  $this->end_controls_section();
191
  $this->start_controls_section( 'section_post_content', [
192
  'label' => __( 'Post Content', 'livemesh-el-addons' ),
includes/widgets/posts-slider.php CHANGED
@@ -176,6 +176,11 @@ class LAE_Posts_Slider_Widget extends LAE_Widget_Base
176
  'query_type' => 'custom_query',
177
  ],
178
  ] );
 
 
 
 
 
179
  $this->end_controls_section();
180
  $this->start_controls_section( 'section_post_content', [
181
  'label' => __( 'Post Content', 'livemesh-el-addons' ),
176
  'query_type' => 'custom_query',
177
  ],
178
  ] );
179
+ $this->add_control( 'upgrade_notice', [
180
+ 'type' => Controls_Manager::RAW_HTML,
181
+ 'separator' => 'before',
182
+ 'raw' => '<div style="text-align:center;line-height:1.6;"><p>' . __( 'Unlock new possibilities with premium widgets and styles of <strong>Livemesh Addons for Elementor <i>Premium</i></strong>. ', 'livemesh-el-addons' ) . '</p><p style="padding-top:15px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://livemeshelementor.com/pricing/#pricing-plans" target="_blank"><i class="fa fa-hand-o-right" aria-hidden="true"></i>' . __( 'Go Pro', 'livemesh-el-addons' ) . '</a></p></div>',
183
+ ] );
184
  $this->end_controls_section();
185
  $this->start_controls_section( 'section_post_content', [
186
  'label' => __( 'Post Content', 'livemesh-el-addons' ),
includes/widgets/pricing-table.php CHANGED
@@ -6,637 +6,449 @@ Description: Display pricing plans in a multi-column grid.
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
9
-
10
  namespace LivemeshAddons\Widgets;
11
 
12
- use Elementor\Repeater;
13
- use Elementor\Widget_Base;
14
- use Elementor\Controls_Manager;
15
- use Elementor\Utils;
16
- use Elementor\Scheme_Color;
17
- use Elementor\Group_Control_Typography;
18
- use Elementor\Scheme_Typography;
19
-
20
- if (!defined('ABSPATH'))
21
- exit; // Exit if accessed directly
22
-
23
-
24
- class LAE_Pricing_Table_Widget extends LAE_Widget_Base {
25
-
26
-
27
- public function __construct($data = [], $args = null) {
28
- parent::__construct($data, $args);
29
-
30
- add_shortcode('lae_pricing_item', array($this, 'pricing_item_shortcode'));
31
  }
32
-
33
- public function pricing_item_shortcode($atts, $content = null, $tag) {
34
-
35
  $title = $value = '';
36
-
37
- $args = shortcode_atts(array(
38
  'title' => '',
39
- 'value' => ''
40
-
41
- ), $atts);
42
-
43
- $output = lae_get_template_part('addons/pricing-table/pricing-item', $args, true);
44
-
45
  return $output;
46
  }
47
-
48
- public function get_name() {
 
49
  return 'lae-pricing-table';
50
  }
51
-
52
- public function get_title() {
53
- return __('Pricing Table', 'livemesh-el-addons');
 
54
  }
55
-
56
- public function get_icon() {
 
57
  return 'lae-icon-pricing-table';
58
  }
59
-
60
- public function get_categories() {
61
- return array('livemesh-addons');
 
62
  }
63
-
64
- public function get_custom_help_url() {
 
65
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/pricing-table/';
66
  }
67
-
68
- public function get_script_depends() {
69
- return [
70
- 'lae-waypoints',
71
- 'lae-frontend-scripts'
72
- ];
73
  }
74
-
75
- public function get_style_depends() {
76
- return [
77
- 'lae-animate-styles',
78
- 'lae-frontend-styles',
79
- 'lae-pricing-plans-styles'
80
- ];
81
  }
82
-
83
- protected function _register_controls() {
84
-
85
- $this->start_controls_section(
86
- 'section_pricing_table',
87
- [
88
- 'label' => __('Pricing Table', 'livemesh-el-addons'),
89
- ]
90
- );
91
-
92
- $this->add_control(
93
- 'pricing_heading',
94
- [
95
- 'label' => __('Pricing Plans', 'livemesh-el-addons'),
96
- 'type' => Controls_Manager::HEADING,
97
- ]
98
- );
99
-
100
  $repeater = new Repeater();
101
-
102
- $repeater->add_control(
103
- 'pricing_title',
104
- [
105
- 'type' => Controls_Manager::TEXT,
106
- 'label' => __('Pricing Plan Title', 'livemesh-el-addons'),
107
- 'default' => __('My pricing plan title', 'livemesh-el-addons'),
108
- 'label_block' => true,
109
- 'dynamic' => [
110
- 'active' => true,
111
- ],
112
- ]
113
- );
114
-
115
- $repeater->add_control(
116
- 'tagline',
117
- [
118
- 'type' => Controls_Manager::TEXT,
119
- 'label' => __('Tagline Text', 'livemesh-el-addons'),
120
- 'description' => __('Provide any subtitle or taglines like "Most Popular", "Best Value", "Best Selling", "Most Flexible" etc. that you would like to use for this pricing plan.', 'livemesh-el-addons'),
121
- 'dynamic' => [
122
- 'active' => true,
123
- ],
124
- ]
125
- );
126
-
127
- $repeater->add_control(
128
-
129
- 'pricing_image',
130
- [
131
- 'label' => __('Pricing Image', 'livemesh-el-addons'),
132
- 'type' => Controls_Manager::MEDIA,
133
- 'default' => [
134
- 'url' => Utils::get_placeholder_image_src(),
135
- ],
136
- 'label_block' => true,
137
- 'dynamic' => [
138
- 'active' => true,
139
- ],
140
- ]
141
- );
142
-
143
- $repeater->add_control(
144
- 'price_tag',
145
- [
146
- 'type' => Controls_Manager::TEXT,
147
- 'label' => __('Price Tag', 'livemesh-el-addons'),
148
- 'description' => __('Enter the price tag for the pricing plan. HTML is accepted.', 'livemesh-el-addons'),
149
- 'dynamic' => [
150
- 'active' => true,
151
- ],
152
- ]
153
- );
154
-
155
- $repeater->add_control(
156
- 'button_text',
157
- [
158
- 'type' => Controls_Manager::TEXT,
159
- 'label' => __('Text for Pricing Link/Button', 'livemesh-el-addons'),
160
- 'dynamic' => [
161
- 'active' => true,
162
- ],
163
- ]
164
- );
165
-
166
- $repeater->add_control(
167
- 'button_url',
168
- [
169
- 'label' => __('URL for the Pricing link/button', 'livemesh-el-addons'),
170
- 'type' => Controls_Manager::URL,
171
- 'label_block' => true,
172
- 'default' => [
173
- 'url' => '',
174
- 'is_external' => 'true',
175
- ],
176
- 'placeholder' => __('http://your-link.com', 'livemesh-el-addons'),
177
- 'dynamic' => [
178
- 'active' => true,
179
- ],
180
- ]
181
- );
182
-
183
- $repeater->add_control(
184
- 'highlight',
185
- [
186
- 'label' => __('Highlight Pricing Plan', 'livemesh-el-addons'),
187
- 'type' => Controls_Manager::SWITCHER,
188
- 'label_off' => __('No', 'livemesh-el-addons'),
189
- 'label_on' => __('Yes', 'livemesh-el-addons'),
190
- 'return_value' => 'yes',
191
- 'default' => 'no',
192
- ]
193
- );
194
-
195
- $repeater->add_control(
196
- 'pricing_content',
197
- [
198
- 'type' => Controls_Manager::TEXTAREA,
199
- 'label' => __('Pricing Plan Details', 'livemesh-el-addons'),
200
- 'description' => __('Enter the content for the pricing plan that include information about individual features of the pricing plan. For prebuilt styling, enter shortcodes content like - [lae_pricing_item title="Storage Space" value="50 GB"] [lae_pricing_item title="Video Uploads" value="50"][lae_pricing_item title="Portfolio Items" value="20"]', 'livemesh-el-addons'),
201
- 'show_label' => true,
202
- 'rows' => 10,
203
- 'dynamic' => [
204
- 'active' => true,
205
- ],
206
- ]
207
- );
208
-
209
- $repeater->add_control(
210
- "widget_animation",
211
- [
212
- "type" => Controls_Manager::SELECT,
213
- "label" => __("Animation Type", "livemesh-el-addons"),
214
- 'options' => lae_get_animation_options(),
215
- 'default' => 'none',
216
- ]
217
- );
218
-
219
- $this->add_control(
220
- 'pricing_plans',
221
- [
222
- 'type' => Controls_Manager::REPEATER,
223
- 'fields' => $repeater->get_controls(),
224
- 'title_field' => '{{{ pricing_title }}}',
225
- ]
226
- );
227
-
228
  $this->end_controls_section();
229
-
230
- $this->start_controls_section(
231
- 'section_grid_settings',
232
- [
233
- 'label' => __('Grid Settings', 'livemesh-el-addons'),
234
- 'tab' => Controls_Manager::TAB_SETTINGS,
235
- ]
236
- );
237
-
238
- $this->add_control(
239
- 'column_layout',
240
- [
241
- 'label' => __('Column Layout', 'livemesh-el-addons'),
242
- 'type' => Controls_Manager::SELECT,
243
- 'options' => array(
244
- 'auto' => __('Auto', 'livemesh-el-addons'),
245
- 'custom' => __('Custom', 'livemesh-el-addons'),
246
- ),
247
- 'default' => 'auto',
248
- 'description' => __('Set column layout to be <strong>Auto</strong> to let the widget auto calculate number of columns based on minimum column size specified. The option <strong>Custom</strong> lets you explicitly control number of columns based on screen width.', 'livemesh-el-addons'),
249
- ]
250
- );
251
-
252
- $this->add_control(
253
- 'min_column_size',
254
- [
255
- 'label' => __('Minimum Column Size', 'livemesh-el-addons'),
256
- 'type' => Controls_Manager::SLIDER,
257
- 'size_units' => ['px'],
258
- 'default' => [
259
- 'size' => 300,
260
- ],
261
- 'range' => [
262
- 'px' => [
263
- 'min' => 50,
264
- 'max' => 500,
265
- ],
266
- ],
267
- 'selectors' => [
268
- '{{WRAPPER}} .lae-uber-grid-container.lae-grid-auto-column-layout' => 'grid-template-columns: repeat(auto-fit, minmax({{SIZE}}{{UNIT}}, 1fr));',
269
- ],
270
- 'condition' => [
271
- 'column_layout' => 'auto'
272
- ]
273
- ]
274
- );
275
-
276
- $this->add_responsive_control(
277
- 'per_line',
278
- [
279
- 'label' => __('Pricing plans in a row', 'livemesh-el-addons'),
280
- 'type' => Controls_Manager::SELECT,
281
- 'default' => '3',
282
- 'tablet_default' => '2',
283
- 'mobile_default' => '1',
284
- 'options' => [
285
- '1' => '1',
286
- '2' => '2',
287
- '3' => '3',
288
- '4' => '4',
289
- '5' => '5',
290
- '6' => '6',
291
- ],
292
- 'frontend_available' => true,
293
- 'condition' => [
294
- 'column_layout' => 'custom'
295
- ]
296
- ]
297
- );
298
-
299
- $this->add_control(
300
- 'column_gap',
301
- [
302
- 'label' => __('Column Gap', 'livemesh-el-addons'),
303
- 'type' => Controls_Manager::SLIDER,
304
- 'size_units' => ['px'],
305
- 'default' => [
306
- 'size' => 30,
307
- ],
308
- 'range' => [
309
- 'px' => [
310
- 'min' => 0,
311
- 'max' => 100,
312
- ],
313
- ],
314
- 'selectors' => [
315
- '{{WRAPPER}} .lae-uber-grid-container' => 'column-gap: {{SIZE}}{{UNIT}};',
316
- ],
317
- ]
318
- );
319
-
320
- $this->add_control(
321
- 'row_gap',
322
- [
323
- 'label' => __('Row Gap', 'livemesh-el-addons'),
324
- 'type' => Controls_Manager::SLIDER,
325
- 'size_units' => ['px'],
326
- 'default' => [
327
- 'size' => 30,
328
- ],
329
- 'range' => [
330
- 'px' => [
331
- 'min' => 0,
332
- 'max' => 100,
333
- ],
334
- ],
335
- 'selectors' => [
336
- '{{WRAPPER}} .lae-uber-grid-container' => 'row-gap: {{SIZE}}{{UNIT}};',
337
- ],
338
- ]
339
- );
340
-
341
  $this->end_controls_section();
342
-
343
- $this->start_controls_section(
344
- 'section_pricing_style',
345
- [
346
- 'label' => __('Plan Name', 'livemesh-el-addons'),
347
- 'tab' => Controls_Manager::TAB_STYLE,
348
- ]
349
- );
350
-
351
- $this->add_control(
352
- 'plan_name_tag',
353
- [
354
- 'label' => __('HTML Tag', 'livemesh-el-addons'),
355
- 'type' => Controls_Manager::SELECT,
356
- 'options' => [
357
- 'h1' => __('H1', 'livemesh-el-addons'),
358
- 'h2' => __('H2', 'livemesh-el-addons'),
359
- 'h3' => __('H3', 'livemesh-el-addons'),
360
- 'h4' => __('H4', 'livemesh-el-addons'),
361
- 'h5' => __('H5', 'livemesh-el-addons'),
362
- 'h6' => __('H6', 'livemesh-el-addons'),
363
- 'div' => __('div', 'livemesh-el-addons'),
364
- ],
365
- 'default' => 'h3',
366
- ]
367
- );
368
-
369
- $this->add_control(
370
- 'plan_name_color',
371
- [
372
- 'label' => __('Color', 'livemesh-el-addons'),
373
- 'type' => Controls_Manager::COLOR,
374
- 'selectors' => [
375
- '{{WRAPPER}} .lae-pricing-table .lae-top-header .lae-plan-name' => 'color: {{VALUE}};',
376
- ],
377
- ]
378
- );
379
-
380
- $this->add_group_control(
381
- Group_Control_Typography::get_type(),
382
- [
383
- 'name' => 'plan_name_typography',
384
- 'selector' => '{{WRAPPER}} .lae-pricing-table .lae-top-header .lae-plan-name',
385
- ]
386
- );
387
-
388
-
389
  $this->end_controls_section();
390
-
391
- $this->start_controls_section(
392
- 'section_plan_tagline',
393
- [
394
- 'label' => __('Plan Tagline', 'livemesh-el-addons'),
395
- 'tab' => Controls_Manager::TAB_STYLE,
396
- ]
397
- );
398
-
399
- $this->add_control(
400
- 'plan_tagline_color',
401
- [
402
- 'label' => __('Color', 'livemesh-el-addons'),
403
- 'type' => Controls_Manager::COLOR,
404
- 'selectors' => [
405
- '{{WRAPPER}} .lae-pricing-table .lae-top-header .lae-tagline' => 'color: {{VALUE}};',
406
- ],
407
- ]
408
- );
409
-
410
- $this->add_group_control(
411
- Group_Control_Typography::get_type(),
412
- [
413
- 'name' => 'plan_tagline_typography',
414
- 'selector' => '{{WRAPPER}} .lae-pricing-table .lae-top-header .lae-tagline',
415
- ]
416
- );
417
-
418
  $this->end_controls_section();
419
-
420
- $this->start_controls_section(
421
- 'section_plan_price',
422
- [
423
- 'label' => __('Plan Price', 'livemesh-el-addons'),
424
- 'tab' => Controls_Manager::TAB_STYLE,
425
- ]
426
- );
427
-
428
-
429
- $this->add_control(
430
- 'plan_price_tag',
431
- [
432
- 'label' => __('HTML Tag', 'livemesh-el-addons'),
433
- 'type' => Controls_Manager::SELECT,
434
- 'options' => [
435
- 'h1' => __('H1', 'livemesh-el-addons'),
436
- 'h2' => __('H2', 'livemesh-el-addons'),
437
- 'h3' => __('H3', 'livemesh-el-addons'),
438
- 'h4' => __('H4', 'livemesh-el-addons'),
439
- 'h5' => __('H5', 'livemesh-el-addons'),
440
- 'h6' => __('H6', 'livemesh-el-addons'),
441
- 'div' => __('div', 'livemesh-el-addons'),
442
- ],
443
- 'default' => 'h4',
444
- ]
445
- );
446
-
447
-
448
- $this->add_control(
449
- 'plan_price_color',
450
- [
451
- 'label' => __('Color', 'livemesh-el-addons'),
452
- 'type' => Controls_Manager::COLOR,
453
- 'selectors' => [
454
- '{{WRAPPER}} .lae-pricing-table .lae-pricing-plan .lae-plan-price span' => 'color: {{VALUE}};',
455
- ],
456
- ]
457
- );
458
-
459
- $this->add_group_control(
460
- Group_Control_Typography::get_type(),
461
- [
462
- 'name' => 'plan_price_typography',
463
- 'selector' => '{{WRAPPER}} .lae-pricing-table .lae-pricing-plan .lae-plan-price span',
464
- ]
465
- );
466
-
467
  $this->end_controls_section();
468
-
469
- $this->start_controls_section(
470
- 'section_item_title',
471
- [
472
- 'label' => __('Pricing Item Title', 'livemesh-el-addons'),
473
- 'tab' => Controls_Manager::TAB_STYLE,
474
- ]
475
- );
476
-
477
- $this->add_control(
478
- 'item_title_color',
479
- [
480
- 'label' => __('Color', 'livemesh-el-addons'),
481
- 'type' => Controls_Manager::COLOR,
482
- 'selectors' => [
483
- '{{WRAPPER}} .lae-pricing-table .lae-plan-details .lae-pricing-item .lae-title' => 'color: {{VALUE}};',
484
- ],
485
- ]
486
- );
487
-
488
- $this->add_group_control(
489
- Group_Control_Typography::get_type(),
490
- [
491
- 'name' => 'item_title_typography',
492
- 'selector' => '{{WRAPPER}} .lae-pricing-table .lae-plan-details .lae-pricing-item .lae-title',
493
- ]
494
- );
495
-
496
  $this->end_controls_section();
497
-
498
- $this->start_controls_section(
499
- 'section_item_value',
500
- [
501
- 'label' => __('Pricing Item Value', 'livemesh-el-addons'),
502
- 'tab' => Controls_Manager::TAB_STYLE,
503
- ]
504
- );
505
-
506
- $this->add_control(
507
- 'item_value_color',
508
- [
509
- 'label' => __('Color', 'livemesh-el-addons'),
510
- 'type' => Controls_Manager::COLOR,
511
- 'selectors' => [
512
- '{{WRAPPER}} .lae-pricing-table .lae-plan-details .lae-pricing-item .lae-value' => 'color: {{VALUE}};',
513
- ],
514
- ]
515
- );
516
-
517
- $this->add_group_control(
518
- Group_Control_Typography::get_type(),
519
- [
520
- 'name' => 'item_value_typography',
521
- 'selector' => '{{WRAPPER}} .lae-pricing-table .lae-plan-details .lae-pricing-item .lae-value',
522
- ]
523
- );
524
-
525
  $this->end_controls_section();
526
-
527
- $this->start_controls_section(
528
- 'section_purchase_button',
529
- [
530
- 'label' => __('Purchase Button', 'livemesh-el-addons'),
531
- 'tab' => Controls_Manager::TAB_STYLE,
532
- ]
533
- );
534
-
535
-
536
- $this->add_control(
537
- 'purchase_button_spacing',
538
- [
539
- 'label' => __('Button Spacing', 'livemesh-el-addons'),
540
- 'type' => Controls_Manager::DIMENSIONS,
541
- 'size_units' => ['px', '%', 'em'],
542
- 'default' => [
543
- 'top' => 15,
544
- 'right' => 15,
545
- 'bottom' => 15,
546
- 'left' => 15,
547
- 'unit' => 'px',
548
- ],
549
- 'selectors' => [
550
- '{{WRAPPER}} .lae-pricing-table .lae-purchase .lae-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
551
- ],
552
- ]
553
- );
554
-
555
- $this->add_control(
556
- 'purchase_button_size',
557
- [
558
- 'label' => __('Button Size', 'livemesh-el-addons'),
559
- 'type' => Controls_Manager::DIMENSIONS,
560
- 'size_units' => ['px', '%', 'em'],
561
- 'default' => [
562
- 'top' => 12,
563
- 'right' => 25,
564
- 'bottom' => 12,
565
- 'left' => 25,
566
- 'unit' => 'px',
567
- ],
568
- 'selectors' => [
569
- '{{WRAPPER}} .lae-pricing-table .lae-purchase .lae-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
570
- ],
571
- 'isLinked' => false
572
- ]
573
- );
574
-
575
- $this->add_control(
576
- 'button_custom_color',
577
- [
578
- 'label' => __('Button Color', 'livemesh-el-addons'),
579
- 'type' => Controls_Manager::COLOR,
580
- 'default' => '',
581
- 'selectors' => [
582
- '{{WRAPPER}} .lae-pricing-table .lae-purchase .lae-button' => 'background-color: {{VALUE}};',
583
- ],
584
- ]
585
- );
586
-
587
- $this->add_control(
588
- 'button_custom_hover_color',
589
- [
590
- 'label' => __('Button Hover Color', 'livemesh-el-addons'),
591
- 'type' => Controls_Manager::COLOR,
592
- 'default' => '',
593
- 'selectors' => [
594
- '{{WRAPPER}} .lae-pricing-table .lae-purchase .lae-button:hover' => 'background-color: {{VALUE}};',
595
- ],
596
- ]
597
- );
598
-
599
- $this->add_control(
600
- 'purchase_button_color',
601
- [
602
- 'label' => __('Label Color', 'livemesh-el-addons'),
603
- 'type' => Controls_Manager::COLOR,
604
- 'selectors' => [
605
- '{{WRAPPER}} .lae-pricing-table .lae-purchase .lae-button' => 'color: {{VALUE}};',
606
- ],
607
- ]
608
- );
609
-
610
- $this->add_group_control(
611
- Group_Control_Typography::get_type(),
612
- [
613
- 'name' => 'purchase_button_typography',
614
- 'selector' => '{{WRAPPER}} .lae-pricing-table .lae-purchase .lae-button',
615
- ]
616
- );
617
-
618
  $this->end_controls_section();
619
-
620
  }
621
-
622
- protected function render() {
623
-
624
  $settings = $this->get_settings_for_display();
625
-
626
- $settings = apply_filters('lae_pricing_table_' . $this->get_id() . '_settings', $settings);
627
-
628
- if (empty($settings['pricing_plans']))
629
  return;
630
-
631
  $args['settings'] = $settings;
632
-
633
  $args['widget_instance'] = $this;
634
-
635
- lae_get_template_part('addons/pricing-table/loop', $args);
636
-
637
  }
638
-
639
- protected function content_template() {
 
640
  }
641
 
642
  }
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
 
9
  namespace LivemeshAddons\Widgets;
10
 
11
+ use Elementor\Repeater ;
12
+ use Elementor\Widget_Base ;
13
+ use Elementor\Controls_Manager ;
14
+ use Elementor\Utils ;
15
+ use Elementor\Scheme_Color ;
16
+ use Elementor\Group_Control_Typography ;
17
+ use Elementor\Scheme_Typography ;
18
+ if ( !defined( 'ABSPATH' ) ) {
19
+ exit;
20
+ }
21
+ // Exit if accessed directly
22
+ class LAE_Pricing_Table_Widget extends LAE_Widget_Base
23
+ {
24
+ public function __construct( $data = array(), $args = null )
25
+ {
26
+ parent::__construct( $data, $args );
27
+ add_shortcode( 'lae_pricing_item', array( $this, 'pricing_item_shortcode' ) );
 
 
28
  }
29
+
30
+ public function pricing_item_shortcode( $atts, $content = null, $tag )
31
+ {
32
  $title = $value = '';
33
+ $args = shortcode_atts( array(
 
34
  'title' => '',
35
+ 'value' => '',
36
+ ), $atts );
37
+ $output = lae_get_template_part( 'addons/pricing-table/pricing-item', $args, true );
 
 
 
38
  return $output;
39
  }
40
+
41
+ public function get_name()
42
+ {
43
  return 'lae-pricing-table';
44
  }
45
+
46
+ public function get_title()
47
+ {
48
+ return __( 'Pricing Table', 'livemesh-el-addons' );
49
  }
50
+
51
+ public function get_icon()
52
+ {
53
  return 'lae-icon-pricing-table';
54
  }
55
+
56
+ public function get_categories()
57
+ {
58
+ return array( 'livemesh-addons' );
59
  }
60
+
61
+ public function get_custom_help_url()
62
+ {
63
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/pricing-table/';
64
  }
65
+
66
+ public function get_script_depends()
67
+ {
68
+ return [ 'lae-waypoints', 'lae-frontend-scripts' ];
 
 
69
  }
70
+
71
+ public function get_style_depends()
72
+ {
73
+ return [ 'lae-animate-styles', 'lae-frontend-styles', 'lae-pricing-plans-styles' ];
 
 
 
74
  }
75
+
76
+ protected function _register_controls()
77
+ {
78
+ $this->start_controls_section( 'section_pricing_table', [
79
+ 'label' => __( 'Pricing Table', 'livemesh-el-addons' ),
80
+ ] );
81
+ $this->add_control( 'pricing_heading', [
82
+ 'label' => __( 'Pricing Plans', 'livemesh-el-addons' ),
83
+ 'type' => Controls_Manager::HEADING,
84
+ ] );
 
 
 
 
 
 
 
 
85
  $repeater = new Repeater();
86
+ $repeater->add_control( 'pricing_title', [
87
+ 'type' => Controls_Manager::TEXT,
88
+ 'label' => __( 'Pricing Plan Title', 'livemesh-el-addons' ),
89
+ 'default' => __( 'My pricing plan title', 'livemesh-el-addons' ),
90
+ 'label_block' => true,
91
+ 'dynamic' => [
92
+ 'active' => true,
93
+ ],
94
+ ] );
95
+ $repeater->add_control( 'tagline', [
96
+ 'type' => Controls_Manager::TEXT,
97
+ 'label' => __( 'Tagline Text', 'livemesh-el-addons' ),
98
+ 'description' => __( 'Provide any subtitle or taglines like "Most Popular", "Best Value", "Best Selling", "Most Flexible" etc. that you would like to use for this pricing plan.', 'livemesh-el-addons' ),
99
+ 'dynamic' => [
100
+ 'active' => true,
101
+ ],
102
+ ] );
103
+ $repeater->add_control( 'pricing_image', [
104
+ 'label' => __( 'Pricing Image', 'livemesh-el-addons' ),
105
+ 'type' => Controls_Manager::MEDIA,
106
+ 'default' => [
107
+ 'url' => Utils::get_placeholder_image_src(),
108
+ ],
109
+ 'label_block' => true,
110
+ 'dynamic' => [
111
+ 'active' => true,
112
+ ],
113
+ ] );
114
+ $repeater->add_control( 'price_tag', [
115
+ 'type' => Controls_Manager::TEXT,
116
+ 'label' => __( 'Price Tag', 'livemesh-el-addons' ),
117
+ 'description' => __( 'Enter the price tag for the pricing plan. HTML is accepted.', 'livemesh-el-addons' ),
118
+ 'dynamic' => [
119
+ 'active' => true,
120
+ ],
121
+ ] );
122
+ $repeater->add_control( 'button_text', [
123
+ 'type' => Controls_Manager::TEXT,
124
+ 'label' => __( 'Text for Pricing Link/Button', 'livemesh-el-addons' ),
125
+ 'dynamic' => [
126
+ 'active' => true,
127
+ ],
128
+ ] );
129
+ $repeater->add_control( 'button_url', [
130
+ 'label' => __( 'URL for the Pricing link/button', 'livemesh-el-addons' ),
131
+ 'type' => Controls_Manager::URL,
132
+ 'label_block' => true,
133
+ 'default' => [
134
+ 'url' => '',
135
+ 'is_external' => 'true',
136
+ ],
137
+ 'placeholder' => __( 'http://your-link.com', 'livemesh-el-addons' ),
138
+ 'dynamic' => [
139
+ 'active' => true,
140
+ ],
141
+ ] );
142
+ $repeater->add_control( 'highlight', [
143
+ 'label' => __( 'Highlight Pricing Plan', 'livemesh-el-addons' ),
144
+ 'type' => Controls_Manager::SWITCHER,
145
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
146
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
147
+ 'return_value' => 'yes',
148
+ 'default' => 'no',
149
+ ] );
150
+ $repeater->add_control( 'pricing_content', [
151
+ 'type' => Controls_Manager::TEXTAREA,
152
+ 'label' => __( 'Pricing Plan Details', 'livemesh-el-addons' ),
153
+ 'description' => __( 'Enter the content for the pricing plan that include information about individual features of the pricing plan. For prebuilt styling, enter shortcodes content like - [lae_pricing_item title="Storage Space" value="50 GB"] [lae_pricing_item title="Video Uploads" value="50"][lae_pricing_item title="Portfolio Items" value="20"]', 'livemesh-el-addons' ),
154
+ 'show_label' => true,
155
+ 'rows' => 10,
156
+ 'dynamic' => [
157
+ 'active' => true,
158
+ ],
159
+ ] );
160
+ $repeater->add_control( "widget_animation", [
161
+ "type" => Controls_Manager::SELECT,
162
+ "label" => __( "Animation Type", "livemesh-el-addons" ),
163
+ 'options' => lae_get_animation_options(),
164
+ 'default' => 'none',
165
+ ] );
166
+ $this->add_control( 'pricing_plans', [
167
+ 'type' => Controls_Manager::REPEATER,
168
+ 'fields' => $repeater->get_controls(),
169
+ 'title_field' => '{{{ pricing_title }}}',
170
+ ] );
171
+ $this->add_control( 'upgrade_notice', [
172
+ 'type' => Controls_Manager::RAW_HTML,
173
+ 'separator' => 'before',
174
+ 'raw' => '<div style="text-align:center;line-height:1.6;"><p>' . __( 'Unlock new possibilities with premium widgets and styles of <strong>Livemesh Addons for Elementor <i>Premium</i></strong>. ', 'livemesh-el-addons' ) . '</p><p style="padding-top:15px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://livemeshelementor.com/pricing/#pricing-plans" target="_blank"><i class="fa fa-hand-o-right" aria-hidden="true"></i>' . __( 'Go Pro', 'livemesh-el-addons' ) . '</a></p></div>',
175
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  $this->end_controls_section();
177
+ $this->start_controls_section( 'section_grid_settings', [
178
+ 'label' => __( 'Grid Settings', 'livemesh-el-addons' ),
179
+ 'tab' => Controls_Manager::TAB_SETTINGS,
180
+ ] );
181
+ $this->add_control( 'column_layout', [
182
+ 'label' => __( 'Column Layout', 'livemesh-el-addons' ),
183
+ 'type' => Controls_Manager::SELECT,
184
+ 'options' => array(
185
+ 'auto' => __( 'Auto', 'livemesh-el-addons' ),
186
+ 'custom' => __( 'Custom', 'livemesh-el-addons' ),
187
+ ),
188
+ 'default' => 'auto',
189
+ 'description' => __( 'Set column layout to be <strong>Auto</strong> to let the widget auto calculate number of columns based on minimum column size specified. The option <strong>Custom</strong> lets you explicitly control number of columns based on screen width.', 'livemesh-el-addons' ),
190
+ ] );
191
+ $this->add_control( 'min_column_size', [
192
+ 'label' => __( 'Minimum Column Size', 'livemesh-el-addons' ),
193
+ 'type' => Controls_Manager::SLIDER,
194
+ 'size_units' => [ 'px' ],
195
+ 'default' => [
196
+ 'size' => 300,
197
+ ],
198
+ 'range' => [
199
+ 'px' => [
200
+ 'min' => 50,
201
+ 'max' => 500,
202
+ ],
203
+ ],
204
+ 'selectors' => [
205
+ '{{WRAPPER}} .lae-uber-grid-container.lae-grid-auto-column-layout' => 'grid-template-columns: repeat(auto-fit, minmax({{SIZE}}{{UNIT}}, 1fr));',
206
+ ],
207
+ 'condition' => [
208
+ 'column_layout' => 'auto',
209
+ ],
210
+ ] );
211
+ $this->add_responsive_control( 'per_line', [
212
+ 'label' => __( 'Pricing plans in a row', 'livemesh-el-addons' ),
213
+ 'type' => Controls_Manager::SELECT,
214
+ 'default' => '3',
215
+ 'tablet_default' => '2',
216
+ 'mobile_default' => '1',
217
+ 'options' => [
218
+ '1' => '1',
219
+ '2' => '2',
220
+ '3' => '3',
221
+ '4' => '4',
222
+ '5' => '5',
223
+ '6' => '6',
224
+ ],
225
+ 'frontend_available' => true,
226
+ 'condition' => [
227
+ 'column_layout' => 'custom',
228
+ ],
229
+ ] );
230
+ $this->add_control( 'column_gap', [
231
+ 'label' => __( 'Column Gap', 'livemesh-el-addons' ),
232
+ 'type' => Controls_Manager::SLIDER,
233
+ 'size_units' => [ 'px' ],
234
+ 'default' => [
235
+ 'size' => 30,
236
+ ],
237
+ 'range' => [
238
+ 'px' => [
239
+ 'min' => 0,
240
+ 'max' => 100,
241
+ ],
242
+ ],
243
+ 'selectors' => [
244
+ '{{WRAPPER}} .lae-uber-grid-container' => 'column-gap: {{SIZE}}{{UNIT}};',
245
+ ],
246
+ ] );
247
+ $this->add_control( 'row_gap', [
248
+ 'label' => __( 'Row Gap', 'livemesh-el-addons' ),
249
+ 'type' => Controls_Manager::SLIDER,
250
+ 'size_units' => [ 'px' ],
251
+ 'default' => [
252
+ 'size' => 30,
253
+ ],
254
+ 'range' => [
255
+ 'px' => [
256
+ 'min' => 0,
257
+ 'max' => 100,
258
+ ],
259
+ ],
260
+ 'selectors' => [
261
+ '{{WRAPPER}} .lae-uber-grid-container' => 'row-gap: {{SIZE}}{{UNIT}};',
262
+ ],
263
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
264
  $this->end_controls_section();
265
+ $this->start_controls_section( 'section_pricing_style', [
266
+ 'label' => __( 'Plan Name', 'livemesh-el-addons' ),
267
+ 'tab' => Controls_Manager::TAB_STYLE,
268
+ ] );
269
+ $this->add_control( 'plan_name_tag', [
270
+ 'label' => __( 'HTML Tag', 'livemesh-el-addons' ),
271
+ 'type' => Controls_Manager::SELECT,
272
+ 'options' => [
273
+ 'h1' => __( 'H1', 'livemesh-el-addons' ),
274
+ 'h2' => __( 'H2', 'livemesh-el-addons' ),
275
+ 'h3' => __( 'H3', 'livemesh-el-addons' ),
276
+ 'h4' => __( 'H4', 'livemesh-el-addons' ),
277
+ 'h5' => __( 'H5', 'livemesh-el-addons' ),
278
+ 'h6' => __( 'H6', 'livemesh-el-addons' ),
279
+ 'div' => __( 'div', 'livemesh-el-addons' ),
280
+ ],
281
+ 'default' => 'h3',
282
+ ] );
283
+ $this->add_control( 'plan_name_color', [
284
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
285
+ 'type' => Controls_Manager::COLOR,
286
+ 'selectors' => [
287
+ '{{WRAPPER}} .lae-pricing-table .lae-top-header .lae-plan-name' => 'color: {{VALUE}};',
288
+ ],
289
+ ] );
290
+ $this->add_group_control( Group_Control_Typography::get_type(), [
291
+ 'name' => 'plan_name_typography',
292
+ 'selector' => '{{WRAPPER}} .lae-pricing-table .lae-top-header .lae-plan-name',
293
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
  $this->end_controls_section();
295
+ $this->start_controls_section( 'section_plan_tagline', [
296
+ 'label' => __( 'Plan Tagline', 'livemesh-el-addons' ),
297
+ 'tab' => Controls_Manager::TAB_STYLE,
298
+ ] );
299
+ $this->add_control( 'plan_tagline_color', [
300
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
301
+ 'type' => Controls_Manager::COLOR,
302
+ 'selectors' => [
303
+ '{{WRAPPER}} .lae-pricing-table .lae-top-header .lae-tagline' => 'color: {{VALUE}};',
304
+ ],
305
+ ] );
306
+ $this->add_group_control( Group_Control_Typography::get_type(), [
307
+ 'name' => 'plan_tagline_typography',
308
+ 'selector' => '{{WRAPPER}} .lae-pricing-table .lae-top-header .lae-tagline',
309
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
310
  $this->end_controls_section();
311
+ $this->start_controls_section( 'section_plan_price', [
312
+ 'label' => __( 'Plan Price', 'livemesh-el-addons' ),
313
+ 'tab' => Controls_Manager::TAB_STYLE,
314
+ ] );
315
+ $this->add_control( 'plan_price_tag', [
316
+ 'label' => __( 'HTML Tag', 'livemesh-el-addons' ),
317
+ 'type' => Controls_Manager::SELECT,
318
+ 'options' => [
319
+ 'h1' => __( 'H1', 'livemesh-el-addons' ),
320
+ 'h2' => __( 'H2', 'livemesh-el-addons' ),
321
+ 'h3' => __( 'H3', 'livemesh-el-addons' ),
322
+ 'h4' => __( 'H4', 'livemesh-el-addons' ),
323
+ 'h5' => __( 'H5', 'livemesh-el-addons' ),
324
+ 'h6' => __( 'H6', 'livemesh-el-addons' ),
325
+ 'div' => __( 'div', 'livemesh-el-addons' ),
326
+ ],
327
+ 'default' => 'h4',
328
+ ] );
329
+ $this->add_control( 'plan_price_color', [
330
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
331
+ 'type' => Controls_Manager::COLOR,
332
+ 'selectors' => [
333
+ '{{WRAPPER}} .lae-pricing-table .lae-pricing-plan .lae-plan-price span' => 'color: {{VALUE}};',
334
+ ],
335
+ ] );
336
+ $this->add_group_control( Group_Control_Typography::get_type(), [
337
+ 'name' => 'plan_price_typography',
338
+ 'selector' => '{{WRAPPER}} .lae-pricing-table .lae-pricing-plan .lae-plan-price span',
339
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
340
  $this->end_controls_section();
341
+ $this->start_controls_section( 'section_item_title', [
342
+ 'label' => __( 'Pricing Item Title', 'livemesh-el-addons' ),
343
+ 'tab' => Controls_Manager::TAB_STYLE,
344
+ ] );
345
+ $this->add_control( 'item_title_color', [
346
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
347
+ 'type' => Controls_Manager::COLOR,
348
+ 'selectors' => [
349
+ '{{WRAPPER}} .lae-pricing-table .lae-plan-details .lae-pricing-item .lae-title' => 'color: {{VALUE}};',
350
+ ],
351
+ ] );
352
+ $this->add_group_control( Group_Control_Typography::get_type(), [
353
+ 'name' => 'item_title_typography',
354
+ 'selector' => '{{WRAPPER}} .lae-pricing-table .lae-plan-details .lae-pricing-item .lae-title',
355
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
356
  $this->end_controls_section();
357
+ $this->start_controls_section( 'section_item_value', [
358
+ 'label' => __( 'Pricing Item Value', 'livemesh-el-addons' ),
359
+ 'tab' => Controls_Manager::TAB_STYLE,
360
+ ] );
361
+ $this->add_control( 'item_value_color', [
362
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
363
+ 'type' => Controls_Manager::COLOR,
364
+ 'selectors' => [
365
+ '{{WRAPPER}} .lae-pricing-table .lae-plan-details .lae-pricing-item .lae-value' => 'color: {{VALUE}};',
366
+ ],
367
+ ] );
368
+ $this->add_group_control( Group_Control_Typography::get_type(), [
369
+ 'name' => 'item_value_typography',
370
+ 'selector' => '{{WRAPPER}} .lae-pricing-table .lae-plan-details .lae-pricing-item .lae-value',
371
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
372
  $this->end_controls_section();
373
+ $this->start_controls_section( 'section_purchase_button', [
374
+ 'label' => __( 'Purchase Button', 'livemesh-el-addons' ),
375
+ 'tab' => Controls_Manager::TAB_STYLE,
376
+ ] );
377
+ $this->add_control( 'purchase_button_spacing', [
378
+ 'label' => __( 'Button Spacing', 'livemesh-el-addons' ),
379
+ 'type' => Controls_Manager::DIMENSIONS,
380
+ 'size_units' => [ 'px', '%', 'em' ],
381
+ 'default' => [
382
+ 'top' => 15,
383
+ 'right' => 15,
384
+ 'bottom' => 15,
385
+ 'left' => 15,
386
+ 'unit' => 'px',
387
+ ],
388
+ 'selectors' => [
389
+ '{{WRAPPER}} .lae-pricing-table .lae-purchase .lae-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
390
+ ],
391
+ ] );
392
+ $this->add_control( 'purchase_button_size', [
393
+ 'label' => __( 'Button Size', 'livemesh-el-addons' ),
394
+ 'type' => Controls_Manager::DIMENSIONS,
395
+ 'size_units' => [ 'px', '%', 'em' ],
396
+ 'default' => [
397
+ 'top' => 12,
398
+ 'right' => 25,
399
+ 'bottom' => 12,
400
+ 'left' => 25,
401
+ 'unit' => 'px',
402
+ ],
403
+ 'selectors' => [
404
+ '{{WRAPPER}} .lae-pricing-table .lae-purchase .lae-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
405
+ ],
406
+ 'isLinked' => false,
407
+ ] );
408
+ $this->add_control( 'button_custom_color', [
409
+ 'label' => __( 'Button Color', 'livemesh-el-addons' ),
410
+ 'type' => Controls_Manager::COLOR,
411
+ 'default' => '',
412
+ 'selectors' => [
413
+ '{{WRAPPER}} .lae-pricing-table .lae-purchase .lae-button' => 'background-color: {{VALUE}};',
414
+ ],
415
+ ] );
416
+ $this->add_control( 'button_custom_hover_color', [
417
+ 'label' => __( 'Button Hover Color', 'livemesh-el-addons' ),
418
+ 'type' => Controls_Manager::COLOR,
419
+ 'default' => '',
420
+ 'selectors' => [
421
+ '{{WRAPPER}} .lae-pricing-table .lae-purchase .lae-button:hover' => 'background-color: {{VALUE}};',
422
+ ],
423
+ ] );
424
+ $this->add_control( 'purchase_button_color', [
425
+ 'label' => __( 'Label Color', 'livemesh-el-addons' ),
426
+ 'type' => Controls_Manager::COLOR,
427
+ 'selectors' => [
428
+ '{{WRAPPER}} .lae-pricing-table .lae-purchase .lae-button' => 'color: {{VALUE}};',
429
+ ],
430
+ ] );
431
+ $this->add_group_control( Group_Control_Typography::get_type(), [
432
+ 'name' => 'purchase_button_typography',
433
+ 'selector' => '{{WRAPPER}} .lae-pricing-table .lae-purchase .lae-button',
434
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
435
  $this->end_controls_section();
 
436
  }
437
+
438
+ protected function render()
439
+ {
440
  $settings = $this->get_settings_for_display();
441
+ $settings = apply_filters( 'lae_pricing_table_' . $this->get_id() . '_settings', $settings );
442
+ if ( empty($settings['pricing_plans']) ) {
 
 
443
  return;
444
+ }
445
  $args['settings'] = $settings;
 
446
  $args['widget_instance'] = $this;
447
+ lae_get_template_part( 'addons/pricing-table/loop', $args );
 
 
448
  }
449
+
450
+ protected function content_template()
451
+ {
452
  }
453
 
454
  }
includes/widgets/services.php CHANGED
@@ -169,6 +169,11 @@ class LAE_Services_Widget extends LAE_Widget_Base
169
  'fields' => $repeater->get_controls(),
170
  'title_field' => '{{{ service_title }}}',
171
  ] );
 
 
 
 
 
172
  $this->end_controls_section();
173
  $this->start_controls_section( 'section_general_settings', [
174
  'label' => __( 'General Settings', 'livemesh-el-addons' ),
169
  'fields' => $repeater->get_controls(),
170
  'title_field' => '{{{ service_title }}}',
171
  ] );
172
+ $this->add_control( 'upgrade_notice', [
173
+ 'type' => Controls_Manager::RAW_HTML,
174
+ 'separator' => 'before',
175
+ 'raw' => '<div style="text-align:center;line-height:1.6;"><p>' . __( 'Unlock new possibilities with premium widgets and styles of <strong>Livemesh Addons for Elementor <i>Premium</i></strong>. ', 'livemesh-el-addons' ) . '</p><p style="padding-top:15px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://livemeshelementor.com/pricing/#pricing-plans" target="_blank"><i class="fa fa-hand-o-right" aria-hidden="true"></i>' . __( 'Go Pro', 'livemesh-el-addons' ) . '</a></p></div>',
176
+ ] );
177
  $this->end_controls_section();
178
  $this->start_controls_section( 'section_general_settings', [
179
  'label' => __( 'General Settings', 'livemesh-el-addons' ),
includes/widgets/stats-bars.php CHANGED
@@ -6,291 +6,205 @@ Description: Display multiple stats bars that talk about skills or other percent
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
9
-
10
-
11
  namespace LivemeshAddons\Widgets;
12
 
13
- use Elementor\Repeater;
14
- use Elementor\Widget_Base;
15
- use Elementor\Controls_Manager;
16
- use Elementor\Scheme_Color;
17
- use Elementor\Group_Control_Typography;
18
- use Elementor\Scheme_Typography;
19
-
20
- if (!defined('ABSPATH'))
21
- exit; // Exit if accessed directly
22
-
23
-
24
- class LAE_Stats_Bars_Widget extends LAE_Widget_Base {
25
-
26
- public function get_name() {
27
  return 'lae-stats-bars';
28
  }
29
-
30
- public function get_title() {
31
- return __('Stats Bars', 'livemesh-el-addons');
 
32
  }
33
-
34
- public function get_icon() {
 
35
  return 'lae-icon-stats-bars';
36
  }
37
-
38
- public function get_categories() {
39
- return array('livemesh-addons');
 
40
  }
41
-
42
- public function get_custom_help_url() {
 
43
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/statistics-addons/';
44
  }
45
-
46
- public function get_script_depends() {
47
- return [
48
- 'lae-waypoints',
49
- 'lae-frontend-scripts',
50
- 'lae-stats-bars-scripts'
51
- ];
52
  }
53
-
54
- public function get_style_depends() {
55
- return [
56
- 'lae-animate-styles',
57
- 'lae-frontend-styles',
58
- 'lae-stats-bars-styles'
59
- ];
60
  }
61
-
62
- protected function _register_controls() {
63
-
64
- $this->start_controls_section(
65
- 'section_stats_bars',
66
- [
67
- 'label' => __('Stats Bars', 'livemesh-el-addons'),
68
- ]
69
- );
70
-
71
  $repeater = new Repeater();
72
-
73
- $repeater->add_control(
74
- 'stats_title',
75
- [
76
-
77
- 'label' => __('Stats Title', 'livemesh-el-addons'),
78
- 'type' => Controls_Manager::TEXT,
79
- 'description' => __('The title for the stats bar', 'livemesh-el-addons'),
80
- 'default' => __('My stats title', 'livemesh-el-addons'),
81
- 'dynamic' => [
82
- 'active' => true,
83
- ],
84
- ]
85
- );
86
-
87
- $repeater->add_control(
88
- 'percentage_value',
89
- [
90
-
91
- 'label' => __('Percentage Value', 'livemesh-el-addons'),
92
- 'type' => Controls_Manager::NUMBER,
93
- 'min' => 1,
94
- 'max' => 100,
95
- 'step' => 1,
96
- 'default' => 30,
97
- 'description' => __('The percentage value for the stats.', 'livemesh-el-addons'),
98
- ]
99
- );
100
-
101
- $repeater->add_control(
102
- 'bar_color',
103
- [
104
-
105
- 'label' => __('Bar Color', 'livemesh-el-addons'),
106
- 'type' => Controls_Manager::COLOR,
107
- 'default' => '#f94213',
108
- ]
109
- );
110
-
111
- $this->add_control(
112
- 'stats_bars',
113
- [
114
- 'type' => Controls_Manager::REPEATER,
115
- 'default' => [
116
- [
117
- 'stats_title' => __('Web Design', 'livemesh-el-addons'),
118
- 'percentage_value' => 87,
119
- ],
120
-
121
- [
122
- 'stats_title' => __('SEO Services', 'livemesh-el-addons'),
123
- 'percentage_value' => 76,
124
- ],
125
-
126
- [
127
- 'stats_title' => __('Brand Marketing', 'livemesh-el-addons'),
128
- 'percentage_value' => 40,
129
- ],
130
- ],
131
- 'fields' => $repeater->get_controls(),
132
- 'title_field' => '{{{ stats_title }}}',
133
- ]
134
- );
135
-
136
  $this->end_controls_section();
137
-
138
- $this->start_controls_section(
139
- 'section_stats_bar_styling',
140
- [
141
- 'label' => __('Stats Bar', 'livemesh-el-addons'),
142
- 'tab' => Controls_Manager::TAB_STYLE,
143
- ]
144
- );
145
-
146
- $this->add_control(
147
- 'stats_bar_bg_color',
148
- [
149
- 'label' => __('Stats Bar Background Color', 'livemesh-el-addons'),
150
- 'type' => Controls_Manager::COLOR,
151
- 'selectors' => [
152
- '{{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-bar-bg' => 'background-color: {{VALUE}};',
153
- ],
154
- ]
155
- );
156
-
157
-
158
- $this->add_control(
159
- 'stats_bar_spacing',
160
- [
161
- 'label' => __('Stats Bar Spacing', 'livemesh-el-addons'),
162
- 'type' => Controls_Manager::SLIDER,
163
- 'size_units' => ['px'],
164
- 'default' => [
165
- 'size' => 18,
166
- ],
167
- 'range' => [
168
- 'px' => [
169
- 'min' => 5,
170
- 'max' => 128,
171
- ],
172
- ],
173
- 'selectors' => [
174
- '{{WRAPPER}} .lae-stats-bars .lae-stats-bar' => 'margin-bottom: {{SIZE}}{{UNIT}};',
175
- ],
176
- ]
177
- );
178
-
179
-
180
- $this->add_control(
181
- 'stats_bar_height',
182
- [
183
- 'label' => __('Stats Bar Height', 'livemesh-el-addons'),
184
- 'type' => Controls_Manager::SLIDER,
185
- 'size_units' => ['px'],
186
- 'default' => [
187
- 'size' => 10,
188
- ],
189
- 'range' => [
190
- 'px' => [
191
- 'min' => 1,
192
- 'max' => 96,
193
- ],
194
- ],
195
- 'selectors' => [
196
- '{{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-bar-bg, {{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-bar-content' => 'height: {{SIZE}}{{UNIT}};',
197
- '{{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-bar-bg' => 'margin-top: -{{SIZE}}{{UNIT}};',
198
- ],
199
- ]
200
- );
201
-
202
-
203
- $this->add_control(
204
- 'stats_bar_border_radius',
205
- [
206
- 'label' => __('Stats Bar Border Radius', 'livemesh-el-addons'),
207
- 'type' => Controls_Manager::DIMENSIONS,
208
- 'size_units' => ['px', '%'],
209
- 'selectors' => [
210
- '{{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-bar-bg, {{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-bar-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
211
- ],
212
- ]
213
- );
214
-
215
-
216
  $this->end_controls_section();
217
-
218
-
219
- $this->start_controls_section(
220
- 'section_stats_title',
221
- [
222
- 'label' => __('Stats Title', 'livemesh-el-addons'),
223
- 'tab' => Controls_Manager::TAB_STYLE,
224
- ]
225
- );
226
-
227
- $this->add_control(
228
- 'stats_title_color',
229
- [
230
- 'label' => __('Color', 'livemesh-el-addons'),
231
- 'type' => Controls_Manager::COLOR,
232
- 'selectors' => [
233
- '{{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-title' => 'color: {{VALUE}};',
234
- ],
235
- ]
236
- );
237
-
238
- $this->add_group_control(
239
- Group_Control_Typography::get_type(),
240
- [
241
- 'name' => 'stats_title_typography',
242
- 'selector' => '{{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-title',
243
- ]
244
- );
245
-
246
  $this->end_controls_section();
247
-
248
- $this->start_controls_section(
249
- 'section_stats_percentage',
250
- [
251
- 'label' => __('Stats Percentage', 'livemesh-el-addons'),
252
- 'tab' => Controls_Manager::TAB_STYLE,
253
- ]
254
- );
255
-
256
- $this->add_control(
257
- 'stats_percentage_color',
258
- [
259
- 'label' => __('Color', 'livemesh-el-addons'),
260
- 'type' => Controls_Manager::COLOR,
261
- 'selectors' => [
262
- '{{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-title span' => 'color: {{VALUE}};',
263
- ],
264
- ]
265
- );
266
-
267
- $this->add_group_control(
268
- Group_Control_Typography::get_type(),
269
- [
270
- 'name' => 'stats_percentage_typography',
271
- 'selector' => '{{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-title span',
272
- ]
273
- );
274
-
275
  $this->end_controls_section();
276
  }
277
-
278
- protected function render() {
279
-
280
  $settings = $this->get_settings_for_display();
281
-
282
- $settings = apply_filters('lae_stats_bars_' . $this->get_id() . '_settings', $settings);
283
-
284
  $args['settings'] = $settings;
285
-
286
  $args['widget_instance'] = $this;
287
-
288
- lae_get_template_part('addons/stats-bars/loop', $args);
289
-
290
  }
291
-
292
- protected function content_template() {
293
-
294
  }
295
 
296
  }
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
 
 
9
  namespace LivemeshAddons\Widgets;
10
 
11
+ use Elementor\Repeater ;
12
+ use Elementor\Widget_Base ;
13
+ use Elementor\Controls_Manager ;
14
+ use Elementor\Scheme_Color ;
15
+ use Elementor\Group_Control_Typography ;
16
+ use Elementor\Scheme_Typography ;
17
+ if ( !defined( 'ABSPATH' ) ) {
18
+ exit;
19
+ }
20
+ // Exit if accessed directly
21
+ class LAE_Stats_Bars_Widget extends LAE_Widget_Base
22
+ {
23
+ public function get_name()
24
+ {
25
  return 'lae-stats-bars';
26
  }
27
+
28
+ public function get_title()
29
+ {
30
+ return __( 'Stats Bars', 'livemesh-el-addons' );
31
  }
32
+
33
+ public function get_icon()
34
+ {
35
  return 'lae-icon-stats-bars';
36
  }
37
+
38
+ public function get_categories()
39
+ {
40
+ return array( 'livemesh-addons' );
41
  }
42
+
43
+ public function get_custom_help_url()
44
+ {
45
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/statistics-addons/';
46
  }
47
+
48
+ public function get_script_depends()
49
+ {
50
+ return [ 'lae-waypoints', 'lae-frontend-scripts', 'lae-stats-bars-scripts' ];
 
 
 
51
  }
52
+
53
+ public function get_style_depends()
54
+ {
55
+ return [ 'lae-animate-styles', 'lae-frontend-styles', 'lae-stats-bars-styles' ];
 
 
 
56
  }
57
+
58
+ protected function _register_controls()
59
+ {
60
+ $this->start_controls_section( 'section_stats_bars', [
61
+ 'label' => __( 'Stats Bars', 'livemesh-el-addons' ),
62
+ ] );
 
 
 
 
63
  $repeater = new Repeater();
64
+ $repeater->add_control( 'stats_title', [
65
+ 'label' => __( 'Stats Title', 'livemesh-el-addons' ),
66
+ 'type' => Controls_Manager::TEXT,
67
+ 'description' => __( 'The title for the stats bar', 'livemesh-el-addons' ),
68
+ 'default' => __( 'My stats title', 'livemesh-el-addons' ),
69
+ 'dynamic' => [
70
+ 'active' => true,
71
+ ],
72
+ ] );
73
+ $repeater->add_control( 'percentage_value', [
74
+ 'label' => __( 'Percentage Value', 'livemesh-el-addons' ),
75
+ 'type' => Controls_Manager::NUMBER,
76
+ 'min' => 1,
77
+ 'max' => 100,
78
+ 'step' => 1,
79
+ 'default' => 30,
80
+ 'description' => __( 'The percentage value for the stats.', 'livemesh-el-addons' ),
81
+ ] );
82
+ $repeater->add_control( 'bar_color', [
83
+ 'label' => __( 'Bar Color', 'livemesh-el-addons' ),
84
+ 'type' => Controls_Manager::COLOR,
85
+ 'default' => '#f94213',
86
+ ] );
87
+ $this->add_control( 'stats_bars', [
88
+ 'type' => Controls_Manager::REPEATER,
89
+ 'default' => [ [
90
+ 'stats_title' => __( 'Web Design', 'livemesh-el-addons' ),
91
+ 'percentage_value' => 87,
92
+ ], [
93
+ 'stats_title' => __( 'SEO Services', 'livemesh-el-addons' ),
94
+ 'percentage_value' => 76,
95
+ ], [
96
+ 'stats_title' => __( 'Brand Marketing', 'livemesh-el-addons' ),
97
+ 'percentage_value' => 40,
98
+ ] ],
99
+ 'fields' => $repeater->get_controls(),
100
+ 'title_field' => '{{{ stats_title }}}',
101
+ ] );
102
+ $this->add_control( 'upgrade_notice', [
103
+ 'type' => Controls_Manager::RAW_HTML,
104
+ 'separator' => 'before',
105
+ 'raw' => '<div style="text-align:center;line-height:1.6;"><p>' . __( 'Unlock new possibilities with premium widgets and styles of <strong>Livemesh Addons for Elementor <i>Premium</i></strong>. ', 'livemesh-el-addons' ) . '</p><p style="padding-top:15px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://livemeshelementor.com/pricing/#pricing-plans" target="_blank"><i class="fa fa-hand-o-right" aria-hidden="true"></i>' . __( 'Go Pro', 'livemesh-el-addons' ) . '</a></p></div>',
106
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  $this->end_controls_section();
108
+ $this->start_controls_section( 'section_stats_bar_styling', [
109
+ 'label' => __( 'Stats Bar', 'livemesh-el-addons' ),
110
+ 'tab' => Controls_Manager::TAB_STYLE,
111
+ ] );
112
+ $this->add_control( 'stats_bar_bg_color', [
113
+ 'label' => __( 'Stats Bar Background Color', 'livemesh-el-addons' ),
114
+ 'type' => Controls_Manager::COLOR,
115
+ 'selectors' => [
116
+ '{{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-bar-bg' => 'background-color: {{VALUE}};',
117
+ ],
118
+ ] );
119
+ $this->add_control( 'stats_bar_spacing', [
120
+ 'label' => __( 'Stats Bar Spacing', 'livemesh-el-addons' ),
121
+ 'type' => Controls_Manager::SLIDER,
122
+ 'size_units' => [ 'px' ],
123
+ 'default' => [
124
+ 'size' => 18,
125
+ ],
126
+ 'range' => [
127
+ 'px' => [
128
+ 'min' => 5,
129
+ 'max' => 128,
130
+ ],
131
+ ],
132
+ 'selectors' => [
133
+ '{{WRAPPER}} .lae-stats-bars .lae-stats-bar' => 'margin-bottom: {{SIZE}}{{UNIT}};',
134
+ ],
135
+ ] );
136
+ $this->add_control( 'stats_bar_height', [
137
+ 'label' => __( 'Stats Bar Height', 'livemesh-el-addons' ),
138
+ 'type' => Controls_Manager::SLIDER,
139
+ 'size_units' => [ 'px' ],
140
+ 'default' => [
141
+ 'size' => 10,
142
+ ],
143
+ 'range' => [
144
+ 'px' => [
145
+ 'min' => 1,
146
+ 'max' => 96,
147
+ ],
148
+ ],
149
+ 'selectors' => [
150
+ '{{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-bar-bg, {{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-bar-content' => 'height: {{SIZE}}{{UNIT}};',
151
+ '{{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-bar-bg' => 'margin-top: -{{SIZE}}{{UNIT}};',
152
+ ],
153
+ ] );
154
+ $this->add_control( 'stats_bar_border_radius', [
155
+ 'label' => __( 'Stats Bar Border Radius', 'livemesh-el-addons' ),
156
+ 'type' => Controls_Manager::DIMENSIONS,
157
+ 'size_units' => [ 'px', '%' ],
158
+ 'selectors' => [
159
+ '{{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-bar-bg, {{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-bar-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
160
+ ],
161
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  $this->end_controls_section();
163
+ $this->start_controls_section( 'section_stats_title', [
164
+ 'label' => __( 'Stats Title', 'livemesh-el-addons' ),
165
+ 'tab' => Controls_Manager::TAB_STYLE,
166
+ ] );
167
+ $this->add_control( 'stats_title_color', [
168
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
169
+ 'type' => Controls_Manager::COLOR,
170
+ 'selectors' => [
171
+ '{{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-title' => 'color: {{VALUE}};',
172
+ ],
173
+ ] );
174
+ $this->add_group_control( Group_Control_Typography::get_type(), [
175
+ 'name' => 'stats_title_typography',
176
+ 'selector' => '{{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-title',
177
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  $this->end_controls_section();
179
+ $this->start_controls_section( 'section_stats_percentage', [
180
+ 'label' => __( 'Stats Percentage', 'livemesh-el-addons' ),
181
+ 'tab' => Controls_Manager::TAB_STYLE,
182
+ ] );
183
+ $this->add_control( 'stats_percentage_color', [
184
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
185
+ 'type' => Controls_Manager::COLOR,
186
+ 'selectors' => [
187
+ '{{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-title span' => 'color: {{VALUE}};',
188
+ ],
189
+ ] );
190
+ $this->add_group_control( Group_Control_Typography::get_type(), [
191
+ 'name' => 'stats_percentage_typography',
192
+ 'selector' => '{{WRAPPER}} .lae-stats-bars .lae-stats-bar .lae-stats-title span',
193
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  $this->end_controls_section();
195
  }
196
+
197
+ protected function render()
198
+ {
199
  $settings = $this->get_settings_for_display();
200
+ $settings = apply_filters( 'lae_stats_bars_' . $this->get_id() . '_settings', $settings );
 
 
201
  $args['settings'] = $settings;
 
202
  $args['widget_instance'] = $this;
203
+ lae_get_template_part( 'addons/stats-bars/loop', $args );
 
 
204
  }
205
+
206
+ protected function content_template()
207
+ {
208
  }
209
 
210
  }
includes/widgets/tab-slider.php CHANGED
@@ -6,52 +6,53 @@ Description: Display tabbed content as a touch enabled responsive slider.
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
9
-
10
  namespace LivemeshAddons\Widgets;
11
 
12
- use Elementor\Repeater;
13
- use Elementor\Widget_Base;
14
- use Elementor\Controls_Manager;
15
- use Elementor\Scheme_Color;
16
- use Elementor\Group_Control_Typography;
17
- use Elementor\Scheme_Typography;
18
- use Elementor\Utils;
19
-
20
- if (!defined('ABSPATH'))
21
- exit; // Exit if accessed directly
22
-
23
-
24
- class LAE_Tab_Slider_Widget extends LAE_Widget_Base {
25
-
26
- public function get_name() {
27
  return 'lae-tab-slider';
28
  }
29
-
30
- public function get_title() {
31
- return __('Tab Slider', 'livemesh-el-addons');
 
32
  }
33
-
34
- public function get_icon() {
 
35
  return 'lae-icon-tab-slider1';
36
  }
37
-
38
- public function get_categories() {
39
- return array('livemesh-addons');
 
40
  }
41
-
42
- public function get_custom_help_url() {
 
43
  return 'https://livemeshelementor.com/docs/livemesh-addons/';
44
  }
45
-
46
- public function get_script_depends() {
47
- return [
48
- 'lae-jquery-slick',
49
- 'lae-frontend-scripts',
50
- 'lae-tab-slider-scripts'
51
- ];
52
  }
53
-
54
- public function get_style_depends() {
 
55
  return [
56
  'lae-icomoon-styles',
57
  'lae-slick-carousel-styles',
@@ -60,444 +61,300 @@ class LAE_Tab_Slider_Widget extends LAE_Widget_Base {
60
  'lae-tabs-slider-styles'
61
  ];
62
  }
63
-
64
- protected function _register_controls() {
65
-
66
- $this->start_controls_section(
67
- 'section_tabs',
68
- [
69
- 'label' => __('Tabs', 'livemesh-el-addons'),
70
- ]
71
- );
72
-
73
- $this->add_control(
74
-
75
- 'style',
76
- [
77
- 'type' => Controls_Manager::SELECT,
78
- 'label' => __('Choose Style', 'livemesh-el-addons'),
79
- 'default' => 'style1',
80
- 'options' => [
81
- 'style1' => __('Tab Style 1', 'livemesh-el-addons'),
82
- 'style2' => __('Tab Style 2', 'livemesh-el-addons'),
83
- 'style3' => __('Tab Style 3', 'livemesh-el-addons'),
84
- ],
85
- ]
86
- );
87
-
88
  $repeater = new Repeater();
89
-
90
- $repeater->add_control(
91
- 'icon_type',
92
- [
93
-
94
- 'label' => __('Tab Icon Type', 'livemesh-el-addons'),
95
- 'type' => Controls_Manager::SELECT,
96
- 'default' => 'none',
97
- 'options' => [
98
- 'none' => __('None', 'livemesh-el-addons'),
99
- 'icon' => __('Icon', 'livemesh-el-addons'),
100
- 'icon_image' => __('Icon Image', 'livemesh-el-addons'),
101
- ],
102
- ]
103
- );
104
-
105
- $repeater->add_control(
106
- 'icon_image',
107
- [
108
-
109
- 'label' => __('Tab Image', 'livemesh-el-addons'),
110
- 'type' => Controls_Manager::MEDIA,
111
- 'default' => [
112
- 'url' => Utils::get_placeholder_image_src(),
113
- ],
114
- 'label_block' => true,
115
- 'condition' => [
116
- 'icon_type' => 'icon_image',
117
- ],
118
- ]
119
- );
120
-
121
- $repeater->add_control(
122
- 'selected_icon',
123
- [
124
-
125
- 'label' => __('Tab Icon', 'livemesh-el-addons'),
126
- 'type' => Controls_Manager::ICONS,
127
- 'label_block' => true,
128
- 'default' => [
129
- 'value' => 'fas fa-home',
130
- 'library' => 'fa-solid',
131
- ],
132
- 'condition' => [
133
- 'icon_type' => 'icon',
134
- ],
135
- 'fa4compatibility' => 'icon',
136
- ]
137
- );
138
-
139
- $repeater->add_control(
140
- 'tab_title',
141
- [
142
-
143
- 'label' => __('Tab Title & Content', 'livemesh-el-addons'),
144
- 'type' => Controls_Manager::TEXT,
145
- 'default' => __('Tab Title', 'livemesh-el-addons'),
146
- 'label_block' => true,
147
- 'dynamic' => [
148
- 'active' => true,
149
- ],
150
- ]
151
- );
152
-
153
- $repeater->add_control(
154
- 'tab_content',
155
- [
156
-
157
- 'label' => __('Tab Content', 'livemesh-el-addons'),
158
- 'type' => Controls_Manager::WYSIWYG,
159
- 'default' => __('Tab Content', 'livemesh-el-addons'),
160
- 'show_label' => false,
161
- 'dynamic' => [
162
- 'active' => true,
163
- ],
164
- ]
165
- );
166
-
167
- $this->add_control(
168
- 'tabs',
169
- [
170
- 'label' => __('Tab Panes', 'livemesh-el-addons'),
171
- 'type' => Controls_Manager::REPEATER,
172
- 'separator' => 'before',
173
- 'default' => [
174
- [
175
- 'tab_title' => __('Tab #1', 'livemesh-el-addons'),
176
- 'tab_content' => __('I am tabbed content 1. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons'),
177
- ],
178
- [
179
- 'tab_title' => __('Tab #2', 'livemesh-el-addons'),
180
- 'tab_content' => __('I am tabbed content 2. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons'),
181
- ],
182
- [
183
- 'tab_title' => __('Tab #3', 'livemesh-el-addons'),
184
- 'tab_content' => __('I am tabbed content 3. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons'),
185
- ],
186
- ],
187
- 'fields' => $repeater->get_controls(),
188
- 'title_field' => '{{{ tab_title }}}',
189
- ]
190
- );
191
-
192
  $this->end_controls_section();
193
-
194
- $this->start_controls_section(
195
- 'section_slider_settings',
196
- [
197
- 'label' => __('Slider Settings', 'livemesh-el-addons'),
198
- 'tab' => Controls_Manager::TAB_SETTINGS,
199
- ]
200
- );
201
-
202
- $this->add_control(
203
- 'autoplay',
204
- [
205
- 'type' => Controls_Manager::SWITCHER,
206
- 'label_off' => __('No', 'livemesh-el-addons'),
207
- 'label_on' => __('Yes', 'livemesh-el-addons'),
208
- 'return_value' => 'yes',
209
- 'default' => 'no',
210
- 'label' => __('Autoplay?', 'livemesh-el-addons'),
211
- 'description' => __('Should the tabs autoplay as in a slideshow.', 'livemesh-el-addons'),
212
- ]
213
- );
214
-
215
- $this->add_control(
216
- 'pause_on_hover',
217
- [
218
- 'type' => Controls_Manager::SWITCHER,
219
- 'label_off' => __('No', 'livemesh-el-addons'),
220
- 'label_on' => __('Yes', 'livemesh-el-addons'),
221
- 'return_value' => 'yes',
222
- 'default' => 'yes',
223
- 'label' => __('Pause on Hover?', 'livemesh-el-addons'),
224
- 'condition' => [
225
- 'autoplay' => 'yes'
226
- ]
227
- ]
228
- );
229
-
230
- $this->add_control(
231
- 'pause_on_focus',
232
- [
233
- 'type' => Controls_Manager::SWITCHER,
234
- 'label_off' => __('No', 'livemesh-el-addons'),
235
- 'label_on' => __('Yes', 'livemesh-el-addons'),
236
- 'return_value' => 'yes',
237
- 'default' => 'yes',
238
- 'label' => __('Pause on Focus?', 'livemesh-el-addons'),
239
- 'condition' => [
240
- 'autoplay' => 'yes'
241
- ]
242
- ]
243
- );
244
-
245
- $this->add_control(
246
- 'autoplay_speed',
247
- [
248
- 'label' => __('Autoplay speed in ms', 'livemesh-el-addons'),
249
- 'type' => Controls_Manager::NUMBER,
250
- 'default' => 3000,
251
- 'condition' => [
252
- 'autoplay' => 'yes'
253
- ]
254
- ]
255
- );
256
-
257
- $this->add_control(
258
- 'animation_speed',
259
- [
260
- 'label' => __('Autoplay animation speed in ms', 'livemesh-el-addons'),
261
- 'type' => Controls_Manager::NUMBER,
262
- 'default' => 300,
263
- ]
264
- );
265
-
266
- $this->add_control(
267
- 'infinite_looping',
268
- [
269
- 'type' => Controls_Manager::SWITCHER,
270
- 'label_off' => __('No', 'livemesh-el-addons'),
271
- 'label_on' => __('Yes', 'livemesh-el-addons'),
272
- 'return_value' => 'yes',
273
- 'default' => 'yes',
274
- 'label' => __('Infinite Looping?', 'livemesh-el-addons'),
275
- ]
276
- );
277
-
278
- $this->add_control(
279
- 'adaptive_height',
280
- [
281
- 'type' => Controls_Manager::SWITCHER,
282
- 'label_off' => __('No', 'livemesh-el-addons'),
283
- 'label_on' => __('Yes', 'livemesh-el-addons'),
284
- 'return_value' => 'yes',
285
- 'default' => 'no',
286
- 'label' => __('Adaptive Height?', 'livemesh-el-addons'),
287
- 'description' => __('Enables adaptive height when tabs are of different heights.', 'livemesh-el-addons'),
288
- ]
289
- );
290
-
291
  $this->end_controls_section();
292
-
293
- $this->start_controls_section(
294
- 'section_tab_title',
295
- [
296
- 'label' => __('Tab Title', 'livemesh-el-addons'),
297
- 'tab' => Controls_Manager::TAB_STYLE,
298
- ]
299
- );
300
- $this->add_control(
301
- 'title_color',
302
- [
303
- 'label' => __('Color', 'livemesh-el-addons'),
304
- 'type' => Controls_Manager::COLOR,
305
- 'selectors' => [
306
- '{{WRAPPER}} .lae-tab-slider .slick-dots li .lae-tab-slide-nav .lae-tab-title' => 'color: {{VALUE}};',
307
- ],
308
- ]
309
- );
310
-
311
- $this->add_control(
312
- 'active_title_color',
313
- [
314
- 'label' => __('Active Tab Title Color', 'livemesh-el-addons'),
315
- 'type' => Controls_Manager::COLOR,
316
- 'selectors' => [
317
- '{{WRAPPER}} .lae-tab-slider .slick-dots li.slick-active .lae-tab-slide-nav .lae-tab-title' => 'color: {{VALUE}};',
318
- ],
319
- ]
320
- );
321
-
322
- $this->add_control(
323
- 'hover_title_color',
324
- [
325
- 'label' => __('Tab Title Hover Color', 'livemesh-el-addons'),
326
- 'type' => Controls_Manager::COLOR,
327
- 'selectors' => [
328
- '{{WRAPPER}} .lae-tab-slider .slick-dots li .lae-tab-slide-nav:hover .lae-tab-title' => 'color: {{VALUE}};',
329
- ],
330
- ]
331
- );
332
-
333
- $this->add_control(
334
- 'highlight_color',
335
- [
336
- 'label' => __('Tab highlight Border color', 'livemesh-el-addons'),
337
- 'type' => Controls_Manager::COLOR,
338
- 'default' => '#f94213',
339
- 'selectors' => [
340
- '{{WRAPPER}} .lae-tab-slider.lae-style1 .slick-dots li.slick-active .lae-tab-slide-nav:before' => 'background: {{VALUE}};',
341
- '{{WRAPPER}} .lae-tab-slider.lae-style3 .slick-dots li.slick-active .lae-tab-slide-nav' => 'border-color: {{VALUE}};',
342
- ],
343
- 'condition' => [
344
- 'style' => ['style1', 'style3'],
345
- ],
346
- ]
347
- );
348
-
349
- $this->add_control(
350
- 'title_spacing',
351
- [
352
- 'label' => __('Tab Title Padding', 'livemesh-el-addons'),
353
- 'type' => Controls_Manager::DIMENSIONS,
354
- 'size_units' => ['px', '%', 'em'],
355
- 'selectors' => [
356
- '{{WRAPPER}} .lae-tab-slider .slick-dots li .lae-tab-slide-nav' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
357
- ],
358
- 'isLinked' => false
359
- ]
360
- );
361
-
362
-
363
- $this->add_group_control(
364
- Group_Control_Typography::get_type(),
365
- [
366
- 'name' => 'title_typography',
367
- 'selector' => '{{WRAPPER}} .lae-tab-slider .slick-dots li .lae-tab-slide-nav .lae-tab-title',
368
- ]
369
- );
370
-
371
  $this->end_controls_section();
372
-
373
- $this->start_controls_section(
374
- 'section_tab_content',
375
- [
376
- 'label' => __('Tab Content', 'livemesh-el-addons'),
377
- 'tab' => Controls_Manager::TAB_STYLE,
378
- ]
379
- );
380
-
381
- $this->add_control(
382
- 'content_spacing',
383
- [
384
- 'label' => __('Tab Content Padding', 'livemesh-el-addons'),
385
- 'type' => Controls_Manager::DIMENSIONS,
386
- 'size_units' => ['px', '%', 'em'],
387
- 'selectors' => [
388
- '{{WRAPPER}} .lae-tab-slider .slick-list .lae-tab-slide .lae-tab-slide-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
389
- ],
390
- 'isLinked' => false
391
- ]
392
- );
393
- $this->add_control(
394
- 'content_color',
395
- [
396
- 'label' => __('Color', 'livemesh-el-addons'),
397
- 'type' => Controls_Manager::COLOR,
398
- 'selectors' => [
399
- '{{WRAPPER}} .lae-tab-slider .slick-list .lae-tab-slide .lae-tab-slide-content' => 'color: {{VALUE}};',
400
- ],
401
- ]
402
- );
403
-
404
- $this->add_group_control(
405
- Group_Control_Typography::get_type(),
406
- [
407
- 'name' => 'content_typography',
408
- 'selector' => '{{WRAPPER}} .lae-tab-slider .slick-list .lae-tab-slide .lae-tab-slide-content',
409
- ]
410
- );
411
-
412
-
413
  $this->end_controls_section();
414
-
415
-
416
- $this->start_controls_section(
417
- 'section_icon_styling',
418
- [
419
- 'label' => __('Icons', 'livemesh-el-addons'),
420
- 'tab' => Controls_Manager::TAB_STYLE,
421
- 'condition' => [
422
- 'style' => ['style2', 'style3'],
423
- ],
424
- ]
425
- );
426
-
427
-
428
- $this->add_control(
429
- 'icon_size',
430
- [
431
- 'label' => __('Icon or Icon Image size in pixels', 'livemesh-el-addons'),
432
- 'type' => Controls_Manager::SLIDER,
433
- 'size_units' => ['px', '%', 'em'],
434
- 'range' => [
435
- 'px' => [
436
- 'min' => 10,
437
- 'max' => 256,
438
- ],
439
- ],
440
- 'devices' => ['desktop', 'tablet', 'mobile'],
441
- 'selectors' => [
442
- '{{WRAPPER}} .lae-tab-slider .slick-dots li .lae-tab-slide-nav span.lae-image-wrapper img' => 'width: {{SIZE}}{{UNIT}};',
443
- '{{WRAPPER}} .lae-tab-slider .slick-dots li .lae-tab-slide-nav span.lae-icon-wrapper i' => 'font-size: {{SIZE}}{{UNIT}};',
444
- ],
445
- ]
446
- );
447
-
448
- $this->add_control(
449
- 'icon_color',
450
- [
451
- 'label' => __('Icon Color', 'livemesh-el-addons'),
452
- 'type' => Controls_Manager::COLOR,
453
- 'default' => '',
454
- 'selectors' => [
455
- '{{WRAPPER}} .lae-tab-slider .slick-dots li .lae-tab-slide-nav span.lae-icon-wrapper i' => 'color: {{VALUE}};',
456
- ],
457
- ]
458
- );
459
-
460
- $this->add_control(
461
- 'active_icon_color',
462
- [
463
- 'label' => __('Active Tab Icon Color', 'livemesh-el-addons'),
464
- 'type' => Controls_Manager::COLOR,
465
- 'default' => '',
466
- 'selectors' => [
467
- '{{WRAPPER}} .lae-tab-slider .slick-dots li.slick-active .lae-tab-slide-nav span.lae-icon-wrapper i' => 'color: {{VALUE}};',
468
- ],
469
- ]
470
- );
471
-
472
- $this->add_control(
473
- 'hover_icon_color',
474
- [
475
- 'label' => __('Hover Tab Icon Color', 'livemesh-el-addons'),
476
- 'type' => Controls_Manager::COLOR,
477
- 'default' => '',
478
- 'selectors' => [
479
- '{{WRAPPER}} .lae-tab-slider .slick-dots li .lae-tab-slide-nav:hover span.lae-icon-wrapper i' => 'color: {{VALUE}};',
480
- ],
481
- ]
482
- );
483
  }
484
-
485
- protected function render() {
486
-
487
  $settings = $this->get_settings_for_display();
488
-
489
- $settings = apply_filters('lae_tab_slider_' . $this->get_id() . '_settings', $settings);
490
-
491
  $args['settings'] = $settings;
492
-
493
  $args['widget_instance'] = $this;
494
-
495
- lae_get_template_part('addons/tab-slider/loop', $args);
496
-
497
  }
498
-
499
- protected function content_template() {
500
-
501
  }
502
 
503
  }
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
 
9
  namespace LivemeshAddons\Widgets;
10
 
11
+ use Elementor\Repeater ;
12
+ use Elementor\Widget_Base ;
13
+ use Elementor\Controls_Manager ;
14
+ use Elementor\Scheme_Color ;
15
+ use Elementor\Group_Control_Typography ;
16
+ use Elementor\Scheme_Typography ;
17
+ use Elementor\Utils ;
18
+ if ( !defined( 'ABSPATH' ) ) {
19
+ exit;
20
+ }
21
+ // Exit if accessed directly
22
+ class LAE_Tab_Slider_Widget extends LAE_Widget_Base
23
+ {
24
+ public function get_name()
25
+ {
26
  return 'lae-tab-slider';
27
  }
28
+
29
+ public function get_title()
30
+ {
31
+ return __( 'Tab Slider', 'livemesh-el-addons' );
32
  }
33
+
34
+ public function get_icon()
35
+ {
36
  return 'lae-icon-tab-slider1';
37
  }
38
+
39
+ public function get_categories()
40
+ {
41
+ return array( 'livemesh-addons' );
42
  }
43
+
44
+ public function get_custom_help_url()
45
+ {
46
  return 'https://livemeshelementor.com/docs/livemesh-addons/';
47
  }
48
+
49
+ public function get_script_depends()
50
+ {
51
+ return [ 'lae-jquery-slick', 'lae-frontend-scripts', 'lae-tab-slider-scripts' ];
 
 
 
52
  }
53
+
54
+ public function get_style_depends()
55
+ {
56
  return [
57
  'lae-icomoon-styles',
58
  'lae-slick-carousel-styles',
61
  'lae-tabs-slider-styles'
62
  ];
63
  }
64
+
65
+ protected function _register_controls()
66
+ {
67
+ $this->start_controls_section( 'section_tabs', [
68
+ 'label' => __( 'Tabs', 'livemesh-el-addons' ),
69
+ ] );
70
+ $this->add_control( 'style', [
71
+ 'type' => Controls_Manager::SELECT,
72
+ 'label' => __( 'Choose Style', 'livemesh-el-addons' ),
73
+ 'default' => 'style1',
74
+ 'options' => [
75
+ 'style1' => __( 'Tab Style 1', 'livemesh-el-addons' ),
76
+ 'style2' => __( 'Tab Style 2', 'livemesh-el-addons' ),
77
+ 'style3' => __( 'Tab Style 3', 'livemesh-el-addons' ),
78
+ ],
79
+ ] );
 
 
 
 
 
 
 
 
 
80
  $repeater = new Repeater();
81
+ $repeater->add_control( 'icon_type', [
82
+ 'label' => __( 'Tab Icon Type', 'livemesh-el-addons' ),
83
+ 'type' => Controls_Manager::SELECT,
84
+ 'default' => 'none',
85
+ 'options' => [
86
+ 'none' => __( 'None', 'livemesh-el-addons' ),
87
+ 'icon' => __( 'Icon', 'livemesh-el-addons' ),
88
+ 'icon_image' => __( 'Icon Image', 'livemesh-el-addons' ),
89
+ ],
90
+ ] );
91
+ $repeater->add_control( 'icon_image', [
92
+ 'label' => __( 'Tab Image', 'livemesh-el-addons' ),
93
+ 'type' => Controls_Manager::MEDIA,
94
+ 'default' => [
95
+ 'url' => Utils::get_placeholder_image_src(),
96
+ ],
97
+ 'label_block' => true,
98
+ 'condition' => [
99
+ 'icon_type' => 'icon_image',
100
+ ],
101
+ ] );
102
+ $repeater->add_control( 'selected_icon', [
103
+ 'label' => __( 'Tab Icon', 'livemesh-el-addons' ),
104
+ 'type' => Controls_Manager::ICONS,
105
+ 'label_block' => true,
106
+ 'default' => [
107
+ 'value' => 'fas fa-home',
108
+ 'library' => 'fa-solid',
109
+ ],
110
+ 'condition' => [
111
+ 'icon_type' => 'icon',
112
+ ],
113
+ 'fa4compatibility' => 'icon',
114
+ ] );
115
+ $repeater->add_control( 'tab_title', [
116
+ 'label' => __( 'Tab Title & Content', 'livemesh-el-addons' ),
117
+ 'type' => Controls_Manager::TEXT,
118
+ 'default' => __( 'Tab Title', 'livemesh-el-addons' ),
119
+ 'label_block' => true,
120
+ 'dynamic' => [
121
+ 'active' => true,
122
+ ],
123
+ ] );
124
+ $repeater->add_control( 'tab_content', [
125
+ 'label' => __( 'Tab Content', 'livemesh-el-addons' ),
126
+ 'type' => Controls_Manager::WYSIWYG,
127
+ 'default' => __( 'Tab Content', 'livemesh-el-addons' ),
128
+ 'show_label' => false,
129
+ 'dynamic' => [
130
+ 'active' => true,
131
+ ],
132
+ ] );
133
+ $this->add_control( 'tabs', [
134
+ 'label' => __( 'Tab Panes', 'livemesh-el-addons' ),
135
+ 'type' => Controls_Manager::REPEATER,
136
+ 'separator' => 'before',
137
+ 'default' => [ [
138
+ 'tab_title' => __( 'Tab #1', 'livemesh-el-addons' ),
139
+ 'tab_content' => __( 'I am tabbed content 1. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons' ),
140
+ ], [
141
+ 'tab_title' => __( 'Tab #2', 'livemesh-el-addons' ),
142
+ 'tab_content' => __( 'I am tabbed content 2. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons' ),
143
+ ], [
144
+ 'tab_title' => __( 'Tab #3', 'livemesh-el-addons' ),
145
+ 'tab_content' => __( 'I am tabbed content 3. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons' ),
146
+ ] ],
147
+ 'fields' => $repeater->get_controls(),
148
+ 'title_field' => '{{{ tab_title }}}',
149
+ ] );
150
+ $this->add_control( 'upgrade_notice', [
151
+ 'type' => Controls_Manager::RAW_HTML,
152
+ 'separator' => 'before',
153
+ 'raw' => '<div style="text-align:center;line-height:1.6;"><p>' . __( 'Unlock new possibilities with premium widgets and styles of <strong>Livemesh Addons for Elementor <i>Premium</i></strong>. ', 'livemesh-el-addons' ) . '</p><p style="padding-top:15px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://livemeshelementor.com/pricing/#pricing-plans" target="_blank"><i class="fa fa-hand-o-right" aria-hidden="true"></i>' . __( 'Go Pro', 'livemesh-el-addons' ) . '</a></p></div>',
154
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  $this->end_controls_section();
156
+ $this->start_controls_section( 'section_slider_settings', [
157
+ 'label' => __( 'Slider Settings', 'livemesh-el-addons' ),
158
+ 'tab' => Controls_Manager::TAB_SETTINGS,
159
+ ] );
160
+ $this->add_control( 'autoplay', [
161
+ 'type' => Controls_Manager::SWITCHER,
162
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
163
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
164
+ 'return_value' => 'yes',
165
+ 'default' => 'no',
166
+ 'label' => __( 'Autoplay?', 'livemesh-el-addons' ),
167
+ 'description' => __( 'Should the tabs autoplay as in a slideshow.', 'livemesh-el-addons' ),
168
+ ] );
169
+ $this->add_control( 'pause_on_hover', [
170
+ 'type' => Controls_Manager::SWITCHER,
171
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
172
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
173
+ 'return_value' => 'yes',
174
+ 'default' => 'yes',
175
+ 'label' => __( 'Pause on Hover?', 'livemesh-el-addons' ),
176
+ 'condition' => [
177
+ 'autoplay' => 'yes',
178
+ ],
179
+ ] );
180
+ $this->add_control( 'pause_on_focus', [
181
+ 'type' => Controls_Manager::SWITCHER,
182
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
183
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
184
+ 'return_value' => 'yes',
185
+ 'default' => 'yes',
186
+ 'label' => __( 'Pause on Focus?', 'livemesh-el-addons' ),
187
+ 'condition' => [
188
+ 'autoplay' => 'yes',
189
+ ],
190
+ ] );
191
+ $this->add_control( 'autoplay_speed', [
192
+ 'label' => __( 'Autoplay speed in ms', 'livemesh-el-addons' ),
193
+ 'type' => Controls_Manager::NUMBER,
194
+ 'default' => 3000,
195
+ 'condition' => [
196
+ 'autoplay' => 'yes',
197
+ ],
198
+ ] );
199
+ $this->add_control( 'animation_speed', [
200
+ 'label' => __( 'Autoplay animation speed in ms', 'livemesh-el-addons' ),
201
+ 'type' => Controls_Manager::NUMBER,
202
+ 'default' => 300,
203
+ ] );
204
+ $this->add_control( 'infinite_looping', [
205
+ 'type' => Controls_Manager::SWITCHER,
206
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
207
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
208
+ 'return_value' => 'yes',
209
+ 'default' => 'yes',
210
+ 'label' => __( 'Infinite Looping?', 'livemesh-el-addons' ),
211
+ ] );
212
+ $this->add_control( 'adaptive_height', [
213
+ 'type' => Controls_Manager::SWITCHER,
214
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
215
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
216
+ 'return_value' => 'yes',
217
+ 'default' => 'no',
218
+ 'label' => __( 'Adaptive Height?', 'livemesh-el-addons' ),
219
+ 'description' => __( 'Enables adaptive height when tabs are of different heights.', 'livemesh-el-addons' ),
220
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  $this->end_controls_section();
222
+ $this->start_controls_section( 'section_tab_title', [
223
+ 'label' => __( 'Tab Title', 'livemesh-el-addons' ),
224
+ 'tab' => Controls_Manager::TAB_STYLE,
225
+ ] );
226
+ $this->add_control( 'title_color', [
227
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
228
+ 'type' => Controls_Manager::COLOR,
229
+ 'selectors' => [
230
+ '{{WRAPPER}} .lae-tab-slider .slick-dots li .lae-tab-slide-nav .lae-tab-title' => 'color: {{VALUE}};',
231
+ ],
232
+ ] );
233
+ $this->add_control( 'active_title_color', [
234
+ 'label' => __( 'Active Tab Title Color', 'livemesh-el-addons' ),
235
+ 'type' => Controls_Manager::COLOR,
236
+ 'selectors' => [
237
+ '{{WRAPPER}} .lae-tab-slider .slick-dots li.slick-active .lae-tab-slide-nav .lae-tab-title' => 'color: {{VALUE}};',
238
+ ],
239
+ ] );
240
+ $this->add_control( 'hover_title_color', [
241
+ 'label' => __( 'Tab Title Hover Color', 'livemesh-el-addons' ),
242
+ 'type' => Controls_Manager::COLOR,
243
+ 'selectors' => [
244
+ '{{WRAPPER}} .lae-tab-slider .slick-dots li .lae-tab-slide-nav:hover .lae-tab-title' => 'color: {{VALUE}};',
245
+ ],
246
+ ] );
247
+ $this->add_control( 'highlight_color', [
248
+ 'label' => __( 'Tab highlight Border color', 'livemesh-el-addons' ),
249
+ 'type' => Controls_Manager::COLOR,
250
+ 'default' => '#f94213',
251
+ 'selectors' => [
252
+ '{{WRAPPER}} .lae-tab-slider.lae-style1 .slick-dots li.slick-active .lae-tab-slide-nav:before' => 'background: {{VALUE}};',
253
+ '{{WRAPPER}} .lae-tab-slider.lae-style3 .slick-dots li.slick-active .lae-tab-slide-nav' => 'border-color: {{VALUE}};',
254
+ ],
255
+ 'condition' => [
256
+ 'style' => [ 'style1', 'style3' ],
257
+ ],
258
+ ] );
259
+ $this->add_control( 'title_spacing', [
260
+ 'label' => __( 'Tab Title Padding', 'livemesh-el-addons' ),
261
+ 'type' => Controls_Manager::DIMENSIONS,
262
+ 'size_units' => [ 'px', '%', 'em' ],
263
+ 'selectors' => [
264
+ '{{WRAPPER}} .lae-tab-slider .slick-dots li .lae-tab-slide-nav' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
265
+ ],
266
+ 'isLinked' => false,
267
+ ] );
268
+ $this->add_group_control( Group_Control_Typography::get_type(), [
269
+ 'name' => 'title_typography',
270
+ 'selector' => '{{WRAPPER}} .lae-tab-slider .slick-dots li .lae-tab-slide-nav .lae-tab-title',
271
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  $this->end_controls_section();
273
+ $this->start_controls_section( 'section_tab_content', [
274
+ 'label' => __( 'Tab Content', 'livemesh-el-addons' ),
275
+ 'tab' => Controls_Manager::TAB_STYLE,
276
+ ] );
277
+ $this->add_control( 'content_spacing', [
278
+ 'label' => __( 'Tab Content Padding', 'livemesh-el-addons' ),
279
+ 'type' => Controls_Manager::DIMENSIONS,
280
+ 'size_units' => [ 'px', '%', 'em' ],
281
+ 'selectors' => [
282
+ '{{WRAPPER}} .lae-tab-slider .slick-list .lae-tab-slide .lae-tab-slide-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
283
+ ],
284
+ 'isLinked' => false,
285
+ ] );
286
+ $this->add_control( 'content_color', [
287
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
288
+ 'type' => Controls_Manager::COLOR,
289
+ 'selectors' => [
290
+ '{{WRAPPER}} .lae-tab-slider .slick-list .lae-tab-slide .lae-tab-slide-content' => 'color: {{VALUE}};',
291
+ ],
292
+ ] );
293
+ $this->add_group_control( Group_Control_Typography::get_type(), [
294
+ 'name' => 'content_typography',
295
+ 'selector' => '{{WRAPPER}} .lae-tab-slider .slick-list .lae-tab-slide .lae-tab-slide-content',
296
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  $this->end_controls_section();
298
+ $this->start_controls_section( 'section_icon_styling', [
299
+ 'label' => __( 'Icons', 'livemesh-el-addons' ),
300
+ 'tab' => Controls_Manager::TAB_STYLE,
301
+ 'condition' => [
302
+ 'style' => [ 'style2', 'style3' ],
303
+ ],
304
+ ] );
305
+ $this->add_control( 'icon_size', [
306
+ 'label' => __( 'Icon or Icon Image size in pixels', 'livemesh-el-addons' ),
307
+ 'type' => Controls_Manager::SLIDER,
308
+ 'size_units' => [ 'px', '%', 'em' ],
309
+ 'range' => [
310
+ 'px' => [
311
+ 'min' => 10,
312
+ 'max' => 256,
313
+ ],
314
+ ],
315
+ 'devices' => [ 'desktop', 'tablet', 'mobile' ],
316
+ 'selectors' => [
317
+ '{{WRAPPER}} .lae-tab-slider .slick-dots li .lae-tab-slide-nav span.lae-image-wrapper img' => 'width: {{SIZE}}{{UNIT}};',
318
+ '{{WRAPPER}} .lae-tab-slider .slick-dots li .lae-tab-slide-nav span.lae-icon-wrapper i' => 'font-size: {{SIZE}}{{UNIT}};',
319
+ ],
320
+ ] );
321
+ $this->add_control( 'icon_color', [
322
+ 'label' => __( 'Icon Color', 'livemesh-el-addons' ),
323
+ 'type' => Controls_Manager::COLOR,
324
+ 'default' => '',
325
+ 'selectors' => [
326
+ '{{WRAPPER}} .lae-tab-slider .slick-dots li .lae-tab-slide-nav span.lae-icon-wrapper i' => 'color: {{VALUE}};',
327
+ ],
328
+ ] );
329
+ $this->add_control( 'active_icon_color', [
330
+ 'label' => __( 'Active Tab Icon Color', 'livemesh-el-addons' ),
331
+ 'type' => Controls_Manager::COLOR,
332
+ 'default' => '',
333
+ 'selectors' => [
334
+ '{{WRAPPER}} .lae-tab-slider .slick-dots li.slick-active .lae-tab-slide-nav span.lae-icon-wrapper i' => 'color: {{VALUE}};',
335
+ ],
336
+ ] );
337
+ $this->add_control( 'hover_icon_color', [
338
+ 'label' => __( 'Hover Tab Icon Color', 'livemesh-el-addons' ),
339
+ 'type' => Controls_Manager::COLOR,
340
+ 'default' => '',
341
+ 'selectors' => [
342
+ '{{WRAPPER}} .lae-tab-slider .slick-dots li .lae-tab-slide-nav:hover span.lae-icon-wrapper i' => 'color: {{VALUE}};',
343
+ ],
344
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
345
  }
346
+
347
+ protected function render()
348
+ {
349
  $settings = $this->get_settings_for_display();
350
+ $settings = apply_filters( 'lae_tab_slider_' . $this->get_id() . '_settings', $settings );
 
 
351
  $args['settings'] = $settings;
 
352
  $args['widget_instance'] = $this;
353
+ lae_get_template_part( 'addons/tab-slider/loop', $args );
 
 
354
  }
355
+
356
+ protected function content_template()
357
+ {
358
  }
359
 
360
  }
includes/widgets/team-members.php CHANGED
@@ -6,54 +6,55 @@ Description: Display a list of your team members optionally in a multi-column gr
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
9
-
10
  namespace LivemeshAddons\Widgets;
11
 
12
- use Elementor\Repeater;
13
- use Elementor\Widget_Base;
14
- use Elementor\Controls_Manager;
15
- use Elementor\Utils;
16
-
17
- use Elementor\Scheme_Color;
18
- use Elementor\Group_Control_Typography;
19
- use Elementor\Group_Control_Image_Size;
20
- use Elementor\Scheme_Typography;
21
- use Elementor\Modules\DynamicTags\Module as TagsModule;
22
-
23
- if (!defined('ABSPATH'))
24
- exit; // Exit if accessed directly
25
-
26
-
27
- class LAE_Team_Widget extends LAE_Widget_Base {
28
-
29
- public function get_name() {
30
  return 'lae-team-members';
31
  }
32
-
33
- public function get_title() {
34
- return __('Team Members', 'livemesh-el-addons');
 
35
  }
36
-
37
- public function get_icon() {
 
38
  return 'lae-icon-team4';
39
  }
40
-
41
- public function get_categories() {
42
- return array('livemesh-addons');
 
43
  }
44
-
45
- public function get_custom_help_url() {
 
46
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/team-members/';
47
  }
48
-
49
- public function get_script_depends() {
50
- return [
51
- 'lae-waypoints',
52
- 'lae-frontend-scripts'
53
- ];
54
  }
55
-
56
- public function get_style_depends() {
 
57
  return [
58
  'lae-icomoon-styles',
59
  'lae-animate-styles',
@@ -61,696 +62,461 @@ class LAE_Team_Widget extends LAE_Widget_Base {
61
  'lae-team-members-styles'
62
  ];
63
  }
64
-
65
- protected function _register_controls() {
66
-
67
- $this->start_controls_section(
68
- 'section_team',
69
- [
70
- 'label' => __('Team', 'livemesh-el-addons'),
71
- ]
72
- );
73
-
74
  $repeater = new Repeater();
75
-
76
- $repeater->add_control(
77
- 'member_name',
78
- [
79
-
80
- 'label' => __('Member Name', 'livemesh-el-addons'),
81
- 'type' => Controls_Manager::TEXT,
82
- 'default' => __('My team member name', 'livemesh-el-addons'),
83
- 'dynamic' => [
84
- 'active' => true,
85
- ],
86
- ]
87
- );
88
-
89
- $repeater->add_control(
90
- 'member_position',
91
- [
92
-
93
- 'label' => __('Position', 'livemesh-el-addons'),
94
- 'type' => Controls_Manager::TEXT,
95
- 'dynamic' => [
96
- 'active' => true,
97
- 'categories' => [
98
- TagsModule::POST_META_CATEGORY,
99
- ],
100
- ],
101
- ]
102
- );
103
-
104
- $repeater->add_control(
105
- 'member_image',
106
- [
107
-
108
- 'label' => __('Team Member Image', 'livemesh-el-addons'),
109
- 'type' => Controls_Manager::MEDIA,
110
- 'default' => [
111
- 'url' => Utils::get_placeholder_image_src(),
112
- ],
113
- 'label_block' => true,
114
- 'dynamic' => [
115
- 'active' => true,
116
- ],
117
- ]
118
- );
119
-
120
- $repeater->add_control(
121
-
122
- 'member_link',
123
- [
124
-
125
- 'label' => __('Team Member URL', 'livemesh-el-addons'),
126
- 'description' => __('The link for the page describing the team member.', 'livemesh-el-addons'),
127
- 'type' => Controls_Manager::URL,
128
- 'label_block' => true,
129
- 'default' => [
130
- 'url' => '',
131
- 'is_external' => 'true',
132
- ],
133
- 'placeholder' => __('http://member-link.com', 'livemesh-el-addons'),
134
- 'dynamic' => [
135
- 'active' => true,
136
- ],
137
- ]
138
- );
139
-
140
- $repeater->add_control(
141
- 'member_details',
142
- [
143
-
144
- 'label' => __('Team Member details', 'livemesh-el-addons'),
145
- 'type' => Controls_Manager::TEXTAREA,
146
- 'default' => __('Details about team member', 'livemesh-el-addons'),
147
- 'description' => __('Provide a short writeup for the team member', 'livemesh-el-addons'),
148
- 'label_block' => true,
149
- 'dynamic' => [
150
- 'active' => true,
151
- ],
152
- ]
153
- );
154
-
155
- $repeater->add_control(
156
- 'social_profile',
157
- [
158
-
159
- 'label' => __('Social Profile', 'livemesh-el-addons'),
160
- 'type' => Controls_Manager::HEADING,
161
- 'separator' => 'before',
162
- ]
163
- );
164
-
165
- $repeater->add_control(
166
- 'member_email',
167
- [
168
- 'type' => Controls_Manager::TEXT,
169
-
170
- 'label' => __('Email Address', 'livemesh-el-addons'),
171
- 'description' => __('Enter the email address of the team member.', 'livemesh-el-addons'),
172
- 'dynamic' => [
173
- 'active' => true,
174
- 'categories' => [
175
- TagsModule::POST_META_CATEGORY,
176
- ],
177
- ],
178
- ]
179
- );
180
-
181
- $repeater->add_control(
182
- 'facebook_url',
183
-
184
- [
185
- 'type' => Controls_Manager::TEXT,
186
-
187
- 'label' => __('Facebook Page URL', 'livemesh-el-addons'),
188
- 'description' => __('URL of the Facebook page of the team member.', 'livemesh-el-addons'),
189
- 'dynamic' => [
190
- 'active' => true,
191
- 'categories' => [
192
- TagsModule::POST_META_CATEGORY,
193
- ],
194
- ],
195
- ]
196
- );
197
-
198
- $repeater->add_control(
199
- 'twitter_url',
200
- [
201
- 'type' => Controls_Manager::TEXT,
202
-
203
- 'label' => __('Twitter Profile URL', 'livemesh-el-addons'),
204
- 'description' => __('URL of the Twitter page of the team member.', 'livemesh-el-addons'),
205
- 'dynamic' => [
206
- 'active' => true,
207
- 'categories' => [
208
- TagsModule::POST_META_CATEGORY,
209
- ],
210
- ],
211
- ]
212
- );
213
-
214
- $repeater->add_control(
215
- 'linkedin_url',
216
-
217
- [
218
- 'type' => Controls_Manager::TEXT,
219
-
220
- 'label' => __('LinkedIn Page URL', 'livemesh-el-addons'),
221
- 'description' => __('URL of the LinkedIn profile of the team member.', 'livemesh-el-addons'),
222
- 'dynamic' => [
223
- 'active' => true,
224
- 'categories' => [
225
- TagsModule::POST_META_CATEGORY,
226
- ],
227
- ],
228
- ]
229
- );
230
-
231
- $repeater->add_control(
232
- 'pinterest_url',
233
-
234
- [
235
- 'type' => Controls_Manager::TEXT,
236
-
237
- 'label' => __('Pinterest Page URL', 'livemesh-el-addons'),
238
- 'description' => __('URL of the Pinterest page for the team member.', 'livemesh-el-addons'),
239
- 'dynamic' => [
240
- 'active' => true,
241
- 'categories' => [
242
- TagsModule::POST_META_CATEGORY,
243
- ],
244
- ],
245
- ]
246
- );
247
-
248
- $repeater->add_control(
249
- 'dribbble_url',
250
- [
251
- 'type' => Controls_Manager::TEXT,
252
-
253
- 'label' => __('Dribbble Profile URL', 'livemesh-el-addons'),
254
- 'description' => __('URL of the Dribbble profile of the team member.', 'livemesh-el-addons'),
255
- 'dynamic' => [
256
- 'active' => true,
257
- 'categories' => [
258
- TagsModule::POST_META_CATEGORY,
259
- ],
260
- ],
261
- ]
262
- );
263
-
264
- $repeater->add_control(
265
- 'google_plus_url',
266
- [
267
- 'type' => Controls_Manager::TEXT,
268
-
269
- 'label' => __('GooglePlus Page URL', 'livemesh-el-addons'),
270
- 'description' => __('URL of the Google Plus page of the team member.', 'livemesh-el-addons'),
271
- 'dynamic' => [
272
- 'active' => true,
273
- 'categories' => [
274
- TagsModule::POST_META_CATEGORY,
275
- ],
276
- ],
277
- ]
278
- );
279
-
280
- $repeater->add_control(
281
- 'instagram_url',
282
- [
283
- 'type' => Controls_Manager::TEXT,
284
-
285
- 'label' => __('Instagram Page URL', 'livemesh-el-addons'),
286
- 'description' => __('URL of the Instagram feed for the team member.', 'livemesh-el-addons'),
287
- 'dynamic' => [
288
- 'active' => true,
289
- 'categories' => [
290
- TagsModule::POST_META_CATEGORY,
291
- ],
292
- ],
293
- ]
294
- );
295
-
296
- $repeater->add_control(
297
- "widget_animation",
298
- [
299
- "type" => Controls_Manager::SELECT,
300
- "label" => __("Animation Type", "livemesh-el-addons"),
301
- 'options' => lae_get_animation_options(),
302
- 'default' => 'none',
303
- 'separator' => 'before',
304
- ]
305
- );
306
-
307
- $this->add_control(
308
- 'team_members',
309
- [
310
- 'label' => __('Team Members', 'livemesh-el-addons'),
311
- 'type' => Controls_Manager::REPEATER,
312
- 'separator' => 'before',
313
- 'default' => [
314
- [
315
- 'member_name' => __('Team Member #1', 'livemesh-el-addons'),
316
- 'member_position' => __('CEO', 'livemesh-el-addons'),
317
- 'member_details' => __('I am member details. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons'),
318
- ],
319
- [
320
- 'member_name' => __('Team Member #2', 'livemesh-el-addons'),
321
- 'member_position' => __('Lead Developer', 'livemesh-el-addons'),
322
- 'member_details' => __('I am member details. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons'),
323
- ],
324
- [
325
- 'member_name' => __('Team Member #3', 'livemesh-el-addons'),
326
- 'member_position' => __('Finance Manager', 'livemesh-el-addons'),
327
- 'member_details' => __('I am member details. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons'),
328
- ],
329
- ],
330
- 'fields' => $repeater->get_controls(),
331
- 'title_field' => '{{{ member_name }}}',
332
- ]
333
- );
334
-
335
  $this->end_controls_section();
336
-
337
- $this->start_controls_section(
338
- 'section_general_settings',
339
- [
340
- 'label' => __('General Settings', 'livemesh-el-addons'),
341
- 'tab' => Controls_Manager::TAB_SETTINGS,
342
- ]
343
- );
344
-
345
- $this->add_control(
346
-
347
- 'style', [
348
- 'type' => Controls_Manager::SELECT,
349
- 'label' => __('Choose Team Style', 'livemesh-el-addons'),
350
- 'default' => 'style1',
351
- 'options' => [
352
- 'style1' => __('Style 1', 'livemesh-el-addons'),
353
- 'style2' => __('Style 2', 'livemesh-el-addons'),
354
- ],
355
- ]
356
- );
357
-
358
- $this->add_group_control(
359
- Group_Control_Image_Size::get_type(),
360
- [
361
- 'name' => 'thumbnail_size',
362
- 'label' => __('Team Member Image Size', 'livemesh-el-addons'),
363
- 'default' => 'full',
364
- ]
365
- );
366
-
367
  $this->end_controls_section();
368
-
369
- $this->start_controls_section(
370
- 'section_grid_settings',
371
- [
372
- 'label' => __('Grid Settings', 'livemesh-el-addons'),
373
- 'tab' => Controls_Manager::TAB_SETTINGS,
374
- 'condition' => [
375
- 'style' => 'style1',
376
- ],
377
- ]
378
- );
379
-
380
- $this->add_control(
381
- 'column_layout',
382
- [
383
- 'label' => __('Column Layout', 'livemesh-el-addons'),
384
- 'type' => Controls_Manager::SELECT,
385
- 'options' => array(
386
- 'auto' => __('Auto', 'livemesh-el-addons'),
387
- 'custom' => __('Custom', 'livemesh-el-addons'),
388
- ),
389
- 'default' => 'auto',
390
- 'description' => __('Set column layout to be <strong>Auto</strong> to let the widget auto calculate number of columns based on minimum column size specified. The option <strong>Custom</strong> lets you explicitly control number of columns based on screen width.', 'livemesh-el-addons'),
391
- ]
392
- );
393
-
394
- $this->add_control(
395
- 'min_column_size',
396
- [
397
- 'label' => __('Minimum Column Size', 'livemesh-el-addons'),
398
- 'type' => Controls_Manager::SLIDER,
399
- 'size_units' => ['px'],
400
- 'default' => [
401
- 'size' => 300,
402
- ],
403
- 'range' => [
404
- 'px' => [
405
- 'min' => 50,
406
- 'max' => 500,
407
- ],
408
- ],
409
- 'selectors' => [
410
- '{{WRAPPER}} .lae-uber-grid-container.lae-grid-auto-column-layout' => 'grid-template-columns: repeat(auto-fit, minmax({{SIZE}}{{UNIT}}, 1fr));',
411
- ],
412
- 'condition' => [
413
- 'column_layout' => 'auto'
414
- ]
415
- ]
416
- );
417
-
418
- $this->add_responsive_control(
419
- 'per_line',
420
- [
421
- 'label' => __('Columns per row', 'livemesh-el-addons'),
422
- 'type' => Controls_Manager::SELECT,
423
- 'default' => '3',
424
- 'tablet_default' => '2',
425
- 'mobile_default' => '1',
426
- 'options' => [
427
- '1' => '1',
428
- '2' => '2',
429
- '3' => '3',
430
- '4' => '4',
431
- '5' => '5',
432
- '6' => '6',
433
- ],
434
- 'frontend_available' => true,
435
- 'condition' => [
436
- 'column_layout' => 'custom'
437
- ]
438
- ]
439
- );
440
-
441
- $this->add_control(
442
- 'column_gap',
443
- [
444
- 'label' => __('Column Gap', 'livemesh-el-addons'),
445
- 'type' => Controls_Manager::SLIDER,
446
- 'size_units' => ['px'],
447
- 'default' => [
448
- 'size' => 30,
449
- ],
450
- 'range' => [
451
- 'px' => [
452
- 'min' => 0,
453
- 'max' => 100,
454
- ],
455
- ],
456
- 'selectors' => [
457
- '{{WRAPPER}} .lae-uber-grid-container' => 'column-gap: {{SIZE}}{{UNIT}};',
458
- ],
459
- ]
460
- );
461
-
462
- $this->add_control(
463
- 'row_gap',
464
- [
465
- 'label' => __('Row Gap', 'livemesh-el-addons'),
466
- 'type' => Controls_Manager::SLIDER,
467
- 'size_units' => ['px'],
468
- 'default' => [
469
- 'size' => 30,
470
- ],
471
- 'range' => [
472
- 'px' => [
473
- 'min' => 0,
474
- 'max' => 100,
475
- ],
476
- ],
477
- 'selectors' => [
478
- '{{WRAPPER}} .lae-uber-grid-container' => 'row-gap: {{SIZE}}{{UNIT}};',
479
- ],
480
- ]
481
- );
482
-
483
  $this->end_controls_section();
484
-
485
-
486
- $this->start_controls_section(
487
- 'section_team_profiles_style',
488
- [
489
- 'label' => __('General', 'livemesh-el-addons'),
490
- 'tab' => Controls_Manager::TAB_STYLE,
491
- 'show_label' => false,
492
- ]
493
- );
494
-
495
- $this->add_responsive_control(
496
- 'team_member_spacing',
497
- [
498
- 'label' => __('Team Member Spacing', 'livemesh-el-addons'),
499
- 'type' => Controls_Manager::DIMENSIONS,
500
- 'size_units' => ['px', 'em'],
501
- 'selectors' => [
502
- '{{WRAPPER}} .lae-team-members .lae-team-member-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
503
- ],
504
- 'isLinked' => false,
505
- 'condition' => [
506
- 'style' => ['style2'],
507
- ],
508
- ]
509
- );
510
-
511
- $this->add_responsive_control(
512
- 'thumbnail_hover_brightness',
513
- [
514
- 'label' => __('Thumbnail Hover Brightness (%)', 'livemesh-el-addons'),
515
- 'type' => Controls_Manager::SLIDER,
516
- 'default' => [
517
- 'size' => 50,
518
- ],
519
- 'range' => [
520
- 'px' => [
521
- 'max' => 100,
522
- 'min' => 1,
523
- 'step' => 1,
524
- ],
525
- ],
526
- 'selectors' => [
527
- '{{WRAPPER}} .lae-team-members .lae-team-member:hover .lae-image-wrapper img' => '-webkit-filter: brightness({{SIZE}}%);-moz-filter: brightness({{SIZE}}%);-ms-filter: brightness({{SIZE}}%); filter: brightness({{SIZE}}%);',
528
- ],
529
- ]
530
- );
531
-
532
-
533
- $this->add_control(
534
- 'thumbnail_border_radius',
535
- [
536
- 'label' => __('Thumbnail Border Radius', 'livemesh-el-addons'),
537
- 'type' => Controls_Manager::DIMENSIONS,
538
- 'size_units' => ['px', '%'],
539
- 'selectors' => [
540
- '{{WRAPPER}} .lae-team-members .lae-team-member .lae-image-wrapper img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
541
- ],
542
- ]
543
- );
544
-
545
  $this->end_controls_section();
546
-
547
- $this->start_controls_section(
548
- 'section_team_member_title',
549
- [
550
- 'label' => __('Member Title', 'livemesh-el-addons'),
551
- 'tab' => Controls_Manager::TAB_STYLE,
552
- ]
553
- );
554
-
555
- $this->add_control(
556
- 'title_tag',
557
- [
558
- 'label' => __('Title HTML Tag', 'livemesh-el-addons'),
559
- 'type' => Controls_Manager::SELECT,
560
- 'options' => [
561
- 'h1' => __('H1', 'livemesh-el-addons'),
562
- 'h2' => __('H2', 'livemesh-el-addons'),
563
- 'h3' => __('H3', 'livemesh-el-addons'),
564
- 'h4' => __('H4', 'livemesh-el-addons'),
565
- 'h5' => __('H5', 'livemesh-el-addons'),
566
- 'h6' => __('H6', 'livemesh-el-addons'),
567
- 'div' => __('div', 'livemesh-el-addons'),
568
- ],
569
- 'default' => 'h3',
570
- ]
571
- );
572
-
573
- $this->add_control(
574
- 'title_color',
575
- [
576
- 'label' => __('Color', 'livemesh-el-addons'),
577
- 'type' => Controls_Manager::COLOR,
578
- 'selectors' => [
579
- '{{WRAPPER}} .lae-team-members .lae-team-member .lae-team-member-text .lae-title' => 'color: {{VALUE}};',
580
- ],
581
- ]
582
- );
583
-
584
- $this->add_control(
585
- 'title_hover_color',
586
- [
587
- 'label' => __('Hover Color for Link', 'livemesh-el-addons'),
588
- 'type' => Controls_Manager::COLOR,
589
- 'selectors' => [
590
- '{{WRAPPER}} .lae-team-members .lae-team-member .lae-team-member-text .lae-title-link:hover .lae-title' => 'color: {{VALUE}};',
591
- ],
592
- ]
593
- );
594
-
595
- $this->add_group_control(
596
- Group_Control_Typography::get_type(),
597
- [
598
- 'name' => 'title_typography',
599
- 'selector' => '{{WRAPPER}} .lae-team-members .lae-team-member .lae-team-member-text .lae-title',
600
- ]
601
- );
602
-
603
  $this->end_controls_section();
604
-
605
- $this->start_controls_section(
606
- 'section_team_member_position',
607
- [
608
- 'label' => __('Member Position', 'livemesh-el-addons'),
609
- 'tab' => Controls_Manager::TAB_STYLE,
610
- ]
611
- );
612
-
613
- $this->add_control(
614
- 'position_color',
615
- [
616
- 'label' => __('Color', 'livemesh-el-addons'),
617
- 'type' => Controls_Manager::COLOR,
618
- 'selectors' => [
619
- '{{WRAPPER}} .lae-team-members .lae-team-member .lae-team-member-text .lae-team-member-position' => 'color: {{VALUE}};',
620
- ],
621
- ]
622
- );
623
-
624
- $this->add_group_control(
625
- Group_Control_Typography::get_type(),
626
- [
627
- 'name' => 'position_typography',
628
- 'selector' => '{{WRAPPER}} .lae-team-members .lae-team-member .lae-team-member-text .lae-team-member-position',
629
- ]
630
- );
631
-
632
  $this->end_controls_section();
633
-
634
- $this->start_controls_section(
635
- 'section_team_member_details',
636
- [
637
- 'label' => __('Member Details', 'livemesh-el-addons'),
638
- 'tab' => Controls_Manager::TAB_STYLE,
639
- ]
640
- );
641
-
642
- $this->add_control(
643
- 'text_color',
644
- [
645
- 'label' => __('Color', 'livemesh-el-addons'),
646
- 'type' => Controls_Manager::COLOR,
647
- 'selectors' => [
648
- '{{WRAPPER}} .lae-team-members .lae-team-member .lae-team-member-details' => 'color: {{VALUE}};',
649
- ],
650
- ]
651
- );
652
-
653
- $this->add_group_control(
654
- Group_Control_Typography::get_type(),
655
- [
656
- 'name' => 'text_typography',
657
- 'selector' => '{{WRAPPER}} .lae-team-members .lae-team-member .lae-team-member-details',
658
- ]
659
- );
660
-
661
  $this->end_controls_section();
662
-
663
-
664
- $this->start_controls_section(
665
- 'section_social_icon_styling',
666
- [
667
- 'label' => __('Social Icons', 'livemesh-el-addons'),
668
- 'tab' => Controls_Manager::TAB_STYLE,
669
- ]
670
- );
671
-
672
- $this->add_control(
673
- 'social_icon_size',
674
- [
675
- 'label' => __('Icon size in pixels', 'livemesh-el-addons'),
676
- 'type' => Controls_Manager::SLIDER,
677
- 'size_units' => ['px', '%', 'em'],
678
- 'range' => [
679
- 'px' => [
680
- 'min' => 10,
681
- 'max' => 128,
682
- ],
683
- ],
684
- 'selectors' => [
685
- '{{WRAPPER}} .lae-team-members .lae-team-member .lae-image-wrapper .lae-social-list i' => 'font-size: {{SIZE}}{{UNIT}};'
686
- ],
687
- ]
688
- );
689
-
690
- $this->add_control(
691
- 'social_icon_spacing',
692
- [
693
- 'label' => __('Spacing', 'livemesh-el-addons'),
694
- 'description' => __('Space between icons.', 'livemesh-el-addons'),
695
- 'type' => Controls_Manager::DIMENSIONS,
696
- 'size_units' => ['px', '%', 'em'],
697
- 'default' => [
698
- 'top' => 0,
699
- 'right' => 15,
700
- 'bottom' => 0,
701
- 'left' => 0,
702
- 'unit' => 'px',
703
- ],
704
- 'selectors' => [
705
- '{{WRAPPER}} .lae-team-members .lae-team-member .lae-social-list .lae-social-list-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
706
- ],
707
- 'isLinked' => false
708
- ]
709
- );
710
-
711
- $this->add_control(
712
- 'social_icon_color',
713
- [
714
- 'label' => __('Icon Color', 'livemesh-el-addons'),
715
- 'type' => Controls_Manager::COLOR,
716
- 'default' => '',
717
- 'selectors' => [
718
- '{{WRAPPER}} .lae-team-members .lae-team-member .lae-social-list .lae-social-list-item i' => 'color: {{VALUE}};',
719
- ],
720
- ]
721
- );
722
-
723
- $this->add_control(
724
- 'social_icon_hover_color',
725
- [
726
- 'label' => __('Icon Hover Color', 'livemesh-el-addons'),
727
- 'type' => Controls_Manager::COLOR,
728
- 'default' => '',
729
- 'selectors' => [
730
- '{{WRAPPER}} .lae-team-members .lae-team-member .lae-social-list .lae-social-list-item i:hover' => 'color: {{VALUE}};',
731
- ],
732
- ]
733
- );
734
-
735
  $this->end_controls_section();
736
-
737
  }
738
-
739
- protected function render() {
740
-
741
  $settings = $this->get_settings_for_display();
742
-
743
- $settings = apply_filters('lae_team_members_' . $this->get_id() . '_settings', $settings);
744
-
745
  $args['settings'] = $settings;
746
-
747
  $args['widget_instance'] = $this;
748
-
749
- lae_get_template_part('addons/team-members/loop', $args);
750
-
751
  }
752
-
753
- protected function content_template() {
 
754
  }
755
 
756
  }
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
 
9
  namespace LivemeshAddons\Widgets;
10
 
11
+ use Elementor\Repeater ;
12
+ use Elementor\Widget_Base ;
13
+ use Elementor\Controls_Manager ;
14
+ use Elementor\Utils ;
15
+ use Elementor\Scheme_Color ;
16
+ use Elementor\Group_Control_Typography ;
17
+ use Elementor\Group_Control_Image_Size ;
18
+ use Elementor\Scheme_Typography ;
19
+ use Elementor\Modules\DynamicTags\Module as TagsModule ;
20
+ if ( !defined( 'ABSPATH' ) ) {
21
+ exit;
22
+ }
23
+ // Exit if accessed directly
24
+ class LAE_Team_Widget extends LAE_Widget_Base
25
+ {
26
+ public function get_name()
27
+ {
 
28
  return 'lae-team-members';
29
  }
30
+
31
+ public function get_title()
32
+ {
33
+ return __( 'Team Members', 'livemesh-el-addons' );
34
  }
35
+
36
+ public function get_icon()
37
+ {
38
  return 'lae-icon-team4';
39
  }
40
+
41
+ public function get_categories()
42
+ {
43
+ return array( 'livemesh-addons' );
44
  }
45
+
46
+ public function get_custom_help_url()
47
+ {
48
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/team-members/';
49
  }
50
+
51
+ public function get_script_depends()
52
+ {
53
+ return [ 'lae-waypoints', 'lae-frontend-scripts' ];
 
 
54
  }
55
+
56
+ public function get_style_depends()
57
+ {
58
  return [
59
  'lae-icomoon-styles',
60
  'lae-animate-styles',
62
  'lae-team-members-styles'
63
  ];
64
  }
65
+
66
+ protected function _register_controls()
67
+ {
68
+ $this->start_controls_section( 'section_team', [
69
+ 'label' => __( 'Team', 'livemesh-el-addons' ),
70
+ ] );
 
 
 
 
71
  $repeater = new Repeater();
72
+ $repeater->add_control( 'member_name', [
73
+ 'label' => __( 'Member Name', 'livemesh-el-addons' ),
74
+ 'type' => Controls_Manager::TEXT,
75
+ 'default' => __( 'My team member name', 'livemesh-el-addons' ),
76
+ 'dynamic' => [
77
+ 'active' => true,
78
+ ],
79
+ ] );
80
+ $repeater->add_control( 'member_position', [
81
+ 'label' => __( 'Position', 'livemesh-el-addons' ),
82
+ 'type' => Controls_Manager::TEXT,
83
+ 'dynamic' => [
84
+ 'active' => true,
85
+ 'categories' => [ TagsModule::POST_META_CATEGORY ],
86
+ ],
87
+ ] );
88
+ $repeater->add_control( 'member_image', [
89
+ 'label' => __( 'Team Member Image', 'livemesh-el-addons' ),
90
+ 'type' => Controls_Manager::MEDIA,
91
+ 'default' => [
92
+ 'url' => Utils::get_placeholder_image_src(),
93
+ ],
94
+ 'label_block' => true,
95
+ 'dynamic' => [
96
+ 'active' => true,
97
+ ],
98
+ ] );
99
+ $repeater->add_control( 'member_link', [
100
+ 'label' => __( 'Team Member URL', 'livemesh-el-addons' ),
101
+ 'description' => __( 'The link for the page describing the team member.', 'livemesh-el-addons' ),
102
+ 'type' => Controls_Manager::URL,
103
+ 'label_block' => true,
104
+ 'default' => [
105
+ 'url' => '',
106
+ 'is_external' => 'true',
107
+ ],
108
+ 'placeholder' => __( 'http://member-link.com', 'livemesh-el-addons' ),
109
+ 'dynamic' => [
110
+ 'active' => true,
111
+ ],
112
+ ] );
113
+ $repeater->add_control( 'member_details', [
114
+ 'label' => __( 'Team Member details', 'livemesh-el-addons' ),
115
+ 'type' => Controls_Manager::TEXTAREA,
116
+ 'default' => __( 'Details about team member', 'livemesh-el-addons' ),
117
+ 'description' => __( 'Provide a short writeup for the team member', 'livemesh-el-addons' ),
118
+ 'label_block' => true,
119
+ 'dynamic' => [
120
+ 'active' => true,
121
+ ],
122
+ ] );
123
+ $repeater->add_control( 'social_profile', [
124
+ 'label' => __( 'Social Profile', 'livemesh-el-addons' ),
125
+ 'type' => Controls_Manager::HEADING,
126
+ 'separator' => 'before',
127
+ ] );
128
+ $repeater->add_control( 'member_email', [
129
+ 'type' => Controls_Manager::TEXT,
130
+ 'label' => __( 'Email Address', 'livemesh-el-addons' ),
131
+ 'description' => __( 'Enter the email address of the team member.', 'livemesh-el-addons' ),
132
+ 'dynamic' => [
133
+ 'active' => true,
134
+ 'categories' => [ TagsModule::POST_META_CATEGORY ],
135
+ ],
136
+ ] );
137
+ $repeater->add_control( 'facebook_url', [
138
+ 'type' => Controls_Manager::TEXT,
139
+ 'label' => __( 'Facebook Page URL', 'livemesh-el-addons' ),
140
+ 'description' => __( 'URL of the Facebook page of the team member.', 'livemesh-el-addons' ),
141
+ 'dynamic' => [
142
+ 'active' => true,
143
+ 'categories' => [ TagsModule::POST_META_CATEGORY ],
144
+ ],
145
+ ] );
146
+ $repeater->add_control( 'twitter_url', [
147
+ 'type' => Controls_Manager::TEXT,
148
+ 'label' => __( 'Twitter Profile URL', 'livemesh-el-addons' ),
149
+ 'description' => __( 'URL of the Twitter page of the team member.', 'livemesh-el-addons' ),
150
+ 'dynamic' => [
151
+ 'active' => true,
152
+ 'categories' => [ TagsModule::POST_META_CATEGORY ],
153
+ ],
154
+ ] );
155
+ $repeater->add_control( 'linkedin_url', [
156
+ 'type' => Controls_Manager::TEXT,
157
+ 'label' => __( 'LinkedIn Page URL', 'livemesh-el-addons' ),
158
+ 'description' => __( 'URL of the LinkedIn profile of the team member.', 'livemesh-el-addons' ),
159
+ 'dynamic' => [
160
+ 'active' => true,
161
+ 'categories' => [ TagsModule::POST_META_CATEGORY ],
162
+ ],
163
+ ] );
164
+ $repeater->add_control( 'pinterest_url', [
165
+ 'type' => Controls_Manager::TEXT,
166
+ 'label' => __( 'Pinterest Page URL', 'livemesh-el-addons' ),
167
+ 'description' => __( 'URL of the Pinterest page for the team member.', 'livemesh-el-addons' ),
168
+ 'dynamic' => [
169
+ 'active' => true,
170
+ 'categories' => [ TagsModule::POST_META_CATEGORY ],
171
+ ],
172
+ ] );
173
+ $repeater->add_control( 'dribbble_url', [
174
+ 'type' => Controls_Manager::TEXT,
175
+ 'label' => __( 'Dribbble Profile URL', 'livemesh-el-addons' ),
176
+ 'description' => __( 'URL of the Dribbble profile of the team member.', 'livemesh-el-addons' ),
177
+ 'dynamic' => [
178
+ 'active' => true,
179
+ 'categories' => [ TagsModule::POST_META_CATEGORY ],
180
+ ],
181
+ ] );
182
+ $repeater->add_control( 'google_plus_url', [
183
+ 'type' => Controls_Manager::TEXT,
184
+ 'label' => __( 'GooglePlus Page URL', 'livemesh-el-addons' ),
185
+ 'description' => __( 'URL of the Google Plus page of the team member.', 'livemesh-el-addons' ),
186
+ 'dynamic' => [
187
+ 'active' => true,
188
+ 'categories' => [ TagsModule::POST_META_CATEGORY ],
189
+ ],
190
+ ] );
191
+ $repeater->add_control( 'instagram_url', [
192
+ 'type' => Controls_Manager::TEXT,
193
+ 'label' => __( 'Instagram Page URL', 'livemesh-el-addons' ),
194
+ 'description' => __( 'URL of the Instagram feed for the team member.', 'livemesh-el-addons' ),
195
+ 'dynamic' => [
196
+ 'active' => true,
197
+ 'categories' => [ TagsModule::POST_META_CATEGORY ],
198
+ ],
199
+ ] );
200
+ $repeater->add_control( "widget_animation", [
201
+ "type" => Controls_Manager::SELECT,
202
+ "label" => __( "Animation Type", "livemesh-el-addons" ),
203
+ 'options' => lae_get_animation_options(),
204
+ 'default' => 'none',
205
+ 'separator' => 'before',
206
+ ] );
207
+ $this->add_control( 'team_members', [
208
+ 'label' => __( 'Team Members', 'livemesh-el-addons' ),
209
+ 'type' => Controls_Manager::REPEATER,
210
+ 'separator' => 'before',
211
+ 'default' => [ [
212
+ 'member_name' => __( 'Team Member #1', 'livemesh-el-addons' ),
213
+ 'member_position' => __( 'CEO', 'livemesh-el-addons' ),
214
+ 'member_details' => __( 'I am member details. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons' ),
215
+ ], [
216
+ 'member_name' => __( 'Team Member #2', 'livemesh-el-addons' ),
217
+ 'member_position' => __( 'Lead Developer', 'livemesh-el-addons' ),
218
+ 'member_details' => __( 'I am member details. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons' ),
219
+ ], [
220
+ 'member_name' => __( 'Team Member #3', 'livemesh-el-addons' ),
221
+ 'member_position' => __( 'Finance Manager', 'livemesh-el-addons' ),
222
+ 'member_details' => __( 'I am member details. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons' ),
223
+ ] ],
224
+ 'fields' => $repeater->get_controls(),
225
+ 'title_field' => '{{{ member_name }}}',
226
+ ] );
227
+ $this->add_control( 'upgrade_notice', [
228
+ 'type' => Controls_Manager::RAW_HTML,
229
+ 'separator' => 'before',
230
+ 'raw' => '<div style="text-align:center;line-height:1.6;"><p>' . __( 'Unlock new possibilities with premium widgets and styles of <strong>Livemesh Addons for Elementor <i>Premium</i></strong>. ', 'livemesh-el-addons' ) . '</p><p style="padding-top:15px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://livemeshelementor.com/pricing/#pricing-plans" target="_blank"><i class="fa fa-hand-o-right" aria-hidden="true"></i>' . __( 'Go Pro', 'livemesh-el-addons' ) . '</a></p></div>',
231
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
  $this->end_controls_section();
233
+ $this->start_controls_section( 'section_general_settings', [
234
+ 'label' => __( 'General Settings', 'livemesh-el-addons' ),
235
+ 'tab' => Controls_Manager::TAB_SETTINGS,
236
+ ] );
237
+ $this->add_control( 'style', [
238
+ 'type' => Controls_Manager::SELECT,
239
+ 'label' => __( 'Choose Team Style', 'livemesh-el-addons' ),
240
+ 'default' => 'style1',
241
+ 'options' => [
242
+ 'style1' => __( 'Style 1', 'livemesh-el-addons' ),
243
+ 'style2' => __( 'Style 2', 'livemesh-el-addons' ),
244
+ ],
245
+ ] );
246
+ $this->add_group_control( Group_Control_Image_Size::get_type(), [
247
+ 'name' => 'thumbnail_size',
248
+ 'label' => __( 'Team Member Image Size', 'livemesh-el-addons' ),
249
+ 'default' => 'full',
250
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  $this->end_controls_section();
252
+ $this->start_controls_section( 'section_grid_settings', [
253
+ 'label' => __( 'Grid Settings', 'livemesh-el-addons' ),
254
+ 'tab' => Controls_Manager::TAB_SETTINGS,
255
+ 'condition' => [
256
+ 'style' => 'style1',
257
+ ],
258
+ ] );
259
+ $this->add_control( 'column_layout', [
260
+ 'label' => __( 'Column Layout', 'livemesh-el-addons' ),
261
+ 'type' => Controls_Manager::SELECT,
262
+ 'options' => array(
263
+ 'auto' => __( 'Auto', 'livemesh-el-addons' ),
264
+ 'custom' => __( 'Custom', 'livemesh-el-addons' ),
265
+ ),
266
+ 'default' => 'auto',
267
+ 'description' => __( 'Set column layout to be <strong>Auto</strong> to let the widget auto calculate number of columns based on minimum column size specified. The option <strong>Custom</strong> lets you explicitly control number of columns based on screen width.', 'livemesh-el-addons' ),
268
+ ] );
269
+ $this->add_control( 'min_column_size', [
270
+ 'label' => __( 'Minimum Column Size', 'livemesh-el-addons' ),
271
+ 'type' => Controls_Manager::SLIDER,
272
+ 'size_units' => [ 'px' ],
273
+ 'default' => [
274
+ 'size' => 300,
275
+ ],
276
+ 'range' => [
277
+ 'px' => [
278
+ 'min' => 50,
279
+ 'max' => 500,
280
+ ],
281
+ ],
282
+ 'selectors' => [
283
+ '{{WRAPPER}} .lae-uber-grid-container.lae-grid-auto-column-layout' => 'grid-template-columns: repeat(auto-fit, minmax({{SIZE}}{{UNIT}}, 1fr));',
284
+ ],
285
+ 'condition' => [
286
+ 'column_layout' => 'auto',
287
+ ],
288
+ ] );
289
+ $this->add_responsive_control( 'per_line', [
290
+ 'label' => __( 'Columns per row', 'livemesh-el-addons' ),
291
+ 'type' => Controls_Manager::SELECT,
292
+ 'default' => '3',
293
+ 'tablet_default' => '2',
294
+ 'mobile_default' => '1',
295
+ 'options' => [
296
+ '1' => '1',
297
+ '2' => '2',
298
+ '3' => '3',
299
+ '4' => '4',
300
+ '5' => '5',
301
+ '6' => '6',
302
+ ],
303
+ 'frontend_available' => true,
304
+ 'condition' => [
305
+ 'column_layout' => 'custom',
306
+ ],
307
+ ] );
308
+ $this->add_control( 'column_gap', [
309
+ 'label' => __( 'Column Gap', 'livemesh-el-addons' ),
310
+ 'type' => Controls_Manager::SLIDER,
311
+ 'size_units' => [ 'px' ],
312
+ 'default' => [
313
+ 'size' => 30,
314
+ ],
315
+ 'range' => [
316
+ 'px' => [
317
+ 'min' => 0,
318
+ 'max' => 100,
319
+ ],
320
+ ],
321
+ 'selectors' => [
322
+ '{{WRAPPER}} .lae-uber-grid-container' => 'column-gap: {{SIZE}}{{UNIT}};',
323
+ ],
324
+ ] );
325
+ $this->add_control( 'row_gap', [
326
+ 'label' => __( 'Row Gap', 'livemesh-el-addons' ),
327
+ 'type' => Controls_Manager::SLIDER,
328
+ 'size_units' => [ 'px' ],
329
+ 'default' => [
330
+ 'size' => 30,
331
+ ],
332
+ 'range' => [
333
+ 'px' => [
334
+ 'min' => 0,
335
+ 'max' => 100,
336
+ ],
337
+ ],
338
+ 'selectors' => [
339
+ '{{WRAPPER}} .lae-uber-grid-container' => 'row-gap: {{SIZE}}{{UNIT}};',
340
+ ],
341
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
  $this->end_controls_section();
343
+ $this->start_controls_section( 'section_team_profiles_style', [
344
+ 'label' => __( 'General', 'livemesh-el-addons' ),
345
+ 'tab' => Controls_Manager::TAB_STYLE,
346
+ 'show_label' => false,
347
+ ] );
348
+ $this->add_responsive_control( 'team_member_spacing', [
349
+ 'label' => __( 'Team Member Spacing', 'livemesh-el-addons' ),
350
+ 'type' => Controls_Manager::DIMENSIONS,
351
+ 'size_units' => [ 'px', 'em' ],
352
+ 'selectors' => [
353
+ '{{WRAPPER}} .lae-team-members .lae-team-member-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
354
+ ],
355
+ 'isLinked' => false,
356
+ 'condition' => [
357
+ 'style' => [ 'style2' ],
358
+ ],
359
+ ] );
360
+ $this->add_responsive_control( 'thumbnail_hover_brightness', [
361
+ 'label' => __( 'Thumbnail Hover Brightness (%)', 'livemesh-el-addons' ),
362
+ 'type' => Controls_Manager::SLIDER,
363
+ 'default' => [
364
+ 'size' => 50,
365
+ ],
366
+ 'range' => [
367
+ 'px' => [
368
+ 'max' => 100,
369
+ 'min' => 1,
370
+ 'step' => 1,
371
+ ],
372
+ ],
373
+ 'selectors' => [
374
+ '{{WRAPPER}} .lae-team-members .lae-team-member:hover .lae-image-wrapper img' => '-webkit-filter: brightness({{SIZE}}%);-moz-filter: brightness({{SIZE}}%);-ms-filter: brightness({{SIZE}}%); filter: brightness({{SIZE}}%);',
375
+ ],
376
+ ] );
377
+ $this->add_control( 'thumbnail_border_radius', [
378
+ 'label' => __( 'Thumbnail Border Radius', 'livemesh-el-addons' ),
379
+ 'type' => Controls_Manager::DIMENSIONS,
380
+ 'size_units' => [ 'px', '%' ],
381
+ 'selectors' => [
382
+ '{{WRAPPER}} .lae-team-members .lae-team-member .lae-image-wrapper img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
383
+ ],
384
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
385
  $this->end_controls_section();
386
+ $this->start_controls_section( 'section_team_member_title', [
387
+ 'label' => __( 'Member Title', 'livemesh-el-addons' ),
388
+ 'tab' => Controls_Manager::TAB_STYLE,
389
+ ] );
390
+ $this->add_control( 'title_tag', [
391
+ 'label' => __( 'Title HTML Tag', 'livemesh-el-addons' ),
392
+ 'type' => Controls_Manager::SELECT,
393
+ 'options' => [
394
+ 'h1' => __( 'H1', 'livemesh-el-addons' ),
395
+ 'h2' => __( 'H2', 'livemesh-el-addons' ),
396
+ 'h3' => __( 'H3', 'livemesh-el-addons' ),
397
+ 'h4' => __( 'H4', 'livemesh-el-addons' ),
398
+ 'h5' => __( 'H5', 'livemesh-el-addons' ),
399
+ 'h6' => __( 'H6', 'livemesh-el-addons' ),
400
+ 'div' => __( 'div', 'livemesh-el-addons' ),
401
+ ],
402
+ 'default' => 'h3',
403
+ ] );
404
+ $this->add_control( 'title_color', [
405
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
406
+ 'type' => Controls_Manager::COLOR,
407
+ 'selectors' => [
408
+ '{{WRAPPER}} .lae-team-members .lae-team-member .lae-team-member-text .lae-title' => 'color: {{VALUE}};',
409
+ ],
410
+ ] );
411
+ $this->add_control( 'title_hover_color', [
412
+ 'label' => __( 'Hover Color for Link', 'livemesh-el-addons' ),
413
+ 'type' => Controls_Manager::COLOR,
414
+ 'selectors' => [
415
+ '{{WRAPPER}} .lae-team-members .lae-team-member .lae-team-member-text .lae-title-link:hover .lae-title' => 'color: {{VALUE}};',
416
+ ],
417
+ ] );
418
+ $this->add_group_control( Group_Control_Typography::get_type(), [
419
+ 'name' => 'title_typography',
420
+ 'selector' => '{{WRAPPER}} .lae-team-members .lae-team-member .lae-team-member-text .lae-title',
421
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
422
  $this->end_controls_section();
423
+ $this->start_controls_section( 'section_team_member_position', [
424
+ 'label' => __( 'Member Position', 'livemesh-el-addons' ),
425
+ 'tab' => Controls_Manager::TAB_STYLE,
426
+ ] );
427
+ $this->add_control( 'position_color', [
428
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
429
+ 'type' => Controls_Manager::COLOR,
430
+ 'selectors' => [
431
+ '{{WRAPPER}} .lae-team-members .lae-team-member .lae-team-member-text .lae-team-member-position' => 'color: {{VALUE}};',
432
+ ],
433
+ ] );
434
+ $this->add_group_control( Group_Control_Typography::get_type(), [
435
+ 'name' => 'position_typography',
436
+ 'selector' => '{{WRAPPER}} .lae-team-members .lae-team-member .lae-team-member-text .lae-team-member-position',
437
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
438
  $this->end_controls_section();
439
+ $this->start_controls_section( 'section_team_member_details', [
440
+ 'label' => __( 'Member Details', 'livemesh-el-addons' ),
441
+ 'tab' => Controls_Manager::TAB_STYLE,
442
+ ] );
443
+ $this->add_control( 'text_color', [
444
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
445
+ 'type' => Controls_Manager::COLOR,
446
+ 'selectors' => [
447
+ '{{WRAPPER}} .lae-team-members .lae-team-member .lae-team-member-details' => 'color: {{VALUE}};',
448
+ ],
449
+ ] );
450
+ $this->add_group_control( Group_Control_Typography::get_type(), [
451
+ 'name' => 'text_typography',
452
+ 'selector' => '{{WRAPPER}} .lae-team-members .lae-team-member .lae-team-member-details',
453
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
454
  $this->end_controls_section();
455
+ $this->start_controls_section( 'section_social_icon_styling', [
456
+ 'label' => __( 'Social Icons', 'livemesh-el-addons' ),
457
+ 'tab' => Controls_Manager::TAB_STYLE,
458
+ ] );
459
+ $this->add_control( 'social_icon_size', [
460
+ 'label' => __( 'Icon size in pixels', 'livemesh-el-addons' ),
461
+ 'type' => Controls_Manager::SLIDER,
462
+ 'size_units' => [ 'px', '%', 'em' ],
463
+ 'range' => [
464
+ 'px' => [
465
+ 'min' => 10,
466
+ 'max' => 128,
467
+ ],
468
+ ],
469
+ 'selectors' => [
470
+ '{{WRAPPER}} .lae-team-members .lae-team-member .lae-image-wrapper .lae-social-list i' => 'font-size: {{SIZE}}{{UNIT}};',
471
+ ],
472
+ ] );
473
+ $this->add_control( 'social_icon_spacing', [
474
+ 'label' => __( 'Spacing', 'livemesh-el-addons' ),
475
+ 'description' => __( 'Space between icons.', 'livemesh-el-addons' ),
476
+ 'type' => Controls_Manager::DIMENSIONS,
477
+ 'size_units' => [ 'px', '%', 'em' ],
478
+ 'default' => [
479
+ 'top' => 0,
480
+ 'right' => 15,
481
+ 'bottom' => 0,
482
+ 'left' => 0,
483
+ 'unit' => 'px',
484
+ ],
485
+ 'selectors' => [
486
+ '{{WRAPPER}} .lae-team-members .lae-team-member .lae-social-list .lae-social-list-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
487
+ ],
488
+ 'isLinked' => false,
489
+ ] );
490
+ $this->add_control( 'social_icon_color', [
491
+ 'label' => __( 'Icon Color', 'livemesh-el-addons' ),
492
+ 'type' => Controls_Manager::COLOR,
493
+ 'default' => '',
494
+ 'selectors' => [
495
+ '{{WRAPPER}} .lae-team-members .lae-team-member .lae-social-list .lae-social-list-item i' => 'color: {{VALUE}};',
496
+ ],
497
+ ] );
498
+ $this->add_control( 'social_icon_hover_color', [
499
+ 'label' => __( 'Icon Hover Color', 'livemesh-el-addons' ),
500
+ 'type' => Controls_Manager::COLOR,
501
+ 'default' => '',
502
+ 'selectors' => [
503
+ '{{WRAPPER}} .lae-team-members .lae-team-member .lae-social-list .lae-social-list-item i:hover' => 'color: {{VALUE}};',
504
+ ],
505
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
506
  $this->end_controls_section();
 
507
  }
508
+
509
+ protected function render()
510
+ {
511
  $settings = $this->get_settings_for_display();
512
+ $settings = apply_filters( 'lae_team_members_' . $this->get_id() . '_settings', $settings );
 
 
513
  $args['settings'] = $settings;
 
514
  $args['widget_instance'] = $this;
515
+ lae_get_template_part( 'addons/team-members/loop', $args );
 
 
516
  }
517
+
518
+ protected function content_template()
519
+ {
520
  }
521
 
522
  }
includes/widgets/testimonials-slider.php CHANGED
@@ -6,51 +6,52 @@ Description: Display responsive touch friendly slider of testimonials from clien
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
9
-
10
  namespace LivemeshAddons\Widgets;
11
 
12
- use Elementor\Repeater;
13
- use Elementor\Controls_Manager;
14
- use Elementor\Utils;
15
- use Elementor\Scheme_Color;
16
- use Elementor\Group_Control_Typography;
17
- use Elementor\Scheme_Typography;
18
-
19
- if (!defined('ABSPATH'))
20
- exit; // Exit if accessed directly
21
-
22
-
23
- class LAE_Testimonials_Slider_Widget extends LAE_Widget_Base {
24
-
25
- public function get_name() {
26
  return 'lae-testimonials-slider';
27
  }
28
-
29
- public function get_title() {
30
- return __('Testimonials Slider', 'livemesh-el-addons');
 
31
  }
32
-
33
- public function get_icon() {
 
34
  return 'lae-icon-testimonials1';
35
  }
36
-
37
- public function get_categories() {
38
- return array('livemesh-addons');
 
39
  }
40
-
41
- public function get_custom_help_url() {
 
42
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/testimonials-addons/';
43
  }
44
-
45
- public function get_script_depends() {
46
- return [
47
- 'jquery-flexslider',
48
- 'lae-frontend-scripts',
49
- 'lae-testimonials-slider-scripts'
50
- ];
51
  }
52
-
53
- public function get_style_depends() {
 
54
  return [
55
  'lae-icomoon-styles',
56
  'lae-flexslider-styles',
@@ -59,439 +60,290 @@ class LAE_Testimonials_Slider_Widget extends LAE_Widget_Base {
59
  'lae-testimonials-slider-styles'
60
  ];
61
  }
62
-
63
- protected function _register_controls() {
64
-
65
- $this->start_controls_section(
66
- 'section_testimonials_slider',
67
- [
68
- 'label' => __('Testimonials Slider', 'livemesh-el-addons'),
69
- ]
70
- );
71
-
72
  $repeater = new Repeater();
73
-
74
- $repeater->add_control(
75
- 'client_name',
76
- [
77
-
78
- 'label' => __('Name', 'livemesh-el-addons'),
79
- 'type' => Controls_Manager::TEXT,
80
- 'default' => __('My client name', 'livemesh-el-addons'),
81
- 'description' => __('The client or customer name for the testimonial', 'livemesh-el-addons'),
82
- 'dynamic' => [
83
- 'active' => true,
84
- ],
85
- ]
86
- );
87
-
88
- $repeater->add_control(
89
- 'credentials',
90
- [
91
-
92
- 'label' => __('Client Details', 'livemesh-el-addons'),
93
- 'type' => Controls_Manager::TEXT,
94
- 'description' => __('The details of the client/customer like company name, position held, company URL etc. HTML accepted.', 'livemesh-el-addons'),
95
- 'dynamic' => [
96
- 'active' => true,
97
- ],
98
- ]
99
- );
100
-
101
- $repeater->add_control(
102
- 'client_image',
103
- [
104
-
105
- 'label' => __('Customer/Client Image', 'livemesh-el-addons'),
106
- 'type' => Controls_Manager::MEDIA,
107
- 'default' => [
108
- 'url' => Utils::get_placeholder_image_src(),
109
- ],
110
- 'label_block' => true,
111
- 'dynamic' => [
112
- 'active' => true,
113
- ],
114
- ]
115
- );
116
-
117
- $repeater->add_control(
118
- 'testimonial_text',
119
- [
120
-
121
- 'label' => __('Testimonials Text', 'livemesh-el-addons'),
122
- 'type' => Controls_Manager::WYSIWYG,
123
- 'description' => __('What your customer/client had to say', 'livemesh-el-addons'),
124
- 'show_label' => false,
125
- 'dynamic' => [
126
- 'active' => true,
127
- ],
128
- ]
129
- );
130
-
131
- $this->add_control(
132
- 'testimonials',
133
- [
134
- 'label' => __('Testimonials', 'livemesh-el-addons'),
135
- 'type' => Controls_Manager::REPEATER,
136
- 'default' => [
137
- [
138
- 'client_name' => __('Customer #1', 'livemesh-el-addons'),
139
- 'credentials' => __('CEO, Invision Inc.', 'livemesh-el-addons'),
140
- 'testimonial_text' => __('I am testimonial text. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons'),
141
- ],
142
- [
143
- 'client_name' => __('Customer #2', 'livemesh-el-addons'),
144
- 'credentials' => __('Lead Developer, Automattic Inc', 'livemesh-el-addons'),
145
- 'testimonial_text' => __('I am testimonial text. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons'),
146
- ],
147
- [
148
- 'client_name' => __('Customer #3', 'livemesh-el-addons'),
149
- 'credentials' => __('Store Manager, Walmart Inc', 'livemesh-el-addons'),
150
- 'testimonial_text' => __('I am testimonial text. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons'),
151
- ],
152
- ],
153
- 'fields' => $repeater->get_controls(),
154
- 'title_field' => '{{{ client_name }}}',
155
- ]
156
- );
157
-
158
  $this->end_controls_section();
159
-
160
- $this->start_controls_section(
161
- 'section_settings',
162
- [
163
- 'label' => __('Slider Settings', 'livemesh-el-addons'),
164
- 'tab' => Controls_Manager::TAB_SETTINGS,
165
- ]
166
- );
167
-
168
- $this->add_control(
169
- 'slide_animation',
170
- [
171
- 'label' => __('Animation', 'livemesh-el-addons'),
172
- 'type' => Controls_Manager::SELECT,
173
- 'default' => 'slide',
174
- 'options' => [
175
- 'slide' => __('Slide', 'livemesh-el-addons'),
176
- 'fade' => __('Fade', 'livemesh-el-addons'),
177
- ],
178
- ]
179
- );
180
-
181
- $this->add_control(
182
- 'direction',
183
- [
184
- 'label' => __('Direction', 'livemesh-el-addons'),
185
- 'type' => Controls_Manager::SELECT,
186
- 'default' => 'horizontal',
187
- 'options' => [
188
- 'horizontal' => __('Horizontal', 'livemesh-el-addons'),
189
- 'vertical' => __('Vertical', 'livemesh-el-addons'),
190
- ],
191
- ]
192
- );
193
-
194
- $this->add_control(
195
- 'slideshow_speed',
196
- [
197
- 'label' => __('Slideshow Speed', 'livemesh-el-addons'),
198
- 'type' => Controls_Manager::NUMBER,
199
- 'default' => 5000,
200
- ]
201
- );
202
-
203
-
204
- $this->add_control(
205
- 'animation_speed',
206
- [
207
- 'label' => __('Animation Speed', 'livemesh-el-addons'),
208
- 'type' => Controls_Manager::NUMBER,
209
- 'default' => 600,
210
- ]
211
- );
212
-
213
- $this->add_control(
214
- 'pause_on_hover',
215
- [
216
- 'type' => Controls_Manager::SWITCHER,
217
- 'label_off' => __('No', 'livemesh-el-addons'),
218
- 'label_on' => __('Yes', 'livemesh-el-addons'),
219
- 'return_value' => 'yes',
220
- 'separator' => 'before',
221
- 'default' => 'yes',
222
- 'label' => __('Pause on Hover?', 'livemesh-el-addons'),
223
- 'description' => __('Should the slider pause on mouse hover over the slider.', 'livemesh-el-addons'),
224
- ]
225
- );
226
-
227
- $this->add_control(
228
- 'pause_on_action',
229
- [
230
- 'type' => Controls_Manager::SWITCHER,
231
- 'label_off' => __('No', 'livemesh-el-addons'),
232
- 'label_on' => __('Yes', 'livemesh-el-addons'),
233
- 'return_value' => 'yes',
234
- 'default' => 'no',
235
- 'label' => __('Pause slider on action?', 'livemesh-el-addons'),
236
- 'description' => __('Should the slideshow pause once user initiates an action using navigation/direction controls.', 'livemesh-el-addons'),
237
- ]
238
- );
239
-
240
- $this->add_control(
241
- 'smooth_height',
242
- [
243
- 'type' => Controls_Manager::SWITCHER,
244
- 'label_off' => __('No', 'livemesh-el-addons'),
245
- 'label_on' => __('Yes', 'livemesh-el-addons'),
246
- 'return_value' => 'yes',
247
- 'default' => 'no',
248
- 'label' => __('Smooth Height?', 'livemesh-el-addons'),
249
- 'description' => __('Animate the height of the slider smoothly for slides of varying height.', 'livemesh-el-addons'),
250
- ]
251
- );
252
-
253
- $this->add_control(
254
- 'direction_nav',
255
- [
256
- 'type' => Controls_Manager::SWITCHER,
257
- 'label_off' => __('No', 'livemesh-el-addons'),
258
- 'label_on' => __('Yes', 'livemesh-el-addons'),
259
- 'return_value' => 'yes',
260
- 'separator' => 'before',
261
- 'default' => 'yes',
262
- 'label' => __('Direction Navigation?', 'livemesh-el-addons'),
263
- 'description' => __('Should the slider have direction navigation?', 'livemesh-el-addons'),
264
- ]
265
- );
266
-
267
-
268
- $this->add_control(
269
- 'control_nav',
270
- [
271
- 'type' => Controls_Manager::SWITCHER,
272
- 'label_off' => __('No', 'livemesh-el-addons'),
273
- 'label_on' => __('Yes', 'livemesh-el-addons'),
274
- 'return_value' => 'yes',
275
- 'default' => 'no',
276
- 'label' => __('Navigation Controls?', 'livemesh-el-addons'),
277
- 'description' => __('Should the slider have navigation controls?', 'livemesh-el-addons'),
278
- ]
279
- );
280
-
281
  $this->end_controls_section();
282
-
283
- $this->start_controls_section(
284
- 'section_testimonials_thumbnail',
285
- [
286
- 'label' => __('Author Thumbnail', 'livemesh-el-addons'),
287
- 'tab' => Controls_Manager::TAB_STYLE,
288
- 'show_label' => false,
289
- ]
290
- );
291
-
292
- $this->add_control(
293
- 'thumbnail_border_radius',
294
- [
295
- 'label' => __('Author Thumbnail Border Radius', 'livemesh-el-addons'),
296
- 'type' => Controls_Manager::DIMENSIONS,
297
- 'size_units' => ['px', '%'],
298
- 'selectors' => [
299
- '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-user .lae-image-wrapper img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
300
- ],
301
- ]
302
- );
303
-
304
- $this->add_control(
305
- 'thumbnail_size',
306
- [
307
- 'label' => __('Author Thumbnail Size', 'livemesh-el-addons'),
308
- 'type' => Controls_Manager::SLIDER,
309
- 'size_units' => ['%', 'px'],
310
- 'range' => [
311
- '%' => [
312
- 'min' => 10,
313
- 'max' => 100,
314
- ],
315
- 'px' => [
316
- 'min' => 50,
317
- 'max' => 300,
318
- ],
319
- ],
320
- 'selectors' => [
321
- '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-user .lae-image-wrapper img' => 'max-width: {{SIZE}}{{UNIT}};',
322
- ],
323
- ]
324
- );
325
-
326
  $this->end_controls_section();
327
-
328
- $this->start_controls_section(
329
- 'section_testimonials_text',
330
- [
331
- 'label' => __('Author Testimonial', 'livemesh-el-addons'),
332
- 'tab' => Controls_Manager::TAB_STYLE,
333
- ]
334
- );
335
-
336
- $this->add_control(
337
- 'text_color',
338
- [
339
- 'label' => __('Color', 'livemesh-el-addons'),
340
- 'type' => Controls_Manager::COLOR,
341
- 'selectors' => [
342
- '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-text' => 'color: {{VALUE}};',
343
- ],
344
- ]
345
- );
346
-
347
- $this->add_group_control(
348
- Group_Control_Typography::get_type(),
349
- [
350
- 'name' => 'text_typography',
351
- 'selector' => '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-text',
352
- ]
353
- );
354
-
355
  $this->end_controls_section();
356
-
357
- $this->start_controls_section(
358
- 'section_testimonials_author_name',
359
- [
360
- 'label' => __('Author Name', 'livemesh-el-addons'),
361
- 'tab' => Controls_Manager::TAB_STYLE,
362
- ]
363
- );
364
-
365
-
366
- $this->add_control(
367
- 'title_tag',
368
- [
369
- 'label' => __('Title HTML Tag', 'livemesh-el-addons'),
370
- 'type' => Controls_Manager::SELECT,
371
- 'options' => [
372
- 'h1' => __('H1', 'livemesh-el-addons'),
373
- 'h2' => __('H2', 'livemesh-el-addons'),
374
- 'h3' => __('H3', 'livemesh-el-addons'),
375
- 'h4' => __('H4', 'livemesh-el-addons'),
376
- 'h5' => __('H5', 'livemesh-el-addons'),
377
- 'h6' => __('H6', 'livemesh-el-addons'),
378
- 'div' => __('div', 'livemesh-el-addons'),
379
- ],
380
- 'default' => 'h4',
381
- ]
382
- );
383
-
384
- $this->add_control(
385
- 'title_color',
386
- [
387
- 'label' => __('Color', 'livemesh-el-addons'),
388
- 'type' => Controls_Manager::COLOR,
389
- 'selectors' => [
390
- '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-user .lae-text .lae-author-name' => 'color: {{VALUE}};',
391
- ],
392
- ]
393
- );
394
-
395
- $this->add_group_control(
396
- Group_Control_Typography::get_type(),
397
- [
398
- 'name' => 'title_typography',
399
- 'selector' => '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-user .lae-text .lae-author-name',
400
- ]
401
- );
402
-
403
  $this->end_controls_section();
404
-
405
- $this->start_controls_section(
406
- 'section_testimonials_author_credentials',
407
- [
408
- 'label' => __('Author Credentials', 'livemesh-el-addons'),
409
- 'tab' => Controls_Manager::TAB_STYLE,
410
- ]
411
- );
412
-
413
- $this->add_control(
414
- 'credential_color',
415
- [
416
- 'label' => __('Color', 'livemesh-el-addons'),
417
- 'type' => Controls_Manager::COLOR,
418
- 'selectors' => [
419
- '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-user .lae-text' => 'color: {{VALUE}};',
420
- ],
421
- ]
422
- );
423
-
424
- $this->add_group_control(
425
- Group_Control_Typography::get_type(),
426
- [
427
- 'name' => 'credential_typography',
428
- 'selector' => '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-user .lae-text',
429
- ]
430
- );
431
-
432
-
433
  $this->end_controls_section();
434
-
435
- $this->start_controls_section(
436
- 'section_quote_icon_styling',
437
- [
438
- 'label' => __('Quote Icon', 'livemesh-el-addons'),
439
- 'tab' => Controls_Manager::TAB_STYLE,
440
- ]
441
- );
442
-
443
- $this->add_control(
444
- 'quote_icon_size',
445
- [
446
- 'label' => __('Icon size in pixels', 'livemesh-el-addons'),
447
- 'type' => Controls_Manager::SLIDER,
448
- 'size_units' => ['px', '%', 'em'],
449
- 'range' => [
450
- 'px' => [
451
- 'min' => 10,
452
- 'max' => 128,
453
- ],
454
- ],
455
- 'selectors' => [
456
- '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-text i' => 'font-size: {{SIZE}}{{UNIT}};'
457
- ],
458
- ]
459
- );
460
-
461
- $this->add_control(
462
- 'quote_icon_color',
463
- [
464
- 'label' => __('Icon Color', 'livemesh-el-addons'),
465
- 'type' => Controls_Manager::COLOR,
466
- 'default' => '',
467
- 'selectors' => [
468
- '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-text i' => 'color: {{VALUE}};',
469
- ],
470
- ]
471
- );
472
-
473
  $this->end_controls_section();
474
-
475
-
476
  }
477
-
478
- protected function render() {
479
-
480
  $settings = $this->get_settings_for_display();
481
-
482
  $settings['slider_id'] = $this->get_id();
483
-
484
- $settings = apply_filters('lae_testimonials_slider_' . $this->get_id() . '_settings', $settings);
485
-
486
  $args['settings'] = $settings;
487
-
488
  $args['widget_instance'] = $this;
489
-
490
- lae_get_template_part('addons/testimonials-slider/loop', $args);
491
-
492
  }
493
-
494
- protected function content_template() {
 
495
  }
496
 
497
  }
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
 
9
  namespace LivemeshAddons\Widgets;
10
 
11
+ use Elementor\Repeater ;
12
+ use Elementor\Controls_Manager ;
13
+ use Elementor\Utils ;
14
+ use Elementor\Scheme_Color ;
15
+ use Elementor\Group_Control_Typography ;
16
+ use Elementor\Scheme_Typography ;
17
+ if ( !defined( 'ABSPATH' ) ) {
18
+ exit;
19
+ }
20
+ // Exit if accessed directly
21
+ class LAE_Testimonials_Slider_Widget extends LAE_Widget_Base
22
+ {
23
+ public function get_name()
24
+ {
25
  return 'lae-testimonials-slider';
26
  }
27
+
28
+ public function get_title()
29
+ {
30
+ return __( 'Testimonials Slider', 'livemesh-el-addons' );
31
  }
32
+
33
+ public function get_icon()
34
+ {
35
  return 'lae-icon-testimonials1';
36
  }
37
+
38
+ public function get_categories()
39
+ {
40
+ return array( 'livemesh-addons' );
41
  }
42
+
43
+ public function get_custom_help_url()
44
+ {
45
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/testimonials-addons/';
46
  }
47
+
48
+ public function get_script_depends()
49
+ {
50
+ return [ 'jquery-flexslider', 'lae-frontend-scripts', 'lae-testimonials-slider-scripts' ];
 
 
 
51
  }
52
+
53
+ public function get_style_depends()
54
+ {
55
  return [
56
  'lae-icomoon-styles',
57
  'lae-flexslider-styles',
60
  'lae-testimonials-slider-styles'
61
  ];
62
  }
63
+
64
+ protected function _register_controls()
65
+ {
66
+ $this->start_controls_section( 'section_testimonials_slider', [
67
+ 'label' => __( 'Testimonials Slider', 'livemesh-el-addons' ),
68
+ ] );
 
 
 
 
69
  $repeater = new Repeater();
70
+ $repeater->add_control( 'client_name', [
71
+ 'label' => __( 'Name', 'livemesh-el-addons' ),
72
+ 'type' => Controls_Manager::TEXT,
73
+ 'default' => __( 'My client name', 'livemesh-el-addons' ),
74
+ 'description' => __( 'The client or customer name for the testimonial', 'livemesh-el-addons' ),
75
+ 'dynamic' => [
76
+ 'active' => true,
77
+ ],
78
+ ] );
79
+ $repeater->add_control( 'credentials', [
80
+ 'label' => __( 'Client Details', 'livemesh-el-addons' ),
81
+ 'type' => Controls_Manager::TEXT,
82
+ 'description' => __( 'The details of the client/customer like company name, position held, company URL etc. HTML accepted.', 'livemesh-el-addons' ),
83
+ 'dynamic' => [
84
+ 'active' => true,
85
+ ],
86
+ ] );
87
+ $repeater->add_control( 'client_image', [
88
+ 'label' => __( 'Customer/Client Image', 'livemesh-el-addons' ),
89
+ 'type' => Controls_Manager::MEDIA,
90
+ 'default' => [
91
+ 'url' => Utils::get_placeholder_image_src(),
92
+ ],
93
+ 'label_block' => true,
94
+ 'dynamic' => [
95
+ 'active' => true,
96
+ ],
97
+ ] );
98
+ $repeater->add_control( 'testimonial_text', [
99
+ 'label' => __( 'Testimonials Text', 'livemesh-el-addons' ),
100
+ 'type' => Controls_Manager::WYSIWYG,
101
+ 'description' => __( 'What your customer/client had to say', 'livemesh-el-addons' ),
102
+ 'show_label' => false,
103
+ 'dynamic' => [
104
+ 'active' => true,
105
+ ],
106
+ ] );
107
+ $this->add_control( 'testimonials', [
108
+ 'label' => __( 'Testimonials', 'livemesh-el-addons' ),
109
+ 'type' => Controls_Manager::REPEATER,
110
+ 'default' => [ [
111
+ 'client_name' => __( 'Customer #1', 'livemesh-el-addons' ),
112
+ 'credentials' => __( 'CEO, Invision Inc.', 'livemesh-el-addons' ),
113
+ 'testimonial_text' => __( 'I am testimonial text. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons' ),
114
+ ], [
115
+ 'client_name' => __( 'Customer #2', 'livemesh-el-addons' ),
116
+ 'credentials' => __( 'Lead Developer, Automattic Inc', 'livemesh-el-addons' ),
117
+ 'testimonial_text' => __( 'I am testimonial text. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons' ),
118
+ ], [
119
+ 'client_name' => __( 'Customer #3', 'livemesh-el-addons' ),
120
+ 'credentials' => __( 'Store Manager, Walmart Inc', 'livemesh-el-addons' ),
121
+ 'testimonial_text' => __( 'I am testimonial text. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons' ),
122
+ ] ],
123
+ 'fields' => $repeater->get_controls(),
124
+ 'title_field' => '{{{ client_name }}}',
125
+ ] );
126
+ $this->add_control( 'upgrade_notice', [
127
+ 'type' => Controls_Manager::RAW_HTML,
128
+ 'separator' => 'before',
129
+ 'raw' => '<div style="text-align:center;line-height:1.6;"><p>' . __( 'Unlock new possibilities with premium widgets and styles of <strong>Livemesh Addons for Elementor <i>Premium</i></strong>. ', 'livemesh-el-addons' ) . '</p><p style="padding-top:15px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://livemeshelementor.com/pricing/#pricing-plans" target="_blank"><i class="fa fa-hand-o-right" aria-hidden="true"></i>' . __( 'Go Pro', 'livemesh-el-addons' ) . '</a></p></div>',
130
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  $this->end_controls_section();
132
+ $this->start_controls_section( 'section_settings', [
133
+ 'label' => __( 'Slider Settings', 'livemesh-el-addons' ),
134
+ 'tab' => Controls_Manager::TAB_SETTINGS,
135
+ ] );
136
+ $this->add_control( 'slide_animation', [
137
+ 'label' => __( 'Animation', 'livemesh-el-addons' ),
138
+ 'type' => Controls_Manager::SELECT,
139
+ 'default' => 'slide',
140
+ 'options' => [
141
+ 'slide' => __( 'Slide', 'livemesh-el-addons' ),
142
+ 'fade' => __( 'Fade', 'livemesh-el-addons' ),
143
+ ],
144
+ ] );
145
+ $this->add_control( 'direction', [
146
+ 'label' => __( 'Direction', 'livemesh-el-addons' ),
147
+ 'type' => Controls_Manager::SELECT,
148
+ 'default' => 'horizontal',
149
+ 'options' => [
150
+ 'horizontal' => __( 'Horizontal', 'livemesh-el-addons' ),
151
+ 'vertical' => __( 'Vertical', 'livemesh-el-addons' ),
152
+ ],
153
+ ] );
154
+ $this->add_control( 'slideshow_speed', [
155
+ 'label' => __( 'Slideshow Speed', 'livemesh-el-addons' ),
156
+ 'type' => Controls_Manager::NUMBER,
157
+ 'default' => 5000,
158
+ ] );
159
+ $this->add_control( 'animation_speed', [
160
+ 'label' => __( 'Animation Speed', 'livemesh-el-addons' ),
161
+ 'type' => Controls_Manager::NUMBER,
162
+ 'default' => 600,
163
+ ] );
164
+ $this->add_control( 'pause_on_hover', [
165
+ 'type' => Controls_Manager::SWITCHER,
166
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
167
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
168
+ 'return_value' => 'yes',
169
+ 'separator' => 'before',
170
+ 'default' => 'yes',
171
+ 'label' => __( 'Pause on Hover?', 'livemesh-el-addons' ),
172
+ 'description' => __( 'Should the slider pause on mouse hover over the slider.', 'livemesh-el-addons' ),
173
+ ] );
174
+ $this->add_control( 'pause_on_action', [
175
+ 'type' => Controls_Manager::SWITCHER,
176
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
177
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
178
+ 'return_value' => 'yes',
179
+ 'default' => 'no',
180
+ 'label' => __( 'Pause slider on action?', 'livemesh-el-addons' ),
181
+ 'description' => __( 'Should the slideshow pause once user initiates an action using navigation/direction controls.', 'livemesh-el-addons' ),
182
+ ] );
183
+ $this->add_control( 'smooth_height', [
184
+ 'type' => Controls_Manager::SWITCHER,
185
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
186
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
187
+ 'return_value' => 'yes',
188
+ 'default' => 'no',
189
+ 'label' => __( 'Smooth Height?', 'livemesh-el-addons' ),
190
+ 'description' => __( 'Animate the height of the slider smoothly for slides of varying height.', 'livemesh-el-addons' ),
191
+ ] );
192
+ $this->add_control( 'direction_nav', [
193
+ 'type' => Controls_Manager::SWITCHER,
194
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
195
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
196
+ 'return_value' => 'yes',
197
+ 'separator' => 'before',
198
+ 'default' => 'yes',
199
+ 'label' => __( 'Direction Navigation?', 'livemesh-el-addons' ),
200
+ 'description' => __( 'Should the slider have direction navigation?', 'livemesh-el-addons' ),
201
+ ] );
202
+ $this->add_control( 'control_nav', [
203
+ 'type' => Controls_Manager::SWITCHER,
204
+ 'label_off' => __( 'No', 'livemesh-el-addons' ),
205
+ 'label_on' => __( 'Yes', 'livemesh-el-addons' ),
206
+ 'return_value' => 'yes',
207
+ 'default' => 'no',
208
+ 'label' => __( 'Navigation Controls?', 'livemesh-el-addons' ),
209
+ 'description' => __( 'Should the slider have navigation controls?', 'livemesh-el-addons' ),
210
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
  $this->end_controls_section();
212
+ $this->start_controls_section( 'section_testimonials_thumbnail', [
213
+ 'label' => __( 'Author Thumbnail', 'livemesh-el-addons' ),
214
+ 'tab' => Controls_Manager::TAB_STYLE,
215
+ 'show_label' => false,
216
+ ] );
217
+ $this->add_control( 'thumbnail_border_radius', [
218
+ 'label' => __( 'Author Thumbnail Border Radius', 'livemesh-el-addons' ),
219
+ 'type' => Controls_Manager::DIMENSIONS,
220
+ 'size_units' => [ 'px', '%' ],
221
+ 'selectors' => [
222
+ '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-user .lae-image-wrapper img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
223
+ ],
224
+ ] );
225
+ $this->add_control( 'thumbnail_size', [
226
+ 'label' => __( 'Author Thumbnail Size', 'livemesh-el-addons' ),
227
+ 'type' => Controls_Manager::SLIDER,
228
+ 'size_units' => [ '%', 'px' ],
229
+ 'range' => [
230
+ '%' => [
231
+ 'min' => 10,
232
+ 'max' => 100,
233
+ ],
234
+ 'px' => [
235
+ 'min' => 50,
236
+ 'max' => 300,
237
+ ],
238
+ ],
239
+ 'selectors' => [
240
+ '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-user .lae-image-wrapper img' => 'max-width: {{SIZE}}{{UNIT}};',
241
+ ],
242
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  $this->end_controls_section();
244
+ $this->start_controls_section( 'section_testimonials_text', [
245
+ 'label' => __( 'Author Testimonial', 'livemesh-el-addons' ),
246
+ 'tab' => Controls_Manager::TAB_STYLE,
247
+ ] );
248
+ $this->add_control( 'text_color', [
249
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
250
+ 'type' => Controls_Manager::COLOR,
251
+ 'selectors' => [
252
+ '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-text' => 'color: {{VALUE}};',
253
+ ],
254
+ ] );
255
+ $this->add_group_control( Group_Control_Typography::get_type(), [
256
+ 'name' => 'text_typography',
257
+ 'selector' => '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-text',
258
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  $this->end_controls_section();
260
+ $this->start_controls_section( 'section_testimonials_author_name', [
261
+ 'label' => __( 'Author Name', 'livemesh-el-addons' ),
262
+ 'tab' => Controls_Manager::TAB_STYLE,
263
+ ] );
264
+ $this->add_control( 'title_tag', [
265
+ 'label' => __( 'Title HTML Tag', 'livemesh-el-addons' ),
266
+ 'type' => Controls_Manager::SELECT,
267
+ 'options' => [
268
+ 'h1' => __( 'H1', 'livemesh-el-addons' ),
269
+ 'h2' => __( 'H2', 'livemesh-el-addons' ),
270
+ 'h3' => __( 'H3', 'livemesh-el-addons' ),
271
+ 'h4' => __( 'H4', 'livemesh-el-addons' ),
272
+ 'h5' => __( 'H5', 'livemesh-el-addons' ),
273
+ 'h6' => __( 'H6', 'livemesh-el-addons' ),
274
+ 'div' => __( 'div', 'livemesh-el-addons' ),
275
+ ],
276
+ 'default' => 'h4',
277
+ ] );
278
+ $this->add_control( 'title_color', [
279
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
280
+ 'type' => Controls_Manager::COLOR,
281
+ 'selectors' => [
282
+ '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-user .lae-text .lae-author-name' => 'color: {{VALUE}};',
283
+ ],
284
+ ] );
285
+ $this->add_group_control( Group_Control_Typography::get_type(), [
286
+ 'name' => 'title_typography',
287
+ 'selector' => '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-user .lae-text .lae-author-name',
288
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
289
  $this->end_controls_section();
290
+ $this->start_controls_section( 'section_testimonials_author_credentials', [
291
+ 'label' => __( 'Author Credentials', 'livemesh-el-addons' ),
292
+ 'tab' => Controls_Manager::TAB_STYLE,
293
+ ] );
294
+ $this->add_control( 'credential_color', [
295
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
296
+ 'type' => Controls_Manager::COLOR,
297
+ 'selectors' => [
298
+ '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-user .lae-text' => 'color: {{VALUE}};',
299
+ ],
300
+ ] );
301
+ $this->add_group_control( Group_Control_Typography::get_type(), [
302
+ 'name' => 'credential_typography',
303
+ 'selector' => '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-user .lae-text',
304
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
305
  $this->end_controls_section();
306
+ $this->start_controls_section( 'section_quote_icon_styling', [
307
+ 'label' => __( 'Quote Icon', 'livemesh-el-addons' ),
308
+ 'tab' => Controls_Manager::TAB_STYLE,
309
+ ] );
310
+ $this->add_control( 'quote_icon_size', [
311
+ 'label' => __( 'Icon size in pixels', 'livemesh-el-addons' ),
312
+ 'type' => Controls_Manager::SLIDER,
313
+ 'size_units' => [ 'px', '%', 'em' ],
314
+ 'range' => [
315
+ 'px' => [
316
+ 'min' => 10,
317
+ 'max' => 128,
318
+ ],
319
+ ],
320
+ 'selectors' => [
321
+ '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-text i' => 'font-size: {{SIZE}}{{UNIT}};',
322
+ ],
323
+ ] );
324
+ $this->add_control( 'quote_icon_color', [
325
+ 'label' => __( 'Icon Color', 'livemesh-el-addons' ),
326
+ 'type' => Controls_Manager::COLOR,
327
+ 'default' => '',
328
+ 'selectors' => [
329
+ '{{WRAPPER}} .lae-testimonials-slider .lae-testimonial-text i' => 'color: {{VALUE}};',
330
+ ],
331
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  $this->end_controls_section();
 
 
333
  }
334
+
335
+ protected function render()
336
+ {
337
  $settings = $this->get_settings_for_display();
 
338
  $settings['slider_id'] = $this->get_id();
339
+ $settings = apply_filters( 'lae_testimonials_slider_' . $this->get_id() . '_settings', $settings );
 
 
340
  $args['settings'] = $settings;
 
341
  $args['widget_instance'] = $this;
342
+ lae_get_template_part( 'addons/testimonials-slider/loop', $args );
 
 
343
  }
344
+
345
+ protected function content_template()
346
+ {
347
  }
348
 
349
  }
includes/widgets/testimonials.php CHANGED
@@ -6,498 +6,358 @@ Description: Display testimonials from your clients/customers in a multi-column
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
9
-
10
  namespace LivemeshAddons\Widgets;
11
 
12
- use Elementor\Repeater;
13
- use Elementor\Widget_Base;
14
- use Elementor\Controls_Manager;
15
- use Elementor\Utils;
16
- use Elementor\Scheme_Color;
17
- use Elementor\Group_Control_Typography;
18
- use Elementor\Scheme_Typography;
19
-
20
- if (!defined('ABSPATH'))
21
- exit; // Exit if accessed directly
22
-
23
-
24
- class LAE_Testimonials_Widget extends LAE_Widget_Base {
25
-
26
- public function get_name() {
27
  return 'lae-testimonials';
28
  }
29
-
30
- public function get_title() {
31
- return __('Testimonials', 'livemesh-el-addons');
 
32
  }
33
-
34
- public function get_icon() {
 
35
  return 'lae-icon-testimonials3';
36
  }
37
-
38
- public function get_categories() {
39
- return array('livemesh-addons');
 
40
  }
41
-
42
- public function get_custom_help_url() {
 
43
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/testimonials-addons/';
44
  }
45
-
46
- public function get_script_depends() {
47
- return [
48
- 'lae-waypoints',
49
- 'lae-frontend-scripts'
50
- ];
51
  }
52
-
53
- public function get_style_depends() {
54
- return [
55
- 'lae-animate-styles',
56
- 'lae-frontend-styles',
57
- 'lae-testimonials-styles'
58
- ];
59
  }
60
-
61
- protected function _register_controls() {
62
-
63
- $this->start_controls_section(
64
- 'section_testimonials',
65
- [
66
- 'label' => __('Testimonials', 'livemesh-el-addons'),
67
- ]
68
- );
69
-
70
  $repeater = new Repeater();
71
-
72
- $repeater->add_control(
73
- 'client_name',
74
- [
75
-
76
- 'label' => __('Name', 'livemesh-el-addons'),
77
- 'type' => Controls_Manager::TEXT,
78
- 'default' => __('My client name', 'livemesh-el-addons'),
79
- 'description' => __('The client or customer name for the testimonial', 'livemesh-el-addons'),
80
- 'dynamic' => [
81
- 'active' => true,
82
- ],
83
- ]
84
- );
85
-
86
- $repeater->add_control(
87
- 'credentials',
88
- [
89
-
90
- 'label' => __('Client Details', 'livemesh-el-addons'),
91
- 'type' => Controls_Manager::TEXT,
92
- 'description' => __('The details of the client/customer like company name, credential held, company URL etc. HTML accepted.', 'livemesh-el-addons'),
93
- 'dynamic' => [
94
- 'active' => true,
95
- ],
96
- ]
97
- );
98
-
99
- $repeater->add_control(
100
- 'client_image',
101
- [
102
-
103
- 'label' => __('Customer/Client Image', 'livemesh-el-addons'),
104
- 'type' => Controls_Manager::MEDIA,
105
- 'default' => [
106
- 'url' => Utils::get_placeholder_image_src(),
107
- ],
108
- 'label_block' => true,
109
- 'dynamic' => [
110
- 'active' => true,
111
- ],
112
- ]
113
- );
114
-
115
- $repeater->add_control(
116
- 'testimonial_text',
117
- [
118
-
119
- 'label' => __('Testimonials Text', 'livemesh-el-addons'),
120
- 'type' => Controls_Manager::WYSIWYG,
121
- 'description' => __('What your customer/client had to say', 'livemesh-el-addons'),
122
- 'show_label' => false,
123
- 'dynamic' => [
124
- 'active' => true,
125
- ],
126
- ]
127
- );
128
-
129
- $repeater->add_control(
130
- "widget_animation",
131
- [
132
- "type" => Controls_Manager::SELECT,
133
-
134
- "label" => __("Animation Type", "livemesh-el-addons"),
135
- 'options' => lae_get_animation_options(),
136
- 'default' => 'none',
137
- 'dynamic' => [
138
- 'active' => true,
139
- ],
140
- ]
141
- );
142
-
143
- $this->add_control(
144
- 'testimonials',
145
- [
146
- 'label' => __('Testimonials', 'livemesh-el-addons'),
147
- 'type' => Controls_Manager::REPEATER,
148
- 'separator' => 'before',
149
- 'default' => [
150
- [
151
- 'client_name' => __('Customer #1', 'livemesh-el-addons'),
152
- 'credentials' => __('CEO, Invision Inc.', 'livemesh-el-addons'),
153
- 'testimonial_text' => __('I am testimonial text. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons'),
154
- ],
155
- [
156
- 'client_name' => __('Customer #2', 'livemesh-el-addons'),
157
- 'credentials' => __('Lead Developer, Automattic Inc', 'livemesh-el-addons'),
158
- 'testimonial_text' => __('I am testimonial text. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons'),
159
- ],
160
- [
161
- 'client_name' => __('Customer #3', 'livemesh-el-addons'),
162
- 'credentials' => __('Store Manager, Walmart Inc', 'livemesh-el-addons'),
163
- 'testimonial_text' => __('I am testimonial text. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons'),
164
- ],
165
- ],
166
- 'fields' => $repeater->get_controls(),
167
- 'title_field' => '{{{ client_name }}}',
168
- ]
169
- );
170
-
171
  $this->end_controls_section();
172
-
173
- $this->start_controls_section(
174
- 'section_grid_settings',
175
- [
176
- 'label' => __('Grid Settings', 'livemesh-el-addons'),
177
- 'tab' => Controls_Manager::TAB_SETTINGS,
178
- ]
179
- );
180
-
181
- $this->add_control(
182
- 'column_layout',
183
- [
184
- 'label' => __('Column Layout', 'livemesh-el-addons'),
185
- 'type' => Controls_Manager::SELECT,
186
- 'options' => array(
187
- 'auto' => __('Auto', 'livemesh-el-addons'),
188
- 'custom' => __('Custom', 'livemesh-el-addons'),
189
- ),
190
- 'default' => 'auto',
191
- 'description' => __('Set column layout to be <strong>Auto</strong> to let the widget auto calculate number of columns based on minimum column size specified. The option <strong>Custom</strong> lets you explicitly control number of columns based on screen width.', 'livemesh-el-addons'),
192
- ]
193
- );
194
-
195
- $this->add_control(
196
- 'min_column_size',
197
- [
198
- 'label' => __('Minimum Column Size', 'livemesh-el-addons'),
199
- 'type' => Controls_Manager::SLIDER,
200
- 'size_units' => ['px'],
201
- 'default' => [
202
- 'size' => 300,
203
- ],
204
- 'range' => [
205
- 'px' => [
206
- 'min' => 50,
207
- 'max' => 500,
208
- ],
209
- ],
210
- 'selectors' => [
211
- '{{WRAPPER}} .lae-uber-grid-container.lae-grid-auto-column-layout' => 'grid-template-columns: repeat(auto-fit, minmax({{SIZE}}{{UNIT}}, 1fr));',
212
- ],
213
- 'condition' => [
214
- 'column_layout' => 'auto'
215
- ]
216
- ]
217
- );
218
-
219
- $this->add_responsive_control(
220
- 'per_line',
221
- [
222
- 'label' => __('Columns per row', 'livemesh-el-addons'),
223
- 'type' => Controls_Manager::SELECT,
224
- 'default' => '3',
225
- 'tablet_default' => '2',
226
- 'mobile_default' => '1',
227
- 'options' => [
228
- '1' => '1',
229
- '2' => '2',
230
- '3' => '3',
231
- '4' => '4',
232
- '5' => '5',
233
- '6' => '6',
234
- ],
235
- 'frontend_available' => true,
236
- 'condition' => [
237
- 'column_layout' => 'custom'
238
- ]
239
- ]
240
- );
241
-
242
- $this->add_control(
243
- 'column_gap',
244
- [
245
- 'label' => __('Column Gap', 'livemesh-el-addons'),
246
- 'type' => Controls_Manager::SLIDER,
247
- 'size_units' => ['px'],
248
- 'default' => [
249
- 'size' => 30,
250
- ],
251
- 'range' => [
252
- 'px' => [
253
- 'min' => 0,
254
- 'max' => 100,
255
- ],
256
- ],
257
- 'selectors' => [
258
- '{{WRAPPER}} .lae-uber-grid-container' => 'column-gap: {{SIZE}}{{UNIT}};',
259
- ],
260
- ]
261
- );
262
-
263
- $this->add_control(
264
- 'row_gap',
265
- [
266
- 'label' => __('Row Gap', 'livemesh-el-addons'),
267
- 'type' => Controls_Manager::SLIDER,
268
- 'size_units' => ['px'],
269
- 'default' => [
270
- 'size' => 30,
271
- ],
272
- 'range' => [
273
- 'px' => [
274
- 'min' => 0,
275
- 'max' => 100,
276
- ],
277
- ],
278
- 'selectors' => [
279
- '{{WRAPPER}} .lae-uber-grid-container' => 'row-gap: {{SIZE}}{{UNIT}};',
280
- ],
281
- ]
282
- );
283
-
284
  $this->end_controls_section();
285
-
286
- $this->start_controls_section(
287
- 'section_testimonials_thumbnail',
288
- [
289
- 'label' => __('Author Thumbnail', 'livemesh-el-addons'),
290
- 'tab' => Controls_Manager::TAB_STYLE,
291
- 'show_label' => false,
292
- ]
293
- );
294
-
295
- $this->add_control(
296
- 'thumbnail_border_radius',
297
- [
298
- 'label' => __('Thumbnail Border Radius', 'livemesh-el-addons'),
299
- 'type' => Controls_Manager::DIMENSIONS,
300
- 'size_units' => ['px', '%'],
301
- 'selectors' => [
302
- '{{WRAPPER}} .lae-testimonials .lae-testimonial-user .lae-image-wrapper img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
303
- ],
304
- ]
305
- );
306
-
307
-
308
- $this->add_control(
309
- 'thumbnail_size',
310
- [
311
- 'label' => __('Thumbnail Size', 'livemesh-el-addons'),
312
- 'type' => Controls_Manager::SLIDER,
313
- 'size_units' => ['%', 'px'],
314
- 'range' => [
315
- '%' => [
316
- 'min' => 10,
317
- 'max' => 100,
318
- ],
319
- 'px' => [
320
- 'min' => 50,
321
- 'max' => 156,
322
- ],
323
- ],
324
- 'selectors' => [
325
- '{{WRAPPER}} .lae-testimonials .lae-testimonial-user .lae-image-wrapper img' => 'max-width: {{SIZE}}{{UNIT}};',
326
- ],
327
- ]
328
- );
329
-
330
-
331
  $this->end_controls_section();
332
-
333
- $this->start_controls_section(
334
- 'section_testimonials_text',
335
- [
336
- 'label' => __('Author Testimonial', 'livemesh-el-addons'),
337
- 'tab' => Controls_Manager::TAB_STYLE,
338
- ]
339
- );
340
-
341
-
342
- $this->add_responsive_control(
343
- 'text_padding',
344
- [
345
- 'label' => __('Text Padding', 'livemesh-el-addons'),
346
- 'type' => Controls_Manager::DIMENSIONS,
347
- 'size_units' => ['px', 'em'],
348
- 'selectors' => [
349
- '{{WRAPPER}} .lae-testimonials .lae-testimonial-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
350
- ],
351
- 'isLinked' => false,
352
- ]
353
- );
354
-
355
- $this->add_control(
356
- 'text_color',
357
- [
358
- 'label' => __('Color', 'livemesh-el-addons'),
359
- 'type' => Controls_Manager::COLOR,
360
- 'selectors' => [
361
- '{{WRAPPER}} .lae-testimonials .lae-testimonial-text' => 'color: {{VALUE}};',
362
- ],
363
- ]
364
- );
365
-
366
- $this->add_control(
367
- 'text_border_color',
368
- [
369
- 'label' => __('Border Color', 'livemesh-el-addons'),
370
- 'type' => Controls_Manager::COLOR,
371
- 'selectors' => [
372
- '{{WRAPPER}} .lae-testimonials .lae-testimonial-text, {{WRAPPER}} .lae-testimonials .lae-testimonial-text:after' => 'border-color: {{VALUE}};',
373
- ],
374
- ]
375
- );
376
-
377
-
378
- $this->add_control(
379
- 'text_border_width',
380
- [
381
- 'label' => __('Border Width', 'livemesh-el-addons'),
382
- 'type' => Controls_Manager::SLIDER,
383
- 'range' => [
384
- 'px' => [
385
- 'min' => 1,
386
- 'max' => 5,
387
- ],
388
- ],
389
- 'selectors' => [
390
- '{{WRAPPER}} .lae-testimonials .lae-testimonial-text, {{WRAPPER}} .lae-testimonials .lae-testimonial-text:after' => 'border-width: {{SIZE}}{{UNIT}};',
391
- ],
392
- ]
393
- );
394
-
395
-
396
- $this->add_group_control(
397
- Group_Control_Typography::get_type(),
398
- [
399
- 'name' => 'text_typography',
400
- 'selector' => '{{WRAPPER}} .lae-testimonials .lae-testimonial-text',
401
- ]
402
- );
403
-
404
-
405
  $this->end_controls_section();
406
-
407
- $this->start_controls_section(
408
- 'section_testimonials_author_name',
409
- [
410
- 'label' => __('Author Name', 'livemesh-el-addons'),
411
- 'tab' => Controls_Manager::TAB_STYLE,
412
- ]
413
- );
414
-
415
- $this->add_control(
416
- 'title_tag',
417
- [
418
- 'label' => __('Title HTML Tag', 'livemesh-el-addons'),
419
- 'type' => Controls_Manager::SELECT,
420
- 'options' => [
421
- 'h1' => __('H1', 'livemesh-el-addons'),
422
- 'h2' => __('H2', 'livemesh-el-addons'),
423
- 'h3' => __('H3', 'livemesh-el-addons'),
424
- 'h4' => __('H4', 'livemesh-el-addons'),
425
- 'h5' => __('H5', 'livemesh-el-addons'),
426
- 'h6' => __('H6', 'livemesh-el-addons'),
427
- 'div' => __('div', 'livemesh-el-addons'),
428
- ],
429
- 'default' => 'h4',
430
- ]
431
- );
432
-
433
- $this->add_control(
434
- 'title_color',
435
- [
436
- 'label' => __('Color', 'livemesh-el-addons'),
437
- 'type' => Controls_Manager::COLOR,
438
- 'selectors' => [
439
- '{{WRAPPER}} .lae-testimonials .lae-testimonial-user .lae-text .lae-author-name' => 'color: {{VALUE}};',
440
- ],
441
- ]
442
- );
443
-
444
- $this->add_group_control(
445
- Group_Control_Typography::get_type(),
446
- [
447
- 'name' => 'title_typography',
448
- 'selector' => '{{WRAPPER}} .lae-testimonials .lae-testimonial-user .lae-text .lae-author-name',
449
- ]
450
- );
451
-
452
  $this->end_controls_section();
453
-
454
- $this->start_controls_section(
455
- 'section_testimonials_author_credentials',
456
- [
457
- 'label' => __('Author Credentials', 'livemesh-el-addons'),
458
- 'tab' => Controls_Manager::TAB_STYLE,
459
- ]
460
- );
461
-
462
- $this->add_control(
463
- 'credential_color',
464
- [
465
- 'label' => __('Color', 'livemesh-el-addons'),
466
- 'type' => Controls_Manager::COLOR,
467
- 'selectors' => [
468
- '{{WRAPPER}} .lae-testimonials .lae-testimonial-user .lae-text' => 'color: {{VALUE}};',
469
- ],
470
- ]
471
- );
472
-
473
- $this->add_group_control(
474
- Group_Control_Typography::get_type(),
475
- [
476
- 'name' => 'credential_typography',
477
- 'selector' => '{{WRAPPER}} .lae-testimonials .lae-testimonial-user .lae-text',
478
- ]
479
- );
480
-
481
-
482
  $this->end_controls_section();
483
-
484
  }
485
-
486
- protected function render() {
487
-
488
  $settings = $this->get_settings_for_display();
489
-
490
- $settings = apply_filters('lae_testimonials_' . $this->get_id() . '_settings', $settings);
491
-
492
  $args['settings'] = $settings;
493
-
494
  $args['widget_instance'] = $this;
495
-
496
- lae_get_template_part('addons/testimonials/loop', $args);
497
-
498
  }
499
-
500
- protected function content_template() {
 
501
  }
502
 
503
  }
6
  Author: LiveMesh
7
  Author URI: https://www.livemeshthemes.com
8
  */
 
9
  namespace LivemeshAddons\Widgets;
10
 
11
+ use Elementor\Repeater ;
12
+ use Elementor\Widget_Base ;
13
+ use Elementor\Controls_Manager ;
14
+ use Elementor\Utils ;
15
+ use Elementor\Scheme_Color ;
16
+ use Elementor\Group_Control_Typography ;
17
+ use Elementor\Scheme_Typography ;
18
+ if ( !defined( 'ABSPATH' ) ) {
19
+ exit;
20
+ }
21
+ // Exit if accessed directly
22
+ class LAE_Testimonials_Widget extends LAE_Widget_Base
23
+ {
24
+ public function get_name()
25
+ {
26
  return 'lae-testimonials';
27
  }
28
+
29
+ public function get_title()
30
+ {
31
+ return __( 'Testimonials', 'livemesh-el-addons' );
32
  }
33
+
34
+ public function get_icon()
35
+ {
36
  return 'lae-icon-testimonials3';
37
  }
38
+
39
+ public function get_categories()
40
+ {
41
+ return array( 'livemesh-addons' );
42
  }
43
+
44
+ public function get_custom_help_url()
45
+ {
46
  return 'https://livemeshelementor.com/docs/livemesh-addons/core-addons/testimonials-addons/';
47
  }
48
+
49
+ public function get_script_depends()
50
+ {
51
+ return [ 'lae-waypoints', 'lae-frontend-scripts' ];
 
 
52
  }
53
+
54
+ public function get_style_depends()
55
+ {
56
+ return [ 'lae-animate-styles', 'lae-frontend-styles', 'lae-testimonials-styles' ];
 
 
 
57
  }
58
+
59
+ protected function _register_controls()
60
+ {
61
+ $this->start_controls_section( 'section_testimonials', [
62
+ 'label' => __( 'Testimonials', 'livemesh-el-addons' ),
63
+ ] );
 
 
 
 
64
  $repeater = new Repeater();
65
+ $repeater->add_control( 'client_name', [
66
+ 'label' => __( 'Name', 'livemesh-el-addons' ),
67
+ 'type' => Controls_Manager::TEXT,
68
+ 'default' => __( 'My client name', 'livemesh-el-addons' ),
69
+ 'description' => __( 'The client or customer name for the testimonial', 'livemesh-el-addons' ),
70
+ 'dynamic' => [
71
+ 'active' => true,
72
+ ],
73
+ ] );
74
+ $repeater->add_control( 'credentials', [
75
+ 'label' => __( 'Client Details', 'livemesh-el-addons' ),
76
+ 'type' => Controls_Manager::TEXT,
77
+ 'description' => __( 'The details of the client/customer like company name, credential held, company URL etc. HTML accepted.', 'livemesh-el-addons' ),
78
+ 'dynamic' => [
79
+ 'active' => true,
80
+ ],
81
+ ] );
82
+ $repeater->add_control( 'client_image', [
83
+ 'label' => __( 'Customer/Client Image', 'livemesh-el-addons' ),
84
+ 'type' => Controls_Manager::MEDIA,
85
+ 'default' => [
86
+ 'url' => Utils::get_placeholder_image_src(),
87
+ ],
88
+ 'label_block' => true,
89
+ 'dynamic' => [
90
+ 'active' => true,
91
+ ],
92
+ ] );
93
+ $repeater->add_control( 'testimonial_text', [
94
+ 'label' => __( 'Testimonials Text', 'livemesh-el-addons' ),
95
+ 'type' => Controls_Manager::WYSIWYG,
96
+ 'description' => __( 'What your customer/client had to say', 'livemesh-el-addons' ),
97
+ 'show_label' => false,
98
+ 'dynamic' => [
99
+ 'active' => true,
100
+ ],
101
+ ] );
102
+ $repeater->add_control( "widget_animation", [
103
+ "type" => Controls_Manager::SELECT,
104
+ "label" => __( "Animation Type", "livemesh-el-addons" ),
105
+ 'options' => lae_get_animation_options(),
106
+ 'default' => 'none',
107
+ 'dynamic' => [
108
+ 'active' => true,
109
+ ],
110
+ ] );
111
+ $this->add_control( 'testimonials', [
112
+ 'label' => __( 'Testimonials', 'livemesh-el-addons' ),
113
+ 'type' => Controls_Manager::REPEATER,
114
+ 'separator' => 'before',
115
+ 'default' => [ [
116
+ 'client_name' => __( 'Customer #1', 'livemesh-el-addons' ),
117
+ 'credentials' => __( 'CEO, Invision Inc.', 'livemesh-el-addons' ),
118
+ 'testimonial_text' => __( 'I am testimonial text. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons' ),
119
+ ], [
120
+ 'client_name' => __( 'Customer #2', 'livemesh-el-addons' ),
121
+ 'credentials' => __( 'Lead Developer, Automattic Inc', 'livemesh-el-addons' ),
122
+ 'testimonial_text' => __( 'I am testimonial text. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons' ),
123
+ ], [
124
+ 'client_name' => __( 'Customer #3', 'livemesh-el-addons' ),
125
+ 'credentials' => __( 'Store Manager, Walmart Inc', 'livemesh-el-addons' ),
126
+ 'testimonial_text' => __( 'I am testimonial text. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'livemesh-el-addons' ),
127
+ ] ],
128
+ 'fields' => $repeater->get_controls(),
129
+ 'title_field' => '{{{ client_name }}}',
130
+ ] );
131
+ $this->add_control( 'upgrade_notice', [
132
+ 'type' => Controls_Manager::RAW_HTML,
133
+ 'separator' => 'before',
134
+ 'raw' => '<div style="text-align:center;line-height:1.6;"><p>' . __( 'Unlock new possibilities with premium widgets and styles of <strong>Livemesh Addons for Elementor <i>Premium</i></strong>. ', 'livemesh-el-addons' ) . '</p><p style="padding-top:15px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://livemeshelementor.com/pricing/#pricing-plans" target="_blank"><i class="fa fa-hand-o-right" aria-hidden="true"></i>' . __( 'Go Pro', 'livemesh-el-addons' ) . '</a></p></div>',
135
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  $this->end_controls_section();
137
+ $this->start_controls_section( 'section_grid_settings', [
138
+ 'label' => __( 'Grid Settings', 'livemesh-el-addons' ),
139
+ 'tab' => Controls_Manager::TAB_SETTINGS,
140
+ ] );
141
+ $this->add_control( 'column_layout', [
142
+ 'label' => __( 'Column Layout', 'livemesh-el-addons' ),
143
+ 'type' => Controls_Manager::SELECT,
144
+ 'options' => array(
145
+ 'auto' => __( 'Auto', 'livemesh-el-addons' ),
146
+ 'custom' => __( 'Custom', 'livemesh-el-addons' ),
147
+ ),
148
+ 'default' => 'auto',
149
+ 'description' => __( 'Set column layout to be <strong>Auto</strong> to let the widget auto calculate number of columns based on minimum column size specified. The option <strong>Custom</strong> lets you explicitly control number of columns based on screen width.', 'livemesh-el-addons' ),
150
+ ] );
151
+ $this->add_control( 'min_column_size', [
152
+ 'label' => __( 'Minimum Column Size', 'livemesh-el-addons' ),
153
+ 'type' => Controls_Manager::SLIDER,
154
+ 'size_units' => [ 'px' ],
155
+ 'default' => [
156
+ 'size' => 300,
157
+ ],
158
+ 'range' => [
159
+ 'px' => [
160
+ 'min' => 50,
161
+ 'max' => 500,
162
+ ],
163
+ ],
164
+ 'selectors' => [
165
+ '{{WRAPPER}} .lae-uber-grid-container.lae-grid-auto-column-layout' => 'grid-template-columns: repeat(auto-fit, minmax({{SIZE}}{{UNIT}}, 1fr));',
166
+ ],
167
+ 'condition' => [
168
+ 'column_layout' => 'auto',
169
+ ],
170
+ ] );
171
+ $this->add_responsive_control( 'per_line', [
172
+ 'label' => __( 'Columns per row', 'livemesh-el-addons' ),
173
+ 'type' => Controls_Manager::SELECT,
174
+ 'default' => '3',
175
+ 'tablet_default' => '2',
176
+ 'mobile_default' => '1',
177
+ 'options' => [
178
+ '1' => '1',
179
+ '2' => '2',
180
+ '3' => '3',
181
+ '4' => '4',
182
+ '5' => '5',
183
+ '6' => '6',
184
+ ],
185
+ 'frontend_available' => true,
186
+ 'condition' => [
187
+ 'column_layout' => 'custom',
188
+ ],
189
+ ] );
190
+ $this->add_control( 'column_gap', [
191
+ 'label' => __( 'Column Gap', 'livemesh-el-addons' ),
192
+ 'type' => Controls_Manager::SLIDER,
193
+ 'size_units' => [ 'px' ],
194
+ 'default' => [
195
+ 'size' => 30,
196
+ ],
197
+ 'range' => [
198
+ 'px' => [
199
+ 'min' => 0,
200
+ 'max' => 100,
201
+ ],
202
+ ],
203
+ 'selectors' => [
204
+ '{{WRAPPER}} .lae-uber-grid-container' => 'column-gap: {{SIZE}}{{UNIT}};',
205
+ ],
206
+ ] );
207
+ $this->add_control( 'row_gap', [
208
+ 'label' => __( 'Row Gap', 'livemesh-el-addons' ),
209
+ 'type' => Controls_Manager::SLIDER,
210
+ 'size_units' => [ 'px' ],
211
+ 'default' => [
212
+ 'size' => 30,
213
+ ],
214
+ 'range' => [
215
+ 'px' => [
216
+ 'min' => 0,
217
+ 'max' => 100,
218
+ ],
219
+ ],
220
+ 'selectors' => [
221
+ '{{WRAPPER}} .lae-uber-grid-container' => 'row-gap: {{SIZE}}{{UNIT}};',
222
+ ],
223
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  $this->end_controls_section();
225
+ $this->start_controls_section( 'section_testimonials_thumbnail', [
226
+ 'label' => __( 'Author Thumbnail', 'livemesh-el-addons' ),
227
+ 'tab' => Controls_Manager::TAB_STYLE,
228
+ 'show_label' => false,
229
+ ] );
230
+ $this->add_control( 'thumbnail_border_radius', [
231
+ 'label' => __( 'Thumbnail Border Radius', 'livemesh-el-addons' ),
232
+ 'type' => Controls_Manager::DIMENSIONS,
233
+ 'size_units' => [ 'px', '%' ],
234
+ 'selectors' => [
235
+ '{{WRAPPER}} .lae-testimonials .lae-testimonial-user .lae-image-wrapper img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
236
+ ],
237
+ ] );
238
+ $this->add_control( 'thumbnail_size', [
239
+ 'label' => __( 'Thumbnail Size', 'livemesh-el-addons' ),
240
+ 'type' => Controls_Manager::SLIDER,
241
+ 'size_units' => [ '%', 'px' ],
242
+ 'range' => [
243
+ '%' => [
244
+ 'min' => 10,
245
+ 'max' => 100,
246
+ ],
247
+ 'px' => [
248
+ 'min' => 50,
249
+ 'max' => 156,
250
+ ],
251
+ ],
252
+ 'selectors' => [
253
+ '{{WRAPPER}} .lae-testimonials .lae-testimonial-user .lae-image-wrapper img' => 'max-width: {{SIZE}}{{UNIT}};',
254
+ ],
255
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  $this->end_controls_section();
257
+ $this->start_controls_section( 'section_testimonials_text', [
258
+ 'label' => __( 'Author Testimonial', 'livemesh-el-addons' ),
259
+ 'tab' => Controls_Manager::TAB_STYLE,
260
+ ] );
261
+ $this->add_responsive_control( 'text_padding', [
262
+ 'label' => __( 'Text Padding', 'livemesh-el-addons' ),
263
+ 'type' => Controls_Manager::DIMENSIONS,
264
+ 'size_units' => [ 'px', 'em' ],
265
+ 'selectors' => [
266
+ '{{WRAPPER}} .lae-testimonials .lae-testimonial-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
267
+ ],
268
+ 'isLinked' => false,
269
+ ] );
270
+ $this->add_control( 'text_color', [
271
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
272
+ 'type' => Controls_Manager::COLOR,
273
+ 'selectors' => [
274
+ '{{WRAPPER}} .lae-testimonials .lae-testimonial-text' => 'color: {{VALUE}};',
275
+ ],
276
+ ] );
277
+ $this->add_control( 'text_border_color', [
278
+ 'label' => __( 'Border Color', 'livemesh-el-addons' ),
279
+ 'type' => Controls_Manager::COLOR,
280
+ 'selectors' => [
281
+ '{{WRAPPER}} .lae-testimonials .lae-testimonial-text, {{WRAPPER}} .lae-testimonials .lae-testimonial-text:after' => 'border-color: {{VALUE}};',
282
+ ],
283
+ ] );
284
+ $this->add_control( 'text_border_width', [
285
+ 'label' => __( 'Border Width', 'livemesh-el-addons' ),
286
+ 'type' => Controls_Manager::SLIDER,
287
+ 'range' => [
288
+ 'px' => [
289
+ 'min' => 1,
290
+ 'max' => 5,
291
+ ],
292
+ ],
293
+ 'selectors' => [
294
+ '{{WRAPPER}} .lae-testimonials .lae-testimonial-text, {{WRAPPER}} .lae-testimonials .lae-testimonial-text:after' => 'border-width: {{SIZE}}{{UNIT}};',
295
+ ],
296
+ ] );
297
+ $this->add_group_control( Group_Control_Typography::get_type(), [
298
+ 'name' => 'text_typography',
299
+ 'selector' => '{{WRAPPER}} .lae-testimonials .lae-testimonial-text',
300
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
301
  $this->end_controls_section();
302
+ $this->start_controls_section( 'section_testimonials_author_name', [
303
+ 'label' => __( 'Author Name', 'livemesh-el-addons' ),
304
+ 'tab' => Controls_Manager::TAB_STYLE,
305
+ ] );
306
+ $this->add_control( 'title_tag', [
307
+ 'label' => __( 'Title HTML Tag', 'livemesh-el-addons' ),
308
+ 'type' => Controls_Manager::SELECT,
309
+ 'options' => [
310
+ 'h1' => __( 'H1', 'livemesh-el-addons' ),
311
+ 'h2' => __( 'H2', 'livemesh-el-addons' ),
312
+ 'h3' => __( 'H3', 'livemesh-el-addons' ),
313
+ 'h4' => __( 'H4', 'livemesh-el-addons' ),
314
+ 'h5' => __( 'H5', 'livemesh-el-addons' ),
315
+ 'h6' => __( 'H6', 'livemesh-el-addons' ),
316
+ 'div' => __( 'div', 'livemesh-el-addons' ),
317
+ ],
318
+ 'default' => 'h4',
319
+ ] );
320
+ $this->add_control( 'title_color', [
321
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
322
+ 'type' => Controls_Manager::COLOR,
323
+ 'selectors' => [
324
+ '{{WRAPPER}} .lae-testimonials .lae-testimonial-user .lae-text .lae-author-name' => 'color: {{VALUE}};',
325
+ ],
326
+ ] );
327
+ $this->add_group_control( Group_Control_Typography::get_type(), [
328
+ 'name' => 'title_typography',
329
+ 'selector' => '{{WRAPPER}} .lae-testimonials .lae-testimonial-user .lae-text .lae-author-name',
330
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
331
  $this->end_controls_section();
332
+ $this->start_controls_section( 'section_testimonials_author_credentials', [
333
+ 'label' => __( 'Author Credentials', 'livemesh-el-addons' ),
334
+ 'tab' => Controls_Manager::TAB_STYLE,
335
+ ] );
336
+ $this->add_control( 'credential_color', [
337
+ 'label' => __( 'Color', 'livemesh-el-addons' ),
338
+ 'type' => Controls_Manager::COLOR,
339
+ 'selectors' => [
340
+ '{{WRAPPER}} .lae-testimonials .lae-testimonial-user .lae-text' => 'color: {{VALUE}};',
341
+ ],
342
+ ] );
343
+ $this->add_group_control( Group_Control_Typography::get_type(), [
344
+ 'name' => 'credential_typography',
345
+ 'selector' => '{{WRAPPER}} .lae-testimonials .lae-testimonial-user .lae-text',
346
+ ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
347
  $this->end_controls_section();
 
348
  }
349
+
350
+ protected function render()
351
+ {
352
  $settings = $this->get_settings_for_display();
353
+ $settings = apply_filters( 'lae_testimonials_' . $this->get_id() . '_settings', $settings );
 
 
354
  $args['settings'] = $settings;
 
355
  $args['widget_instance'] = $this;
356
+ lae_get_template_part( 'addons/testimonials/loop', $args );
 
 
357
  }
358
+
359
+ protected function content_template()
360
+ {
361
  }
362
 
363
  }
plugin.php CHANGED
@@ -45,7 +45,7 @@ if ( !class_exists( 'Livemesh_Elementor_Addons' ) ) {
45
  public function __clone()
46
  {
47
  // Cloning instances of the class is forbidden
48
- _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'livemesh-el-addons' ), '6.7' );
49
  }
50
 
51
  /**
@@ -55,7 +55,7 @@ if ( !class_exists( 'Livemesh_Elementor_Addons' ) ) {
55
  public function __wakeup()
56
  {
57
  // Unserializing instances of the class is forbidden
58
- _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'livemesh-el-addons' ), '6.7' );
59
  }
60
 
61
  private function setup_debug_constants()
45
  public function __clone()
46
  {
47
  // Cloning instances of the class is forbidden
48
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'livemesh-el-addons' ), '6.7.1' );
49
  }
50
 
51
  /**
55
  public function __wakeup()
56
  {
57
  // Unserializing instances of the class is forbidden
58
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'livemesh-el-addons' ), '6.7.1' );
59
  }
60
 
61
  private function setup_debug_constants()
readme.txt CHANGED
@@ -7,7 +7,7 @@ Tags: elementor, elementor addons, elementor extensions, elementor widgets, page
7
  Requires at least: 4.5
8
  Tested up to: 5.7
9
  Requires PHP: 5.6
10
- Stable Tag: 6.7
11
  License: GPLv3
12
  License URI: https://opensource.org/licenses/GPL-3.0
13
 
@@ -258,6 +258,9 @@ Email us at support[at]livemeshthemes.com and we will be happy to assist you.
258
 
259
 
260
 
 
 
 
261
  = 6.7 =
262
  * Added – New high performance, light-weight yet feature rich grid system for Services, Team Member, Testimonials, Pricing Table, Odometers, Piecharts and Clients Elementor addons.
263
  * Added - Options for specifying auto column layout using minimum column size, column gap and row gap for those addons using the new grid system.
7
  Requires at least: 4.5
8
  Tested up to: 5.7
9
  Requires PHP: 5.6
10
+ Stable Tag: 6.7.1
11
  License: GPLv3
12
  License URI: https://opensource.org/licenses/GPL-3.0
13
 
258
 
259
 
260
 
261
+ = 6.7.1 =
262
+ * Added – Upgrade notice on the addons
263
+
264
  = 6.7 =
265
  * Added – New high performance, light-weight yet feature rich grid system for Services, Team Member, Testimonials, Pricing Table, Odometers, Piecharts and Clients Elementor addons.
266
  * Added - Options for specifying auto column layout using minimum column size, column gap and row gap for those addons using the new grid system.