PluginProbe
King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder / 51.1.37
King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder v51.1.37
51.1.83 51.1.82 51.1.81 51.1.79 51.1.78 51.1.77 51.1.76 51.1.74 51.1.75 51.1.65 51.1.64 51.1.63 trunk 51.1.14 51.1.2 51.1.35 51.1.36 51.1.37 51.1.38 51.1.39 51.1.44 51.1.45 51.1.46 51.1.47 51.1.49 All 37 releases
king-addons / includes / widgets / Magazine_Grid / Magazine_Grid.php

Magazine_Grid.php in King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder 51.1.37, at includes/widgets/Magazine_Grid/Magazine_Grid.php

5,720 lines 205.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace King_Addons;
4
5 use Elementor\Icons_Manager;
6 use Elementor\Widget_Base;
7 use Elementor\Controls_Manager;
8 use Elementor\Group_Control_Box_Shadow;
9 use Elementor\Group_Control_Typography;
10 use Elementor\Group_Control_Background;
11 use Elementor\Repeater;
12 use Elementor\Group_Control_Image_Size;
13 use WP_Query;
14
15 if (!defined('ABSPATH')) {
16 exit;
17 }
18
19 class Magazine_Grid extends Widget_Base
20 {
21
22
23
24 public function get_name()
25 {
26 return 'king-addons-magazine-grid';
27 }
28
29 public function get_title()
30 {
31 return esc_html__('Magazine Grid & Slider/Carousel', 'king-addons');
32 }
33
34 public function get_icon()
35 {
36 return 'king-addons-icon king-addons-magazine-grid';
37 }
38
39 public function get_categories()
40 {
41 return ['king-addons'];
42 }
43
44 public function get_keywords()
45 {
46 return ['king addons', 'king', 'addons', 'kingaddons', 'king-addons', 'blog', 'grid', 'posts', 'magazine', 'masonry',
47 'magazine grid', 'magazine slider', 'isotope', 'slick', 'post tiles', 'posts tiles', 'post', 'journal', 'gr',
48 'tile', 'tiles', 'carousel', 'loop', 'filterable'];
49 }
50
51 public function get_script_depends()
52 {
53 return [
54 KING_ADDONS_ASSETS_UNIQUE_KEY . '-magazine-grid-script',
55 KING_ADDONS_ASSETS_UNIQUE_KEY . '-isotope-kng',
56 KING_ADDONS_ASSETS_UNIQUE_KEY . '-slick-slick',
57 ];
58 }
59
60 public function get_style_depends()
61 {
62 return [
63 KING_ADDONS_ASSETS_UNIQUE_KEY . '-slick-helper',
64 KING_ADDONS_ASSETS_UNIQUE_KEY . '-animation-button',
65 KING_ADDONS_ASSETS_UNIQUE_KEY . '-animation-general',
66 KING_ADDONS_ASSETS_UNIQUE_KEY . '-animation-timing',
67 KING_ADDONS_ASSETS_UNIQUE_KEY . '-animation-loading',
68 KING_ADDONS_ASSETS_UNIQUE_KEY . '-grid-grid',
69 KING_ADDONS_ASSETS_UNIQUE_KEY . '-general-general',
70 ];
71 }
72
73 public function get_custom_help_url()
74 {
75 return 'mailto:bug@kingaddons.com?subject=Bug Report - King Addons&body=Please describe the issue';
76 }
77
78 public function has_widget_inner_wrapper(): bool
79 {
80 return true;
81 }
82
83 public function add_option_query_source()
84 {
85 $post_types = [
86 'post' => esc_html__('Posts', 'king-addons'),
87 'page' => esc_html__('Pages', 'king-addons'),
88 ];
89
90 $excluded_slugs = ['product', 'e-landing-page'];
91 $can_use_premium = king_addons_freemius()->can_use_premium_code__premium_only();
92 $custom_post_types = Core::getCustomTypes('post');
93
94 foreach ($custom_post_types as $slug => $title) {
95 // Skip excluded slugs
96 if (in_array($slug, $excluded_slugs, true)) {
97 continue;
98 }
99
100 // Add either as-is or with "Pro" label
101 if ($can_use_premium) {
102 $post_types[$slug] = esc_html($title);
103 } else {
104 $post_types['pro-' . substr($slug, 0, 2)] = esc_html($title) . ' (Pro)';
105 }
106 }
107
108 // Append special "Pro" keys
109 $post_types['pro-cr'] = esc_html__('Current Query (Pro)', 'king-addons');
110 $post_types['pro-rl'] = esc_html__('Related Query (Pro)', 'king-addons');
111
112 return $post_types;
113 }
114
115 public function get_available_taxonomies()
116 {
117 $post_taxonomies = [
118 'category' => esc_html__('Categories', 'king-addons'),
119 'post_tag' => esc_html__('Tags', 'king-addons'),
120 ];
121
122 $excluded_slugs = ['product_tag', 'product_cat'];
123 $can_use_premium = king_addons_freemius()->can_use_premium_code__premium_only();
124 $custom_post_taxonomies = Core::getCustomTypes('tax');
125
126 foreach ($custom_post_taxonomies as $slug => $title) {
127 // Skip excluded slugs
128 if (in_array($slug, $excluded_slugs, true)) {
129 continue;
130 }
131
132 // Add either as-is or with "Pro" label
133 if ($can_use_premium) {
134 $post_taxonomies[$slug] = esc_html($title);
135 } else {
136 $post_taxonomies['pro-' . substr($slug, 0, 2)] = esc_html($title) . ' (Pro)';
137 }
138 }
139
140 return $post_taxonomies;
141 }
142
143
144 public function add_control_open_links_in_new_tab()
145 {
146 $this->add_control(
147 'open_links_in_new_tab',
148 [
149 'label' => sprintf(__('Open Links in New Tab %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'),
150 'type' => Controls_Manager::SWITCHER,
151 'classes' => 'king-addons-pro-control no-distance'
152 ]
153 );
154 }
155
156 public function add_control_query_randomize()
157 {
158 $this->add_control(
159 'query_randomize',
160 [
161 'label' => sprintf(__('Randomize Query %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'),
162 'type' => Controls_Manager::SWITCHER,
163 'classes' => 'king-addons-pro-control no-distance'
164 ]
165 );
166 }
167
168 public function add_control_order_posts()
169 {
170 $this->add_control(
171 'order_posts',
172 [
173 'label' => esc_html__('Order By', 'king-addons'),
174 'type' => Controls_Manager::SELECT,
175 'default' => 'date',
176 'label_block' => false,
177 'options' => [
178 'date' => esc_html__('Date', 'king-addons'),
179 'pro-tl' => esc_html__('Title (Pro)', 'king-addons'),
180 'pro-mf' => esc_html__('Last Modified (Pro)', 'king-addons'),
181 'pro-d' => esc_html__('Post ID', 'king-addons'),
182 'pro-ar' => esc_html__('Post Author', 'king-addons'),
183 'pro-cc' => esc_html__('Comment Count', 'king-addons')
184 ],
185 'condition' => [
186 'query_randomize!' => 'rand',
187 ]
188 ]
189 );
190 }
191
192 public function add_control_force_responsive_one_column()
193 {
194 $this->add_control(
195 'force_responsive_one_column',
196 [
197 'label' => sprintf(__('Force Responsive One Column %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'),
198 'type' => Controls_Manager::SWITCHER,
199 'classes' => 'king-addons-pro-control'
200 ]
201 );
202 }
203
204 public function add_option_element_select()
205 {
206 return [
207 'title' => esc_html__('Title', 'king-addons'),
208 'content' => esc_html__('Content', 'king-addons'),
209 'excerpt' => esc_html__('Excerpt', 'king-addons'),
210 'date' => esc_html__('Date', 'king-addons'),
211 'time' => esc_html__('Time', 'king-addons'),
212 'author' => esc_html__('Author', 'king-addons'),
213 'comments' => esc_html__('Comments', 'king-addons'),
214 'read-more' => esc_html__('Read More', 'king-addons'),
215 'separator' => esc_html__('Separator', 'king-addons'),
216 'pro-lk' => esc_html__('Likes (Pro)', 'king-addons'),
217 'pro-shr' => esc_html__('Sharing (Pro)', 'king-addons'),
218 'pro-cf' => esc_html__('Custom Field (Pro)', 'king-addons'),
219 ];
220 }
221
222 public function add_repeater_args_element_like_icon()
223 {
224 return [
225 'type' => Controls_Manager::HIDDEN,
226 'default' => ''
227 ];
228 }
229
230 public function add_repeater_args_element_like_text()
231 {
232 return [
233 'type' => Controls_Manager::HIDDEN,
234 'default' => ''
235 ];
236 }
237
238 public function add_repeater_args_element_like_show_count()
239 {
240 return [
241 'type' => Controls_Manager::HIDDEN,
242 'default' => ''
243 ];
244 }
245
246 public function add_repeater_args_element_sharing_icon_1()
247 {
248 return [
249 'type' => Controls_Manager::HIDDEN,
250 'default' => ''
251 ];
252 }
253
254 public function add_repeater_args_element_sharing_icon_2()
255 {
256 return [
257 'type' => Controls_Manager::HIDDEN,
258 'default' => ''
259 ];
260 }
261
262 public function add_repeater_args_element_sharing_icon_3()
263 {
264 return [
265 'type' => Controls_Manager::HIDDEN,
266 'default' => ''
267 ];
268 }
269
270 public function add_repeater_args_element_sharing_icon_4()
271 {
272 return [
273 'type' => Controls_Manager::HIDDEN,
274 'default' => ''
275 ];
276 }
277
278 public function add_repeater_args_element_sharing_icon_5()
279 {
280 return [
281 'type' => Controls_Manager::HIDDEN,
282 'default' => ''
283 ];
284 }
285
286 public function add_repeater_args_element_sharing_icon_6()
287 {
288 return [
289 'type' => Controls_Manager::HIDDEN,
290 'default' => ''
291 ];
292 }
293
294 public function add_repeater_args_element_sharing_trigger()
295 {
296 return [
297 'type' => Controls_Manager::HIDDEN,
298 'default' => ''
299 ];
300 }
301
302 public function add_repeater_args_element_sharing_trigger_icon()
303 {
304 return [
305 'type' => Controls_Manager::HIDDEN,
306 'default' => ''
307 ];
308 }
309
310 public function add_repeater_args_element_sharing_trigger_action()
311 {
312 return [
313 'type' => Controls_Manager::HIDDEN,
314 'default' => ''
315 ];
316 }
317
318 public function add_repeater_args_element_sharing_trigger_direction()
319 {
320 return [
321 'type' => Controls_Manager::HIDDEN,
322 'default' => ''
323 ];
324 }
325
326 public function add_repeater_args_element_sharing_tooltip()
327 {
328 return [
329 'type' => Controls_Manager::HIDDEN,
330 'default' => ''
331 ];
332 }
333
334 public function add_repeater_args_element_custom_field()
335 {
336 return [
337 'type' => Controls_Manager::HIDDEN,
338 'default' => ''
339 ];
340 }
341
342 public function add_repeater_args_element_custom_field_btn_link()
343 {
344 return [
345 'type' => Controls_Manager::HIDDEN,
346 'default' => ''
347 ];
348 }
349
350 public function add_repeater_args_element_custom_field_new_tab()
351 {
352 return [
353 'type' => Controls_Manager::HIDDEN,
354 'default' => ''
355 ];
356 }
357
358 public function add_repeater_args_custom_field_wrapper_html_divider1()
359 {
360 return [
361 'type' => Controls_Manager::HIDDEN,
362 'default' => ''
363 ];
364 }
365
366 public function add_repeater_args_element_custom_field_wrapper()
367 {
368 return [
369 'type' => Controls_Manager::HIDDEN,
370 'default' => ''
371 ];
372 }
373
374 public function add_repeater_args_element_custom_field_wrapper_html()
375 {
376 return [
377 'type' => Controls_Manager::HIDDEN,
378 'default' => ''
379 ];
380 }
381
382 public function add_repeater_args_custom_field_wrapper_html_divider2()
383 {
384 return [
385 'type' => Controls_Manager::HIDDEN,
386 'default' => ''
387 ];
388 }
389
390 public function add_repeater_args_element_custom_field_style()
391 {
392 return [
393 'type' => Controls_Manager::HIDDEN,
394 'default' => ''
395 ];
396 }
397
398 public function add_repeater_args_element_trim_text_by()
399 {
400 return [
401 'word_count' => esc_html__('Word Count', 'king-addons'),
402 'pro-lc' => esc_html__('Letter Count (Pro)', 'king-addons')
403 ];
404 }
405
406 public function add_control_overlay_animation_divider()
407 {
408 }
409
410 public function add_control_overlay_image()
411 {
412 }
413
414 public function add_control_overlay_image_width()
415 {
416 }
417
418 public function add_section_slider()
419 {
420 $this->start_controls_section(
421 'section_slider',
422 [
423 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Posts Slider', 'king-addons'),
424 'tab' => Controls_Manager::TAB_CONTENT,
425 ]
426 );
427
428 $this->add_control(
429 'slider_section_pro_notice',
430 [
431 'raw' => 'Tiled Post Slider is available<br> in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-magazine-grid-settings-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>',
432
433 'type' => Controls_Manager::RAW_HTML,
434 'content_classes' => 'king-addons-pro-notice',
435 ]
436 );
437
438
439
440
441 $this->end_controls_section();
442
443
444 }
445
446 public function add_control_title_pointer_color_hr()
447 {
448 }
449
450 public function add_control_title_pointer()
451 {
452 }
453
454 public function add_control_title_pointer_height()
455 {
456 }
457
458 public function add_control_title_pointer_animation()
459 {
460 }
461
462 public function add_control_tax1_custom_colors($meta)
463 {
464 }
465
466 public function add_control_tax1_pointer_color_hr()
467 {
468 }
469
470 public function add_control_tax1_pointer()
471 {
472 }
473
474 public function add_control_tax1_pointer_height()
475 {
476 }
477
478 public function add_control_tax1_pointer_animation()
479 {
480 }
481
482 public function add_control_tax2_pointer_color_hr()
483 {
484 }
485
486 public function add_control_tax2_pointer()
487 {
488 }
489
490 public function add_control_tax2_pointer_height()
491 {
492 }
493
494 public function add_control_tax2_pointer_animation()
495 {
496 }
497
498 public function add_control_read_more_animation()
499 {
500 }
501
502 public function add_control_read_more_animation_height()
503 {
504 }
505
506 public function add_section_style_custom_field1()
507 {
508 }
509
510 public function add_section_style_custom_field2()
511 {
512 }
513
514 public function add_section_style_grid_slider_nav()
515 {
516 }
517
518 public function add_section_style_likes()
519 {
520 }
521
522 public function add_section_style_sharing()
523 {
524 }
525
526 protected function register_controls()
527 {
528
529 $this->start_controls_section(
530 'section_grid_query',
531 [
532 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Query', 'king-addons'),
533 'tab' => Controls_Manager::TAB_CONTENT,
534 ]
535 );
536
537 $post_types = $this->add_option_query_source();
538
539 unset($post_types['product']);
540 unset($post_types['e-landing-page']);
541
542 $post_taxonomies = $this->get_available_taxonomies();
543
544 $tax_meta_keys = Core::getCustomMetaKeysTaxonomies();
545
546 $this->add_control(
547 'query_source',
548 [
549 'label' => esc_html__('Source', 'king-addons'),
550 'type' => Controls_Manager::SELECT,
551 'default' => 'post',
552 'options' => $post_types,
553 ]
554 );
555
556 Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'magazine-grid', 'query_source', ['pro-rl', 'pro-cr']);
557
558 if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
559 $this->add_control(
560 'query_source_cpt_pro_notice',
561 [
562 'raw' => 'This option is available<br> in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-grid-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>',
563 'type' => Controls_Manager::RAW_HTML,
564 'content_classes' => 'king-addons-pro-notice',
565 'condition' => [
566 'query_source!' => ['post', 'page', 'related', 'current', 'pro-rl', 'pro-cr'],
567 ]
568 ]
569 );
570 }
571
572 $this->add_control(
573 'query_selection',
574 [
575 'label' => esc_html__('Selection', 'king-addons'),
576 'type' => Controls_Manager::SELECT,
577 'default' => 'dynamic',
578 'options' => [
579 'dynamic' => esc_html__('Dynamic', 'king-addons'),
580 'manual' => esc_html__('Manual', 'king-addons'),
581 ],
582 'condition' => [
583 'query_source!' => ['current', 'related'],
584 ],
585 ]
586 );
587
588 $this->add_control_order_posts();
589
590 Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'grid', 'order_posts', ['pro-tl', 'pro-mf', 'pro-d', 'pro-ar', 'pro-cc']);
591
592 $this->add_control(
593 'order_direction',
594 [
595 'label' => esc_html__('Order', 'king-addons'),
596 'type' => Controls_Manager::SELECT,
597 'default' => 'DESC',
598 'label_block' => false,
599 'options' => [
600 'ASC' => esc_html__('Ascending', 'king-addons'),
601 'DESC' => esc_html__('Descending', 'king-addons'),
602 ],
603 'condition' => [
604 'query_randomize!' => 'rand',
605 ]
606 ]
607 );
608
609 $this->add_control(
610 'query_tax_selection',
611 [
612 'label' => esc_html__('Select Taxonomy', 'king-addons'),
613 'type' => Controls_Manager::SELECT,
614 'default' => 'category',
615 'options' => $post_taxonomies,
616 'condition' => [
617 'query_source' => 'related',
618 ],
619 ]
620 );
621
622 $this->add_control(
623 'query_author',
624 [
625 'label' => esc_html__('Authors', 'king-addons'),
626 'type' => 'king-addons-ajax-select2',
627 'options' => 'ajaxselect2/getUsers',
628 'multiple' => true,
629 'label_block' => true,
630 'separator' => 'before',
631 'condition' => [
632 'query_source!' => ['current', 'related'],
633 'query_selection' => 'dynamic',
634 ],
635 ]
636 );
637
638
639 foreach ($post_taxonomies as $slug => $title) {
640 global $wp_taxonomies;
641 $post_type = '';
642
643 if (isset($wp_taxonomies[$slug]->object_type[0])) {
644 $post_type = $wp_taxonomies[$slug]->object_type[0];
645 }
646
647 $this->add_control(
648 'query_taxonomy_' . $slug,
649 [
650 'label' => $title,
651 'type' => 'king-addons-ajax-select2',
652 'options' => 'ajaxselect2/getTaxonomies',
653 'query_slug' => $slug,
654 'multiple' => true,
655 'label_block' => true,
656 'condition' => [
657 'query_source' => $post_type,
658 'query_selection' => 'dynamic',
659 ],
660 ]
661 );
662 }
663
664 foreach ($post_types as $slug => $title) {
665 $this->add_control(
666 'query_exclude_' . $slug,
667 [
668 'label' => esc_html__('Exclude ', 'king-addons') . $title,
669 'type' => 'king-addons-ajax-select2',
670 'options' => 'ajaxselect2/getPostsByPostType',
671 'query_slug' => $slug,
672 'multiple' => true,
673 'label_block' => true,
674 'condition' => [
675 'query_source' => $slug,
676 'query_source!' => ['current', 'related'],
677 'query_selection' => 'dynamic',
678 ],
679 ]
680 );
681 }
682
683 foreach ($post_types as $slug => $title) {
684 $this->add_control(
685 'query_manual_' . $slug,
686 [
687 'label' => esc_html__('Select ', 'king-addons') . $title,
688 'type' => 'king-addons-ajax-select2',
689 'options' => 'ajaxselect2/getPostsByPostType',
690 'query_slug' => $slug,
691 'multiple' => true,
692 'label_block' => true,
693 'condition' => [
694 'query_source' => $slug,
695 'query_selection' => 'manual',
696 ],
697 'separator' => 'before',
698 ]
699 );
700 }
701
702 $this->add_control(
703 'query_offset',
704 [
705 'label' => esc_html__('Offset', 'king-addons'),
706 'type' => Controls_Manager::NUMBER,
707 'default' => 0,
708 'min' => 0,
709 'condition' => [
710 'query_selection' => 'dynamic',
711 ]
712 ]
713 );
714
715 $this->add_control(
716 'query_not_found_text',
717 [
718 'label' => esc_html__('Not Found Text', 'king-addons'),
719 'type' => Controls_Manager::TEXT,
720 'dynamic' => [
721 'active' => true,
722 ],
723 'default' => 'No Posts Found!',
724 'condition' => [
725 'query_selection' => 'dynamic',
726 'query_source!' => 'related',
727 ]
728 ]
729 );
730
731 $this->add_control_query_randomize();
732
733 $this->add_control(
734 'query_exclude_no_images',
735 [
736 'label' => esc_html__('Exclude Items without Thumbnail', 'king-addons'),
737 'type' => Controls_Manager::SWITCHER,
738 'return_value' => 'yes',
739 'label_block' => false
740 ]
741 );
742
743 $this->add_control(
744 'element_select_filter',
745 [
746 'type' => Controls_Manager::HIDDEN,
747 'default' => $this->get_related_taxonomies(),
748 ]
749 );
750
751 $this->end_controls_section();
752
753 $this->start_controls_section(
754 'section_grid_layout',
755 [
756 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Layout', 'king-addons'),
757 'tab' => Controls_Manager::TAB_CONTENT,
758 ]
759 );
760
761 $this->add_control(
762 'king_addons_grid_layout_select',
763 [
764 'label' => esc_html__('Select Layout', 'king-addons'),
765 'type' => Controls_Manager::CHOOSE,
766 'default' => '1-1-3',
767 'options' => [
768 '1-2' => [
769 'title' => esc_html__('Layout 1 (3 posts) (Pro)', 'king-addons'),
770 ],
771 '1-3' => [
772 'title' => esc_html__('Layout 2 (4 posts) (Pro)', 'king-addons'),
773 ],
774 '1-4' => [
775 'title' => esc_html__('Layout 3 (5 posts) (Pro)', 'king-addons'),
776 ],
777 '1-1-2' => [
778 'title' => esc_html__('Layout 4 (4 posts) (Pro)', 'king-addons'),
779 ],
780 '2-1-2' => [
781 'title' => esc_html__('Layout 5 (5 posts) (Pro)', 'king-addons'),
782 ],
783 '1vh-3h' => [
784 'title' => esc_html__('Layout 5.0 (4 posts) (Pro)', 'king-addons'),
785 ],
786 '1-1-1' => [
787 'title' => esc_html__('Layout 5.1 (3 posts)', 'king-addons'),
788 ],
789 '1-1-3' => [
790 'title' => esc_html__('Layout 5.2 (5 posts)', 'king-addons'),
791 ],
792 '2-3' => [
793 'title' => esc_html__('Layout 6 (5 posts)', 'king-addons'),
794 ],
795 '2-h' => [
796 'title' => esc_html__('Layout 7 (2, 4, 6 posts)', 'king-addons'),
797 ],
798 '3-h' => [
799 'title' => esc_html__('Layout 8 (3, 6, 9 posts)', 'king-addons'),
800 ],
801 '4-h' => [
802 'title' => esc_html__('Layout 8 (4, 8, 12 posts)', 'king-addons'),
803 ]
804 ],
805 ]
806 );
807
808 if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
809 $this->add_control(
810 'layout_select_pro_notice',
811 [
812 'raw' => 'These Layout options are available<br> in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-magazine-grid-settings-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>',
813
814 'type' => Controls_Manager::RAW_HTML,
815 'content_classes' => 'king-addons-pro-notice',
816 'condition' => [
817 'king_addons_grid_layout_select' => ['1-2', '1-3', '1-4', '1-1-2', '2-1-2', '1vh-3h']
818 ]
819 ]
820 );
821 }
822
823 $this->add_control_force_responsive_one_column();
824
825 $this->add_control_open_links_in_new_tab();
826
827 $this->add_group_control(
828 Group_Control_Image_Size::get_type(),
829 [
830 'name' => 'layout_image_crop',
831 'default' => 'full',
832 ]
833 );
834
835 $this->add_control(
836 'layout_rows_number',
837 [
838 'label' => esc_html__('Rows Number', 'king-addons'),
839 'type' => Controls_Manager::SELECT,
840 'render_type' => 'template',
841 'default' => '1',
842 'options' => [
843 '1' => esc_html__('1 Row', 'king-addons'),
844 '2' => esc_html__('2 Rows', 'king-addons'),
845 '3' => esc_html__('3 Rows', 'king-addons'),
846 ],
847 'selectors' => [
848 '{{WRAPPER}} .king-addons-magazine-grid-add-2-h' => 'grid-template-rows: repeat({{VALUE}}, 1fr);',
849 '{{WRAPPER}} .king-addons-magazine-grid-add-3-h' => 'grid-template-rows: repeat({{VALUE}}, 1fr);',
850 '{{WRAPPER}} .king-addons-magazine-grid-add-4-h' => 'grid-template-rows: repeat({{VALUE}}, 1fr);',
851 ],
852 'condition' => [
853 'king_addons_grid_layout_select' => ['2-h', '3-h', '4-h']
854 ],
855 ]
856 );
857
858 $this->add_responsive_control(
859 'layout_container_height',
860 [
861 'type' => Controls_Manager::SLIDER,
862 'label' => esc_html__('Container Height', 'king-addons'),
863 'range' => [
864 'px' => [
865 'min' => 100,
866 'max' => 1500,
867 ],
868 ],
869 'default' => [
870 'unit' => 'px',
871 'size' => 520,
872 ],
873 'selectors' => [
874 '{{WRAPPER}} .king-addons-magazine-grid' => 'min-height: {{SIZE}}px;',
875 ],
876 'separator' => 'before'
877 ]
878 );
879
880 $this->add_control(
881 'layout_big_post_width',
882 [
883 'type' => Controls_Manager::SLIDER,
884 'label' => esc_html__('Featured Box Width', 'king-addons'),
885 'range' => [
886 '%' => [
887 'min' => 10,
888 'max' => 100,
889 ],
890 ],
891 'default' => [
892 'unit' => '%',
893 'size' => 50,
894 ],
895 'selectors' => [
896 '{{WRAPPER}} .king-addons-magazine-grid-add-1-2' => 'grid-template-columns: {{SIZE}}% 1fr; -ms-grid-columns: {{SIZE}}% 1fr;',
897 '{{WRAPPER}} .king-addons-magazine-grid-add-1-3' => 'grid-template-columns: {{SIZE}}% 1fr 1fr; -ms-grid-columns: {{SIZE}}% 1fr 1fr;',
898 '{{WRAPPER}} .king-addons-magazine-grid-add-1-4' => 'grid-template-columns: {{SIZE}}% 1fr 1fr; -ms-grid-columns: {{SIZE}}% 1fr 1fr;',
899 '{{WRAPPER}} .king-addons-magazine-grid-add-1-1-2' => 'grid-template-columns: {{SIZE}}% 1fr 1fr; -ms-grid-columns: {{SIZE}}% 1fr 1fr;',
900 '{{WRAPPER}} .king-addons-magazine-grid-add-1vh-3h' => 'grid-template-columns: {{SIZE}}% 1fr; -ms-grid-columns: {{SIZE}}% 1fr;',
901 '{{WRAPPER}} .king-addons-magazine-grid-add-2-1-2' => 'grid-template-columns: 1fr {{SIZE}}% 1fr; -ms-grid-columns: 1fr {{SIZE}}% 1fr;',
902 '{{WRAPPER}} .king-addons-magazine-grid-add-1-1-1' => 'grid-template-columns: 1fr {{SIZE}}% 1fr; -ms-grid-columns: 1fr {{SIZE}}% 1fr;',
903 ],
904 'condition' => [
905 'king_addons_grid_layout_select' => ['1-2', '1-3', '1-4', '1-1-2', '1vh-3h', '2-1-2', '1-1-1']
906 ]
907 ]
908 );
909
910 $this->add_responsive_control(
911 'layout_gutter_hr',
912 [
913 'label' => esc_html__('Horizontal Gutter', 'king-addons'),
914 'type' => Controls_Manager::SLIDER,
915 'default' => [
916 'size' => 4,
917 ],
918 'widescreen_default' => [
919 'size' => 4,
920 ],
921 'laptop_default' => [
922 'size' => 4,
923 ],
924 'tablet_extra_default' => [
925 'size' => 4,
926 ],
927 'tablet_default' => [
928 'size' => 4,
929 ],
930 'mobile_extra_default' => [
931 'size' => 4,
932 ],
933 'mobile_default' => [
934 'size' => 4,
935 ],
936 'range' => [
937 'px' => [
938 'min' => 0,
939 'max' => 50,
940 ],
941 ],
942 'selectors' => [
943 '{{WRAPPER}} .king-addons-magazine-grid' => 'grid-column-gap: {{SIZE}}px;',
944 ],
945 'separator' => 'before'
946 ]
947 );
948
949 $this->add_responsive_control(
950 'layout_gutter_vr',
951 [
952 'label' => esc_html__('Vertical Gutter', 'king-addons'),
953 'type' => Controls_Manager::SLIDER,
954 'default' => [
955 'size' => 4,
956 ],
957 'widescreen_default' => [
958 'size' => 4,
959 ],
960 'laptop_default' => [
961 'size' => 4,
962 ],
963 'tablet_extra_default' => [
964 'size' => 4,
965 ],
966 'tablet_default' => [
967 'size' => 4,
968 ],
969 'mobile_extra_default' => [
970 'size' => 4,
971 ],
972 'mobile_default' => [
973 'size' => 4,
974 ],
975 'range' => [
976 'px' => [
977 'min' => 0,
978 'max' => 50,
979 ],
980 ],
981 'selectors' => [
982 '{{WRAPPER}} .king-addons-magazine-grid' => 'grid-row-gap: {{SIZE}}px;',
983 ],
984 'separator' => 'after'
985 ]
986 );
987
988 $this->end_controls_section();
989
990
991 $this->start_controls_section(
992 'section_grid_elements',
993 [
994 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Elements', 'king-addons'),
995 'tab' => Controls_Manager::TAB_CONTENT,
996 ]
997 );
998
999 $repeater = new Repeater();
1000
1001 $element_select = $this->add_option_element_select();
1002
1003 $repeater->add_control(
1004 'element_select',
1005 [
1006 'label' => esc_html__('Select Element', 'king-addons'),
1007 'type' => Controls_Manager::SELECT,
1008 'default' => 'title',
1009 'options' => array_merge($element_select, $post_taxonomies),
1010 'separator' => 'after'
1011 ]
1012 );
1013
1014 $repeater->add_control(
1015 'show_last_update_date',
1016 [
1017 'label' => esc_html__('Show Last Update Date', 'king-addons'),
1018 'type' => Controls_Manager::SWITCHER,
1019 'return_value' => 'yes',
1020 'separator' => 'after',
1021 'condition' => [
1022 'element_select' => 'date',
1023 ]
1024 ]
1025 );
1026
1027 Core::renderUpgradeProNotice($repeater, Controls_Manager::RAW_HTML, 'magazine-grid', 'element_select', ['pro-lk', 'pro-shr']);
1028 Core::renderUpgradeProNotice($repeater, Controls_Manager::RAW_HTML, 'magazine-grid', 'element_select', ['pro-cf']);
1029
1030 $repeater->add_control(
1031 'element_display',
1032 [
1033 'label' => esc_html__('Display', 'king-addons'),
1034 'type' => Controls_Manager::SELECT,
1035 'default' => 'block',
1036 'options' => [
1037 'inline' => esc_html__('Inline', 'king-addons'),
1038 'block' => esc_html__('Separate Line', 'king-addons'),
1039 'custom' => esc_html__('Custom Width', 'king-addons'),
1040 ],
1041 ]
1042 );
1043
1044 $repeater->add_control(
1045 'element_custom_width',
1046 [
1047 'label' => esc_html__('Element Width', 'king-addons'),
1048 'type' => Controls_Manager::SLIDER,
1049 'size_units' => ['%'],
1050 'range' => [
1051 '%' => [
1052 'min' => 0,
1053 'max' => 100,
1054 ],
1055 ],
1056 'default' => [
1057 'unit' => '%',
1058 'size' => 100,
1059 ],
1060 'selectors' => [
1061 '{{WRAPPER}} {{CURRENT_ITEM}}' => 'width: {{SIZE}}%;',
1062 ],
1063 'condition' => [
1064 'element_display' => 'custom',
1065 ],
1066 ]
1067 );
1068
1069 if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
1070 $repeater->add_control(
1071 'element_align_pro_notice',
1072 [
1073 'raw' => 'Vertical Align option is available<br> in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-magazine-grid-settings-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>',
1074
1075 'type' => Controls_Manager::RAW_HTML,
1076 'content_classes' => 'king-addons-pro-notice',
1077 ]
1078 );
1079 }
1080
1081 $repeater->add_control(
1082 'element_align_vr',
1083 [
1084 'label' => esc_html__('Vertical Align', 'king-addons'),
1085 'type' => Controls_Manager::CHOOSE,
1086 'label_block' => false,
1087 'default' => 'middle',
1088 'options' => [
1089 'top' => [
1090 'title' => esc_html__('Top', 'king-addons'),
1091 'icon' => 'eicon-v-align-top',
1092 ],
1093 'middle' => [
1094 'title' => esc_html__('Middle', 'king-addons'),
1095 'icon' => 'eicon-v-align-middle',
1096 ],
1097 'bottom' => [
1098 'title' => esc_html__('Bottom', 'king-addons'),
1099 'icon' => 'eicon-v-align-bottom',
1100 ],
1101 ],
1102 ]
1103 );
1104
1105 $repeater->add_control(
1106 'element_align_hr',
1107 [
1108 'label' => esc_html__('Horizontal Align', 'king-addons'),
1109 'type' => Controls_Manager::CHOOSE,
1110 'label_block' => false,
1111 'default' => 'center',
1112 'options' => [
1113 'left' => [
1114 'title' => esc_html__('Left', 'king-addons'),
1115 'icon' => 'eicon-h-align-left',
1116 ],
1117 'center' => [
1118 'title' => esc_html__('Center', 'king-addons'),
1119 'icon' => 'eicon-h-align-center',
1120 ],
1121 'right' => [
1122 'title' => esc_html__('Right', 'king-addons'),
1123 'icon' => 'eicon-h-align-right',
1124 ]
1125 ],
1126 'selectors' => [
1127 '{{WRAPPER}} {{CURRENT_ITEM}}' => 'text-align: {{VALUE}}',
1128 ],
1129 'render_type' => 'template',
1130 'separator' => 'after'
1131 ]
1132 );
1133
1134 $repeater->add_control(
1135 'element_title_tag',
1136 [
1137 'label' => esc_html__('Title HTML Tag', 'king-addons'),
1138 'type' => Controls_Manager::SELECT,
1139 'options' => [
1140 'h1' => 'H1',
1141 'h2' => 'H2',
1142 'h3' => 'H3',
1143 'h4' => 'H4',
1144 'h5' => 'H5',
1145 'h6' => 'H6',
1146 'div' => 'div',
1147 'span' => 'span',
1148 'P' => 'p'
1149 ],
1150 'default' => 'h2',
1151 'condition' => [
1152 'element_select' => 'title',
1153 ]
1154 ]
1155 );
1156
1157 $repeater->add_control(
1158 'element_dropcap',
1159 [
1160 'label' => esc_html__('Enable Drop Cap', 'king-addons'),
1161 'type' => Controls_Manager::SWITCHER,
1162 'return_value' => 'yes',
1163 'condition' => [
1164 'element_select' => ['content', 'excerpt'],
1165 ]
1166 ]
1167 );
1168
1169 $repeater->add_control(
1170 'element_trim_text_by',
1171 [
1172 'label' => esc_html__('Trim Text By', 'king-addons'),
1173 'type' => Controls_Manager::SELECT,
1174 'default' => 'word_count',
1175 'options' => $this->add_repeater_args_element_trim_text_by(),
1176 'separator' => 'after',
1177 'condition' => [
1178 'element_select' => ['title', 'excerpt'],
1179 ]
1180 ]
1181 );
1182
1183 $repeater->add_control(
1184 'element_word_count',
1185 [
1186 'label' => esc_html__('Word Count', 'king-addons'),
1187 'type' => Controls_Manager::NUMBER,
1188 'default' => 20,
1189 'min' => 1,
1190 'condition' => [
1191 'element_select' => ['title', 'excerpt'],
1192 'element_trim_text_by' => 'word_count'
1193 ]
1194 ]
1195 );
1196
1197 $repeater->add_control(
1198 'element_letter_count',
1199 [
1200 'label' => esc_html__('Letter Count', 'king-addons'),
1201 'type' => Controls_Manager::NUMBER,
1202 'default' => 40,
1203 'min' => 1,
1204 'condition' => [
1205 'element_select' => ['title', 'excerpt'],
1206 'element_trim_text_by' => 'letter_count'
1207 ]
1208 ]
1209 );
1210
1211 $repeater->add_control(
1212 'element_show_avatar',
1213 [
1214 'label' => esc_html__('Show Avatar', 'king-addons'),
1215 'type' => Controls_Manager::SWITCHER,
1216 'return_value' => 'yes',
1217 'condition' => [
1218 'element_select' => ['author']
1219 ]
1220 ]
1221 );
1222
1223 $repeater->add_control(
1224 'element_avatar_size',
1225 [
1226 'label' => esc_html__('Avatar Size', 'king-addons'),
1227 'type' => Controls_Manager::NUMBER,
1228 'default' => 32,
1229 'min' => 8,
1230 'condition' => [
1231 'element_select' => ['author'],
1232 'element_show_avatar' => 'yes'
1233 ],
1234 'separator' => 'after'
1235 ]
1236 );
1237
1238 $repeater->add_control(
1239 'element_read_more_text',
1240 [
1241 'label' => esc_html__('Read More Text', 'king-addons'),
1242 'type' => Controls_Manager::TEXT,
1243 'dynamic' => [
1244 'active' => true,
1245 ],
1246 'default' => 'Read More',
1247 'condition' => [
1248 'element_select' => ['read-more'],
1249 ],
1250 'separator' => 'after'
1251 ]
1252 );
1253
1254 $repeater->add_control(
1255 'element_tax_sep',
1256 [
1257 'label' => esc_html__('Separator', 'king-addons'),
1258 'type' => Controls_Manager::TEXT,
1259 'dynamic' => [
1260 'active' => true,
1261 ],
1262 'default' => ', ',
1263 'condition' => [
1264 'element_select!' => [
1265 'title',
1266 'content',
1267 'excerpt',
1268 'date',
1269 'time',
1270 'author',
1271 'comments',
1272 'read-more',
1273 'likes',
1274 'sharing',
1275 'custom-field',
1276 'separator',
1277 'post_format',
1278 ],
1279 ],
1280 'separator' => 'after'
1281 ]
1282 );
1283
1284 $repeater->add_control(
1285 'element_tax_style',
1286 [
1287 'label' => esc_html__('Select Styling', 'king-addons'),
1288 'type' => Controls_Manager::SELECT,
1289 'default' => 'king-addons-grid-tax-style-1',
1290 'options' => [
1291 'king-addons-grid-tax-style-1' => esc_html__('Taxonomy Style 1', 'king-addons'),
1292 'king-addons-grid-tax-style-2' => esc_html__('Taxonomy Style 2', 'king-addons'),
1293 ],
1294 'condition' => [
1295 'element_select!' => [
1296 'title',
1297 'content',
1298 'excerpt',
1299 'date',
1300 'time',
1301 'author',
1302 'comments',
1303 'read-more',
1304 'likes',
1305 'sharing',
1306 'custom-field',
1307 'separator',
1308 ],
1309 ],
1310 'separator' => 'after'
1311 ]
1312 );
1313
1314 $repeater->add_control(
1315 'element_comments_text_1',
1316 [
1317 'label' => esc_html__('No Comments', 'king-addons'),
1318 'type' => Controls_Manager::TEXT,
1319 'dynamic' => [
1320 'active' => true,
1321 ],
1322 'default' => 'No Comments',
1323 'condition' => [
1324 'element_select' => ['comments'],
1325 ]
1326 ]
1327 );
1328
1329 $repeater->add_control(
1330 'element_comments_text_2',
1331 [
1332 'label' => esc_html__('One Comment', 'king-addons'),
1333 'type' => Controls_Manager::TEXT,
1334 'dynamic' => [
1335 'active' => true,
1336 ],
1337 'default' => 'Comment',
1338 'condition' => [
1339 'element_select' => ['comments'],
1340 ]
1341 ]
1342 );
1343
1344 $repeater->add_control(
1345 'element_comments_text_3',
1346 [
1347 'label' => esc_html__('Multiple Comments', 'king-addons'),
1348 'type' => Controls_Manager::TEXT,
1349 'dynamic' => [
1350 'active' => true,
1351 ],
1352 'default' => 'Comments',
1353 'condition' => [
1354 'element_select' => ['comments'],
1355 ],
1356 'separator' => 'after'
1357 ]
1358 );
1359
1360 $repeater->add_control('element_like_icon', $this->add_repeater_args_element_like_icon());
1361
1362 $repeater->add_control('element_like_show_count', $this->add_repeater_args_element_like_show_count());
1363
1364 $repeater->add_control('element_like_text', $this->add_repeater_args_element_like_text());
1365
1366 $repeater->add_control('element_sharing_icon_1', $this->add_repeater_args_element_sharing_icon_1());
1367
1368 $repeater->add_control('element_sharing_icon_2', $this->add_repeater_args_element_sharing_icon_2());
1369
1370 $repeater->add_control('element_sharing_icon_3', $this->add_repeater_args_element_sharing_icon_3());
1371
1372 $repeater->add_control('element_sharing_icon_4', $this->add_repeater_args_element_sharing_icon_4());
1373
1374 $repeater->add_control('element_sharing_icon_5', $this->add_repeater_args_element_sharing_icon_5());
1375
1376 $repeater->add_control('element_sharing_icon_6', $this->add_repeater_args_element_sharing_icon_6());
1377
1378 $repeater->add_control('element_sharing_trigger', $this->add_repeater_args_element_sharing_trigger());
1379
1380 $repeater->add_control('element_sharing_trigger_icon', $this->add_repeater_args_element_sharing_trigger_icon());
1381
1382 $repeater->add_control('element_sharing_trigger_action', $this->add_repeater_args_element_sharing_trigger_action());
1383
1384 $repeater->add_control('element_sharing_trigger_direction', $this->add_repeater_args_element_sharing_trigger_direction());
1385
1386 $repeater->add_control('element_sharing_tooltip', $this->add_repeater_args_element_sharing_tooltip());
1387
1388 $repeater->add_control('element_custom_field', $this->add_repeater_args_element_custom_field());
1389
1390 $repeater->add_control('element_custom_field_btn_link', $this->add_repeater_args_element_custom_field_btn_link());
1391
1392 $repeater->add_control('element_custom_field_new_tab', $this->add_repeater_args_element_custom_field_new_tab());
1393
1394 $repeater->add_control('custom_field_wrapper_html_divider1', $this->add_repeater_args_custom_field_wrapper_html_divider1());
1395
1396 $repeater->add_control('element_custom_field_wrapper', $this->add_repeater_args_element_custom_field_wrapper());
1397
1398 $repeater->add_control('element_custom_field_wrapper_html', $this->add_repeater_args_element_custom_field_wrapper_html());
1399
1400 $repeater->add_control('custom_field_wrapper_html_divider2', $this->add_repeater_args_custom_field_wrapper_html_divider2());
1401
1402 $repeater->add_control('element_custom_field_style', $this->add_repeater_args_element_custom_field_style());
1403
1404 $repeater->add_control(
1405 'element_separator_style',
1406 [
1407 'label' => esc_html__('Select Styling', 'king-addons'),
1408 'type' => Controls_Manager::SELECT,
1409 'default' => 'king-addons-grid-sep-style-1',
1410 'options' => [
1411 'king-addons-grid-sep-style-1' => esc_html__('Separator Style 1', 'king-addons'),
1412 'king-addons-grid-sep-style-2' => esc_html__('Separator Style 2', 'king-addons'),
1413 ],
1414 'condition' => [
1415 'element_select' => 'separator',
1416 ]
1417 ]
1418 );
1419
1420 $repeater->add_control(
1421 'element_extra_text_pos',
1422 [
1423 'label' => esc_html__('Extra Text Display', 'king-addons'),
1424 'type' => Controls_Manager::SELECT,
1425 'options' => [
1426 'none' => esc_html__('None', 'king-addons'),
1427 'before' => esc_html__('Before Element', 'king-addons'),
1428 'after' => esc_html__('After Element', 'king-addons'),
1429 ],
1430 'default' => 'none',
1431 'condition' => [
1432 'element_select!' => [
1433 'title',
1434 'content',
1435 'excerpt',
1436 'read-more',
1437 'separator',
1438 ],
1439 ]
1440 ]
1441 );
1442
1443 $repeater->add_control(
1444 'element_extra_text',
1445 [
1446 'label' => esc_html__('Extra Text', 'king-addons'),
1447 'type' => Controls_Manager::TEXT,
1448 'dynamic' => [
1449 'active' => true,
1450 ],
1451 'default' => '',
1452 'condition' => [
1453 'element_select!' => [
1454 'title',
1455 'content',
1456 'excerpt',
1457 'read-more',
1458 'separator',
1459 ],
1460 'element_extra_text_pos!' => 'none'
1461 ]
1462 ]
1463 );
1464
1465 $repeater->add_control(
1466 'element_extra_icon_pos',
1467 [
1468 'label' => esc_html__('Extra Icon Position', 'king-addons'),
1469 'type' => Controls_Manager::SELECT,
1470 'options' => [
1471 'none' => esc_html__('None', 'king-addons'),
1472 'before' => esc_html__('Before Element', 'king-addons'),
1473 'after' => esc_html__('After Element', 'king-addons'),
1474 ],
1475 'default' => 'none',
1476 'condition' => [
1477 'element_select!' => [
1478 'title',
1479 'content',
1480 'excerpt',
1481 'separator',
1482 'likes',
1483 'sharing',
1484 ],
1485 ]
1486 ]
1487 );
1488
1489 $repeater->add_control(
1490 'element_extra_icon',
1491 [
1492 'label' => esc_html__('Select Icon', 'king-addons'),
1493 'type' => Controls_Manager::ICONS,
1494 'skin' => 'inline',
1495 'label_block' => false,
1496 'condition' => [
1497 'element_select!' => [
1498 'title',
1499 'content',
1500 'excerpt',
1501 'separator',
1502 'likes',
1503 'sharing',
1504 ],
1505 'element_extra_icon_pos!' => 'none'
1506 ]
1507 ]
1508 );
1509
1510 $repeater->add_control(
1511 'animation_divider',
1512 [
1513 'type' => Controls_Manager::DIVIDER,
1514 'style' => 'thick',
1515 ]
1516 );
1517
1518 $repeater->add_control(
1519 'element_animation',
1520 [
1521 'label' => esc_html__('Select Animation', 'king-addons'),
1522 'type' => 'king-addons-animations',
1523 'default' => 'none',
1524 ]
1525 );
1526
1527
1528 Core::renderUpgradeProNotice($repeater, Controls_Manager::RAW_HTML, 'magazine-grid', 'element_animation', ['pro-slrt', 'pro-slxrt', 'pro-slbt', 'pro-sllt', 'pro-sltp', 'pro-slxlt', 'pro-sktp', 'pro-skrt', 'pro-skbt', 'pro-sklt', 'pro-scup', 'pro-scdn', 'pro-rllt', 'pro-rlrt']);
1529
1530 $repeater->add_control(
1531 'element_animation_duration',
1532 [
1533 'label' => esc_html__('Animation Duration', 'king-addons'),
1534 'type' => Controls_Manager::NUMBER,
1535 'default' => 0.3,
1536 'min' => 0,
1537 'max' => 5,
1538 'step' => 0.1,
1539 'selectors' => [
1540 '{{WRAPPER}} {{CURRENT_ITEM}}' => 'transition-duration: {{VALUE}}s;'
1541 ],
1542 'condition' => [
1543 'element_animation!' => 'none',
1544 ],
1545 ]
1546 );
1547
1548 $repeater->add_control(
1549 'element_animation_delay',
1550 [
1551 'label' => esc_html__('Animation Delay', 'king-addons'),
1552 'type' => Controls_Manager::NUMBER,
1553 'default' => 0,
1554 'min' => 0,
1555 'max' => 5,
1556 'step' => 0.1,
1557 'selectors' => [
1558 '{{WRAPPER}} .king-addons-animation-wrap:hover {{CURRENT_ITEM}}' => 'transition-delay: {{VALUE}}s;'
1559 ],
1560 'condition' => [
1561 'element_animation!' => 'none',
1562 ],
1563 ]
1564 );
1565
1566 $repeater->add_control(
1567 'element_animation_timing',
1568 [
1569 'label' => esc_html__('Animation Timing', 'king-addons'),
1570 'type' => Controls_Manager::SELECT,
1571 'options' => Core::getAnimationTimings(),
1572 'default' => 'ease-default',
1573 'condition' => [
1574 'element_animation!' => 'none',
1575 ],
1576 ]
1577 );
1578
1579
1580 Core::renderUpgradeProNotice($repeater, Controls_Manager::RAW_HTML, 'magazine-grid', 'element_animation_timing', ['pro-eio', 'pro-eiqd', 'pro-eicb', 'pro-eiqrt', 'pro-eiqnt', 'pro-eisn', 'pro-eiex', 'pro-eicr', 'pro-eibk', 'pro-eoqd', 'pro-eocb', 'pro-eoqrt', 'pro-eoqnt', 'pro-eosn', 'pro-eoex', 'pro-eocr', 'pro-eobk', 'pro-eioqd', 'pro-eiocb', 'pro-eioqrt', 'pro-eioqnt', 'pro-eiosn', 'pro-eioex', 'pro-eiocr', 'pro-eiobk',]);
1581
1582 $repeater->add_control(
1583 'element_animation_size',
1584 [
1585 'label' => esc_html__('Animation Size', 'king-addons'),
1586 'type' => Controls_Manager::SELECT,
1587 'options' => [
1588 'small' => esc_html__('Small', 'king-addons'),
1589 'medium' => esc_html__('Medium', 'king-addons'),
1590 'large' => esc_html__('Large', 'king-addons'),
1591 ],
1592 'default' => 'medium',
1593 'condition' => [
1594 'element_animation!' => 'none',
1595 ],
1596 ]
1597 );
1598
1599 $repeater->add_control(
1600 'element_animation_tr',
1601 [
1602 'label' => esc_html__('Animation Transparency', 'king-addons'),
1603 'type' => Controls_Manager::SWITCHER,
1604 'default' => 'yes',
1605 'return_value' => 'yes',
1606 'condition' => [
1607 'element_animation!' => 'none',
1608 ],
1609 ]
1610 );
1611
1612 $repeater->add_responsive_control(
1613 'element_show_on',
1614 [
1615 'label' => esc_html__('Show on this Device', 'king-addons'),
1616 'type' => Controls_Manager::SWITCHER,
1617 'default' => 'yes',
1618 'widescreen_default' => 'yes',
1619 'laptop_default' => 'yes',
1620 'tablet_extra_default' => 'yes',
1621 'tablet_default' => 'yes',
1622 'mobile_extra_default' => 'yes',
1623 'mobile_default' => 'yes',
1624 'selectors_dictionary' => [
1625 '' => 'position: absolute; left: -99999999px;',
1626 'yes' => 'position: static; left: auto;'
1627 ],
1628 'selectors' => [
1629 '{{WRAPPER}} {{CURRENT_ITEM}}' => '{{VALUE}}',
1630 ],
1631 'render_type' => 'template',
1632 ]
1633 );
1634
1635 $this->add_control(
1636 'grid_elements',
1637 [
1638 'label' => esc_html__('Grid Elements', 'king-addons'),
1639 'type' => Controls_Manager::REPEATER,
1640 'fields' => $repeater->get_controls(),
1641 'default' => [
1642 [
1643 'element_select' => 'category',
1644 'element_align_vr' => 'bottom',
1645 'element_align_hr' => 'left',
1646 ],
1647 [
1648 'element_select' => 'title',
1649 'element_align_vr' => 'bottom',
1650 'element_align_hr' => 'left',
1651 ],
1652 [
1653 'element_select' => 'date',
1654 'element_align_vr' => 'bottom',
1655 'element_display' => 'inline',
1656 'element_align_hr' => 'left',
1657 ],
1658 ],
1659 'title_field' => '{{{ element_select.charAt(0).toUpperCase() + element_select.slice(1) }}}',
1660 ]
1661 );
1662
1663 $this->end_controls_section();
1664
1665
1666 $this->add_section_slider();
1667
1668
1669 $this->start_controls_section(
1670 'section_image_overlay',
1671 [
1672 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Media Overlay', 'king-addons'),
1673 'tab' => Controls_Manager::TAB_CONTENT,
1674 ]
1675 );
1676
1677 $this->add_control(
1678 'overlay_width',
1679 [
1680 'label' => esc_html__('Overlay Width', 'king-addons'),
1681 'type' => Controls_Manager::SLIDER,
1682 'size_units' => ['%', 'px'],
1683 'default' => [
1684 'unit' => '%',
1685 'size' => 100,
1686 ],
1687 'range' => [
1688 '%' => [
1689 'min' => 0,
1690 'max' => 100,
1691 ],
1692 'px' => [
1693 'min' => 0,
1694 'max' => 500,
1695 ],
1696 ],
1697 'selectors' => [
1698 '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'width: {{SIZE}}{{UNIT}};top:calc((100% - {{overlay_height.SIZE}}{{overlay_height.UNIT}})/2);left:calc((100% - {{SIZE}}{{UNIT}})/2);',
1699 '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-top"]' => 'top:calc((100% - {{overlay_height.SIZE}}{{overlay_height.UNIT}})/2);left:calc((100% - {{SIZE}}{{UNIT}})/2);',
1700 '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-bottom"]' => 'bottom:calc((100% - {{overlay_height.SIZE}}{{overlay_height.UNIT}})/2);left:calc((100% - {{SIZE}}{{UNIT}})/2);',
1701 '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-right"]' => 'top:calc((100% - {{overlay_height.SIZE}}{{overlay_height.UNIT}})/2);right:calc((100% - {{SIZE}}{{UNIT}})/2);',
1702 '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-left"]' => 'top:calc((100% - {{overlay_height.SIZE}}{{overlay_height.UNIT}})/2);left:calc((100% - {{SIZE}}{{UNIT}})/2);',
1703 ],
1704 ]
1705 );
1706
1707 $this->add_responsive_control(
1708 'overlay_height',
1709 [
1710 'label' => esc_html__('Overlay Height', 'king-addons'),
1711 'type' => Controls_Manager::SLIDER,
1712 'size_units' => ['%', 'px'],
1713 'default' => [
1714 'unit' => '%',
1715 'size' => 100,
1716 ],
1717 'range' => [
1718 '%' => [
1719 'min' => 0,
1720 'max' => 100,
1721 ],
1722 'px' => [
1723 'min' => 0,
1724 'max' => 500,
1725 ],
1726 ],
1727 'selectors' => [
1728 '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'height: {{SIZE}}{{UNIT}};top:calc((100% - {{SIZE}}{{UNIT}})/2);left:calc((100% - {{overlay_width.SIZE}}{{overlay_width.UNIT}})/2);',
1729 '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-top"]' => 'top:calc((100% - {{SIZE}}{{UNIT}})/2);left:calc((100% - {{overlay_width.SIZE}}{{overlay_width.UNIT}})/2);',
1730 '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-bottom"]' => 'bottom:calc((100% - {{SIZE}}{{UNIT}})/2);left:calc((100% - {{overlay_width.SIZE}}{{overlay_width.UNIT}})/2);',
1731 '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-right"]' => 'top:calc((100% - {{SIZE}}{{UNIT}})/2);right:calc((100% - {{overlay_width.SIZE}}{{overlay_width.UNIT}})/2);',
1732 '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-left"]' => 'top:calc((100% - {{SIZE}}{{UNIT}})/2);left:calc((100% - {{overlay_width.SIZE}}{{overlay_width.UNIT}})/2);',
1733 ],
1734 'separator' => 'after',
1735 ]
1736 );
1737
1738 $this->add_control(
1739 'overlay_post_link',
1740 [
1741 'label' => esc_html__('Link to Single Page', 'king-addons'),
1742 'type' => Controls_Manager::SWITCHER,
1743 'default' => 'yes',
1744 'return_value' => 'yes',
1745 'separator' => 'after',
1746 ]
1747 );
1748
1749 $this->add_control(
1750 'overlay_animation',
1751 [
1752 'label' => esc_html__('Select Animation', 'king-addons'),
1753 'type' => 'king-addons-animations-alt',
1754 'default' => 'fade-out',
1755 ]
1756 );
1757
1758
1759 Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'magazine-grid', 'overlay_animation', ['pro-slrt', 'pro-slxrt', 'pro-slbt', 'pro-sllt', 'pro-sltp', 'pro-slxlt', 'pro-sktp', 'pro-skrt', 'pro-skbt', 'pro-sklt', 'pro-scup', 'pro-scdn', 'pro-rllt', 'pro-rlrt']);
1760
1761 $this->add_control(
1762 'overlay_animation_duration',
1763 [
1764 'label' => esc_html__('Animation Duration', 'king-addons'),
1765 'type' => Controls_Manager::NUMBER,
1766 'default' => 0.7,
1767 'min' => 0,
1768 'max' => 5,
1769 'step' => 0.1,
1770 'selectors' => [
1771 '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'transition-duration: {{VALUE}}s;'
1772 ],
1773 'condition' => [
1774 'overlay_animation!' => 'none',
1775 ],
1776 ]
1777 );
1778
1779 $this->add_control(
1780 'overlay_animation_delay',
1781 [
1782 'label' => esc_html__('Animation Delay', 'king-addons'),
1783 'type' => Controls_Manager::NUMBER,
1784 'default' => 0,
1785 'min' => 0,
1786 'max' => 5,
1787 'step' => 0.1,
1788 'selectors' => [
1789 '{{WRAPPER}} .king-addons-animation-wrap:hover .king-addons-grid-media-hover-bg' => 'transition-delay: {{VALUE}}s;'
1790 ],
1791 'condition' => [
1792 'overlay_animation!' => 'none',
1793 ],
1794 ]
1795 );
1796
1797 $this->add_control(
1798 'overlay_animation_timing',
1799 [
1800 'label' => esc_html__('Animation Timing', 'king-addons'),
1801 'type' => Controls_Manager::SELECT,
1802 'options' => Core::getAnimationTimings(),
1803 'default' => 'ease-default',
1804 'condition' => [
1805 'overlay_animation!' => 'none',
1806 ],
1807 ]
1808 );
1809
1810
1811 Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'magazine-grid', 'overlay_animation_timing', ['pro-eio', 'pro-eiqd', 'pro-eicb', 'pro-eiqrt', 'pro-eiqnt', 'pro-eisn', 'pro-eiex', 'pro-eicr', 'pro-eibk', 'pro-eoqd', 'pro-eocb', 'pro-eoqrt', 'pro-eoqnt', 'pro-eosn', 'pro-eoex', 'pro-eocr', 'pro-eobk', 'pro-eioqd', 'pro-eiocb', 'pro-eioqrt', 'pro-eioqnt', 'pro-eiosn', 'pro-eioex', 'pro-eiocr', 'pro-eiobk',]);
1812
1813 $this->add_control(
1814 'overlay_animation_size',
1815 [
1816 'label' => esc_html__('Animation Size', 'king-addons'),
1817 'type' => Controls_Manager::SELECT,
1818 'options' => [
1819 'small' => esc_html__('Small', 'king-addons'),
1820 'medium' => esc_html__('Medium', 'king-addons'),
1821 'large' => esc_html__('Large', 'king-addons'),
1822 ],
1823 'default' => 'medium',
1824 'condition' => [
1825 'overlay_animation!' => 'none',
1826 ],
1827 ]
1828 );
1829
1830 $this->add_control(
1831 'overlay_animation_tr',
1832 [
1833 'label' => esc_html__('Animation Transparency', 'king-addons'),
1834 'type' => Controls_Manager::SWITCHER,
1835 'default' => 'yes',
1836 'return_value' => 'yes',
1837 'separator' => 'after',
1838 'condition' => [
1839 'overlay_animation!' => 'none',
1840 ],
1841 ]
1842 );
1843
1844 $this->add_control_overlay_animation_divider();
1845
1846 $this->add_control_overlay_image();
1847
1848 $this->add_control_overlay_image_width();
1849
1850 $this->end_controls_section();
1851
1852 Core::renderProFeaturesSection($this, '', Controls_Manager::RAW_HTML, 'magazine-grid', [
1853 'Magazine Grid Slider',
1854 '+6 Magazine Grid Layouts',
1855 'Magazine Grid Slider Autoplay Options',
1856 'Magazine Grid Slider Advanced Navigation Positioning',
1857 'Magazine Grid Slider Advanced Pagination Positioning',
1858 'Random Posts Query',
1859 'Posts Order',
1860 'Trim Title & Excerpt By Letter Count',
1861 'Custom Post Types Support',
1862 'Custom Fields Support',
1863 'Advanced Grid Elements Positioning',
1864 'Advanced Post Likes',
1865 'Advanced Post Sharing',
1866 'Unlimited Image Overlay Animations',
1867 'Image Overlay GIF Upload Option',
1868 'Title, Category, Read More Advanced Link Hover Animations',
1869 'Open Links in New Tab'
1870 ]);
1871
1872
1873 $this->start_controls_section(
1874 'section_style_grid_media',
1875 [
1876 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Grid Media', 'king-addons'),
1877 'tab' => Controls_Manager::TAB_STYLE,
1878 'show_label' => false,
1879 ]
1880 );
1881
1882 $this->add_control(
1883 'grid_media_border_color',
1884 [
1885 'label' => esc_html__('Border Color', 'king-addons'),
1886 'type' => Controls_Manager::COLOR,
1887 'default' => '#E8E8E8',
1888 'selectors' => [
1889 '{{WRAPPER}} .king-addons-grid-image-wrap' => 'border-color: {{VALUE}}',
1890 ],
1891 ]
1892 );
1893
1894 $this->add_control(
1895 'grid_media_border_type',
1896 [
1897 'label' => esc_html__('Border Type', 'king-addons'),
1898 'type' => Controls_Manager::SELECT,
1899 'options' => [
1900 'none' => esc_html__('None', 'king-addons'),
1901 'solid' => esc_html__('Solid', 'king-addons'),
1902 'double' => esc_html__('Double', 'king-addons'),
1903 'dotted' => esc_html__('Dotted', 'king-addons'),
1904 'dashed' => esc_html__('Dashed', 'king-addons'),
1905 'groove' => esc_html__('Groove', 'king-addons'),
1906 ],
1907 'default' => 'none',
1908 'selectors' => [
1909 '{{WRAPPER}} .king-addons-grid-image-wrap' => 'border-style: {{VALUE}};',
1910 ],
1911 ]
1912 );
1913
1914 $this->add_control(
1915 'grid_media_border_width',
1916 [
1917 'label' => esc_html__('Border Width', 'king-addons'),
1918 'type' => Controls_Manager::DIMENSIONS,
1919 'size_units' => ['px'],
1920 'default' => [
1921 'top' => 1,
1922 'right' => 1,
1923 'bottom' => 1,
1924 'left' => 1,
1925 ],
1926 'selectors' => [
1927 '{{WRAPPER}} .king-addons-grid-image-wrap' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1928 ],
1929 'condition' => [
1930 'grid_media_border_type!' => 'none',
1931 ],
1932 ]
1933 );
1934
1935 $this->add_control(
1936 'grid_media_radius',
1937 [
1938 'label' => esc_html__('Border Radius', 'king-addons'),
1939 'type' => Controls_Manager::DIMENSIONS,
1940 'size_units' => ['px', '%'],
1941 'default' => [
1942 'top' => 0,
1943 'right' => 0,
1944 'bottom' => 0,
1945 'left' => 0,
1946 ],
1947 'selectors' => [
1948 '{{WRAPPER}} .king-addons-grid-image-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1949 ],
1950 'separator' => 'before',
1951 ]
1952 );
1953
1954 $this->end_controls_section();
1955
1956
1957 $this->start_controls_section(
1958 'section_style_overlay',
1959 [
1960 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Media Overlay', 'king-addons'),
1961 'tab' => Controls_Manager::TAB_STYLE,
1962 'show_label' => false,
1963 ]
1964 );
1965
1966 $this->add_group_control(
1967 Group_Control_Background::get_type(),
1968 [
1969 'name' => 'overlay_color',
1970 'label' => esc_html__('Background', 'king-addons'),
1971 'types' => ['classic', 'gradient'],
1972 'fields_options' => [
1973 'background' => [
1974 'default' => 'gradient',
1975 ],
1976 'color' => [
1977 'default' => 'rgba(255, 255, 255, 0)',
1978 ],
1979 'color_stop' => [
1980 'default' => [
1981 'unit' => '%',
1982 'size' => 0,
1983 ]
1984 ],
1985 'color_b' => [
1986 'default' => 'rgba(0, 0, 0, 1)',
1987 ]
1988 ],
1989 'selector' => '{{WRAPPER}} .king-addons-grid-media-hover-bg'
1990 ]
1991 );
1992
1993 $this->add_control(
1994 'overlay_border_color',
1995 [
1996 'label' => esc_html__('Border Color', 'king-addons'),
1997 'type' => Controls_Manager::COLOR,
1998 'default' => '#E8E8E8',
1999 'selectors' => [
2000 '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'border-color: {{VALUE}}',
2001 ],
2002 ]
2003 );
2004
2005 $this->add_control(
2006 'overlay_border_type',
2007 [
2008 'label' => esc_html__('Border Type', 'king-addons'),
2009 'type' => Controls_Manager::SELECT,
2010 'options' => [
2011 'none' => esc_html__('None', 'king-addons'),
2012 'solid' => esc_html__('Solid', 'king-addons'),
2013 'double' => esc_html__('Double', 'king-addons'),
2014 'dotted' => esc_html__('Dotted', 'king-addons'),
2015 'dashed' => esc_html__('Dashed', 'king-addons'),
2016 'groove' => esc_html__('Groove', 'king-addons'),
2017 ],
2018 'default' => 'none',
2019 'selectors' => [
2020 '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'border-style: {{VALUE}};',
2021 ],
2022 ]
2023 );
2024
2025 $this->add_control(
2026 'overlay_border_width',
2027 [
2028 'label' => esc_html__('Border Width', 'king-addons'),
2029 'type' => Controls_Manager::DIMENSIONS,
2030 'size_units' => ['px'],
2031 'default' => [
2032 'top' => 1,
2033 'right' => 1,
2034 'bottom' => 1,
2035 'left' => 1,
2036 ],
2037 'selectors' => [
2038 '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2039 ],
2040 'condition' => [
2041 'overlay_border_type!' => 'none',
2042 ],
2043 ]
2044 );
2045
2046 $this->add_control(
2047 'overlay_radius',
2048 [
2049 'label' => esc_html__('Border Radius', 'king-addons'),
2050 'type' => Controls_Manager::DIMENSIONS,
2051 'size_units' => ['px', '%'],
2052 'default' => [
2053 'top' => 0,
2054 'right' => 0,
2055 'bottom' => 0,
2056 'left' => 0,
2057 ],
2058 'selectors' => [
2059 '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2060 ],
2061 'separator' => 'before',
2062 ]
2063 );
2064
2065 $this->end_controls_section();
2066
2067
2068 $this->start_controls_section(
2069 'section_style_title',
2070 [
2071 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Title', 'king-addons'),
2072 'tab' => Controls_Manager::TAB_STYLE,
2073 'show_label' => false,
2074 ]
2075 );
2076
2077 $this->start_controls_tabs('tabs_grid_title_style');
2078
2079 $this->start_controls_tab(
2080 'tab_grid_title_normal',
2081 [
2082 'label' => esc_html__('Normal', 'king-addons'),
2083 ]
2084 );
2085
2086 $this->add_control(
2087 'title_color',
2088 [
2089 'label' => esc_html__('Color', 'king-addons'),
2090 'type' => Controls_Manager::COLOR,
2091 'default' => '#ffffff',
2092 'selectors' => [
2093 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'color: {{VALUE}}',
2094 ],
2095 ]
2096 );
2097
2098 $this->add_control(
2099 'title_bg_color',
2100 [
2101 'label' => esc_html__('Background Color', 'king-addons'),
2102 'type' => Controls_Manager::COLOR,
2103 'selectors' => [
2104 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'background-color: {{VALUE}}',
2105 ]
2106 ]
2107 );
2108
2109 $this->add_control(
2110 'title_border_color',
2111 [
2112 'label' => esc_html__('Border Color', 'king-addons'),
2113 'type' => Controls_Manager::COLOR,
2114 'default' => '#E8E8E8',
2115 'selectors' => [
2116 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'border-color: {{VALUE}}',
2117 ],
2118 'separator' => 'after',
2119 ]
2120 );
2121
2122 $this->end_controls_tab();
2123
2124 $this->start_controls_tab(
2125 'tab_grid_title_hover',
2126 [
2127 'label' => esc_html__('Hover', 'king-addons'),
2128 ]
2129 );
2130
2131 $this->add_control(
2132 'title_color_hr',
2133 [
2134 'label' => esc_html__('Color', 'king-addons'),
2135 'type' => Controls_Manager::COLOR,
2136 'default' => '#FFFFFF',
2137 'selectors' => [
2138 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a:hover' => 'color: {{VALUE}}',
2139 ],
2140 ]
2141 );
2142
2143 $this->add_control(
2144 'title_bg_color_hr',
2145 [
2146 'label' => esc_html__('Background Color', 'king-addons'),
2147 'type' => Controls_Manager::COLOR,
2148 'selectors' => [
2149 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a:hover' => 'background-color: {{VALUE}}',
2150 ]
2151 ]
2152 );
2153
2154 $this->add_control(
2155 'title_border_color_hr',
2156 [
2157 'label' => esc_html__('Border Color', 'king-addons'),
2158 'type' => Controls_Manager::COLOR,
2159 'default' => '#E8E8E8',
2160 'selectors' => [
2161 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a:hover' => 'border-color: {{VALUE}}',
2162 ],
2163 ]
2164 );
2165
2166 $this->add_control_title_pointer_color_hr();
2167
2168 $this->end_controls_tab();
2169
2170 $this->end_controls_tabs();
2171
2172 $this->add_control_title_pointer();
2173
2174 $this->add_control_title_pointer_height();
2175
2176 $this->add_control_title_pointer_animation();
2177
2178 $this->add_control(
2179 'title_transition_duration',
2180 [
2181 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'),
2182 'type' => Controls_Manager::NUMBER,
2183 'default' => 0.1,
2184 'min' => 0,
2185 'max' => 5,
2186 'step' => 0.1,
2187 'selectors' => [
2188 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'transition-duration: {{VALUE}}s',
2189 '{{WRAPPER}} .king-addons-grid-item-title .king-addons-pointer-item:before' => 'transition-duration: {{VALUE}}s',
2190 '{{WRAPPER}} .king-addons-grid-item-title .king-addons-pointer-item:after' => 'transition-duration: {{VALUE}}s',
2191 ],
2192 'separator' => 'after',
2193 ]
2194 );
2195
2196 $this->add_group_control(
2197 Group_Control_Typography::get_type(),
2198 [
2199 'name' => 'title_typography',
2200 'selector' => '{{WRAPPER}} .king-addons-grid-item-title a'
2201 ]
2202 );
2203
2204 $this->add_responsive_control(
2205 'title_featured_box_size',
2206 [
2207 'type' => Controls_Manager::SLIDER,
2208 'label' => esc_html__('Featured Box Title Font Size', 'king-addons'),
2209 'range' => [
2210 'px' => [
2211 'min' => 10,
2212 'max' => 100,
2213 ],
2214 ],
2215 'default' => [
2216 'unit' => 'px',
2217 'size' => 38,
2218 ],
2219 'selectors' => [
2220 '{{WRAPPER}} .king-addons-magazine-grid-add-1-2 article:nth-child(1) .king-addons-grid-item-title a' => 'font-size: {{SIZE}}px;',
2221 '{{WRAPPER}} .king-addons-magazine-grid-add-1-3 article:nth-child(1) .king-addons-grid-item-title a' => 'font-size: {{SIZE}}px;',
2222 '{{WRAPPER}} .king-addons-magazine-grid-add-1-4 article:nth-child(1) .king-addons-grid-item-title a' => 'font-size: {{SIZE}}px;',
2223 '{{WRAPPER}} .king-addons-magazine-grid-add-1-1-2 article:nth-child(1) .king-addons-grid-item-title a' => 'font-size: {{SIZE}}px;',
2224 '{{WRAPPER}} .king-addons-magazine-grid-add-2-1-2 article:nth-child(2) .king-addons-grid-item-title a' => 'font-size: {{SIZE}}px;',
2225 '{{WRAPPER}} .king-addons-magazine-grid-add-1vh-3h article:nth-child(1) .king-addons-grid-item-title a' => 'font-size: {{SIZE}}px;',
2226 '{{WRAPPER}} .king-addons-magazine-grid-add-1-1-1 article:nth-child(2) .king-addons-grid-item-title a' => 'font-size: {{SIZE}}px;',
2227 ],
2228 'condition' => [
2229 'king_addons_grid_layout_select' => ['1-2', '1-3', '1-4', '1-1-2', '2-1-2', '1vh-3h', '1-1-1']
2230 ]
2231 ]
2232 );
2233
2234 $this->add_control(
2235 'title_border_type',
2236 [
2237 'label' => esc_html__('Border Type', 'king-addons'),
2238 'type' => Controls_Manager::SELECT,
2239 'options' => [
2240 'none' => esc_html__('None', 'king-addons'),
2241 'solid' => esc_html__('Solid', 'king-addons'),
2242 'double' => esc_html__('Double', 'king-addons'),
2243 'dotted' => esc_html__('Dotted', 'king-addons'),
2244 'dashed' => esc_html__('Dashed', 'king-addons'),
2245 'groove' => esc_html__('Groove', 'king-addons'),
2246 ],
2247 'default' => 'none',
2248 'selectors' => [
2249 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'border-style: {{VALUE}};',
2250 ],
2251 'render_type' => 'template',
2252 'separator' => 'before',
2253 ]
2254 );
2255
2256 $this->add_control(
2257 'title_border_width',
2258 [
2259 'label' => esc_html__('Border Width', 'king-addons'),
2260 'type' => Controls_Manager::DIMENSIONS,
2261 'size_units' => ['px'],
2262 'default' => [
2263 'top' => 1,
2264 'right' => 1,
2265 'bottom' => 1,
2266 'left' => 1,
2267 ],
2268 'selectors' => [
2269 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2270 ],
2271 'render_type' => 'template',
2272 'condition' => [
2273 'title_border_type!' => 'none',
2274 ],
2275 ]
2276 );
2277
2278 $this->add_responsive_control(
2279 'title_padding',
2280 [
2281 'label' => esc_html__('Padding', 'king-addons'),
2282 'type' => Controls_Manager::DIMENSIONS,
2283 'size_units' => ['px', '%'],
2284 'default' => [
2285 'top' => 0,
2286 'right' => 0,
2287 'bottom' => 0,
2288 'left' => 0,
2289 ],
2290 'selectors' => [
2291 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2292 ],
2293 'render_type' => 'template',
2294 'separator' => 'before',
2295 ]
2296 );
2297
2298 $this->add_responsive_control(
2299 'title_margin',
2300 [
2301 'label' => esc_html__('Margin', 'king-addons'),
2302 'type' => Controls_Manager::DIMENSIONS,
2303 'size_units' => ['px', '%'],
2304 'default' => [
2305 'top' => 0,
2306 'right' => 0,
2307 'bottom' => 5,
2308 'left' => 20,
2309 ],
2310 'selectors' => [
2311 '{{WRAPPER}} .king-addons-grid-item-title .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2312 ],
2313 'render_type' => 'template',
2314 ]
2315 );
2316
2317 $this->end_controls_section();
2318
2319
2320 $this->start_controls_section(
2321 'section_style_content',
2322 [
2323 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Content', 'king-addons'),
2324 'tab' => Controls_Manager::TAB_STYLE,
2325 'show_label' => false,
2326 ]
2327 );
2328
2329 $this->add_control(
2330 'content_color',
2331 [
2332 'label' => esc_html__('Color', 'king-addons'),
2333 'type' => Controls_Manager::COLOR,
2334 'default' => '#ffffff',
2335 'selectors' => [
2336 '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'color: {{VALUE}}',
2337 ],
2338 ]
2339 );
2340
2341 $this->add_control(
2342 'content_dropcap_color',
2343 [
2344 'label' => esc_html__('DropCap Color', 'king-addons'),
2345 'type' => Controls_Manager::COLOR,
2346 'default' => '#3a3a3a',
2347 'selectors' => [
2348 '{{WRAPPER}} .king-addons-grid-item-content.king-addons-enable-dropcap p:first-child:first-letter' => 'color: {{VALUE}}',
2349 ],
2350 ]
2351 );
2352
2353 $this->add_control(
2354 'content_bg_color',
2355 [
2356 'label' => esc_html__('Background Color', 'king-addons'),
2357 'type' => Controls_Manager::COLOR,
2358 'selectors' => [
2359 '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'background-color: {{VALUE}}',
2360 ]
2361 ]
2362 );
2363
2364 $this->add_control(
2365 'content_border_color',
2366 [
2367 'label' => esc_html__('Border Color', 'king-addons'),
2368 'type' => Controls_Manager::COLOR,
2369 'default' => '#E8E8E8',
2370 'selectors' => [
2371 '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'border-color: {{VALUE}}',
2372 ],
2373 'separator' => 'after',
2374 ]
2375 );
2376
2377 $this->add_group_control(
2378 Group_Control_Typography::get_type(),
2379 [
2380 'name' => 'content_typography',
2381 'selector' => '{{WRAPPER}} .king-addons-grid-item-content'
2382 ]
2383 );
2384
2385 $this->add_group_control(
2386 Group_Control_Typography::get_type(),
2387 [
2388 'name' => 'content_dropcap_typography',
2389 'label' => esc_html__('Drop Cap Typography', 'king-addons'),
2390 'selector' => '{{WRAPPER}} .king-addons-grid-item-content.king-addons-enable-dropcap p:first-child:first-letter'
2391 ]
2392 );
2393
2394 $this->add_responsive_control(
2395 'content_justify',
2396 [
2397 'label' => esc_html__('Justify Text', 'king-addons'),
2398 'type' => Controls_Manager::SWITCHER,
2399 'default' => '',
2400 'widescreen_default' => '',
2401 'laptop_default' => '',
2402 'tablet_extra_default' => '',
2403 'tablet_default' => '',
2404 'mobile_extra_default' => '',
2405 'mobile_default' => '',
2406 'selectors_dictionary' => [
2407 '' => '',
2408 'yes' => 'text-align: justify;'
2409 ],
2410 'selectors' => [
2411 '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => '{{VALUE}}',
2412 ],
2413 'render_type' => 'template',
2414 ]
2415 );
2416
2417 $this->add_control(
2418 'content_border_type',
2419 [
2420 'label' => esc_html__('Border Type', 'king-addons'),
2421 'type' => Controls_Manager::SELECT,
2422 'options' => [
2423 'none' => esc_html__('None', 'king-addons'),
2424 'solid' => esc_html__('Solid', 'king-addons'),
2425 'double' => esc_html__('Double', 'king-addons'),
2426 'dotted' => esc_html__('Dotted', 'king-addons'),
2427 'dashed' => esc_html__('Dashed', 'king-addons'),
2428 'groove' => esc_html__('Groove', 'king-addons'),
2429 ],
2430 'default' => 'none',
2431 'selectors' => [
2432 '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'border-style: {{VALUE}};',
2433 ],
2434 'render_type' => 'template',
2435 'separator' => 'before',
2436 ]
2437 );
2438
2439 $this->add_control(
2440 'content_border_width',
2441 [
2442 'label' => esc_html__('Border Width', 'king-addons'),
2443 'type' => Controls_Manager::DIMENSIONS,
2444 'size_units' => ['px'],
2445 'default' => [
2446 'top' => 1,
2447 'right' => 1,
2448 'bottom' => 1,
2449 'left' => 1,
2450 ],
2451 'selectors' => [
2452 '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2453 ],
2454 'render_type' => 'template',
2455 'condition' => [
2456 'content_border_type!' => 'none',
2457 ],
2458 ]
2459 );
2460
2461 $this->add_responsive_control(
2462 'content_padding',
2463 [
2464 'label' => esc_html__('Padding', 'king-addons'),
2465 'type' => Controls_Manager::DIMENSIONS,
2466 'size_units' => ['px', '%'],
2467 'default' => [
2468 'top' => 0,
2469 'right' => 0,
2470 'bottom' => 0,
2471 'left' => 0,
2472 ],
2473 'selectors' => [
2474 '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2475 ],
2476 'render_type' => 'template',
2477 'separator' => 'before',
2478 ]
2479 );
2480
2481 $this->add_responsive_control(
2482 'content_margin',
2483 [
2484 'label' => esc_html__('Margin', 'king-addons'),
2485 'type' => Controls_Manager::DIMENSIONS,
2486 'size_units' => ['px', '%'],
2487 'default' => [
2488 'top' => 0,
2489 'right' => 0,
2490 'bottom' => 0,
2491 'left' => 0,
2492 ],
2493 'render_type' => 'template',
2494 'selectors' => [
2495 '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2496 ],
2497 ]
2498 );
2499
2500 $this->end_controls_section();
2501
2502
2503 $this->start_controls_section(
2504 'section_style_excerpt',
2505 [
2506 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Excerpt', 'king-addons'),
2507 'tab' => Controls_Manager::TAB_STYLE,
2508 'show_label' => false,
2509 ]
2510 );
2511
2512 $this->add_control(
2513 'excerpt_color',
2514 [
2515 'label' => esc_html__('Color', 'king-addons'),
2516 'type' => Controls_Manager::COLOR,
2517 'default' => '#ffffff',
2518 'selectors' => [
2519 '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'color: {{VALUE}}',
2520 ],
2521 ]
2522 );
2523
2524 $this->add_control(
2525 'excerpt_dropcap_color',
2526 [
2527 'label' => esc_html__('DropCap Color', 'king-addons'),
2528 'type' => Controls_Manager::COLOR,
2529 'default' => '#3a3a3a',
2530 'selectors' => [
2531 '{{WRAPPER}} .king-addons-grid-item-excerpt.king-addons-enable-dropcap p:first-child:first-letter' => 'color: {{VALUE}}',
2532 ],
2533 ]
2534 );
2535
2536 $this->add_control(
2537 'excerpt_bg_color',
2538 [
2539 'label' => esc_html__('Background Color', 'king-addons'),
2540 'type' => Controls_Manager::COLOR,
2541 'selectors' => [
2542 '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'background-color: {{VALUE}}',
2543 ]
2544 ]
2545 );
2546
2547 $this->add_control(
2548 'excerpt_border_color',
2549 [
2550 'label' => esc_html__('Border Color', 'king-addons'),
2551 'type' => Controls_Manager::COLOR,
2552 'default' => '#E8E8E8',
2553 'selectors' => [
2554 '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'border-color: {{VALUE}}',
2555 ],
2556 'separator' => 'after',
2557 ]
2558 );
2559
2560 $this->add_group_control(
2561 Group_Control_Typography::get_type(),
2562 [
2563 'name' => 'excerpt_typography',
2564 'selector' => '{{WRAPPER}} .king-addons-grid-item-excerpt'
2565 ]
2566 );
2567
2568 $this->add_group_control(
2569 Group_Control_Typography::get_type(),
2570 [
2571 'name' => 'excerpt_dropcap_typography',
2572 'label' => esc_html__('Drop Cap Typography', 'king-addons'),
2573 'selector' => '{{WRAPPER}} .king-addons-grid-item-excerpt.king-addons-enable-dropcap p:first-child:first-letter'
2574 ]
2575 );
2576
2577 $this->add_responsive_control(
2578 'excerpt_justify',
2579 [
2580 'label' => esc_html__('Justify Text', 'king-addons'),
2581 'type' => Controls_Manager::SWITCHER,
2582 'default' => '',
2583 'widescreen_default' => '',
2584 'laptop_default' => '',
2585 'tablet_extra_default' => '',
2586 'tablet_default' => '',
2587 'mobile_extra_default' => '',
2588 'mobile_default' => '',
2589 'selectors_dictionary' => [
2590 '' => '',
2591 'yes' => 'text-align: justify;'
2592 ],
2593 'selectors' => [
2594 '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => '{{VALUE}}',
2595 ],
2596 'render_type' => 'template',
2597 ]
2598 );
2599
2600 $this->add_control(
2601 'excerpt_border_type',
2602 [
2603 'label' => esc_html__('Border Type', 'king-addons'),
2604 'type' => Controls_Manager::SELECT,
2605 'options' => [
2606 'none' => esc_html__('None', 'king-addons'),
2607 'solid' => esc_html__('Solid', 'king-addons'),
2608 'double' => esc_html__('Double', 'king-addons'),
2609 'dotted' => esc_html__('Dotted', 'king-addons'),
2610 'dashed' => esc_html__('Dashed', 'king-addons'),
2611 'groove' => esc_html__('Groove', 'king-addons'),
2612 ],
2613 'default' => 'none',
2614 'selectors' => [
2615 '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'border-style: {{VALUE}};',
2616 ],
2617 'render_type' => 'template',
2618 'separator' => 'before',
2619 ]
2620 );
2621
2622 $this->add_control(
2623 'excerpt_border_width',
2624 [
2625 'label' => esc_html__('Border Width', 'king-addons'),
2626 'type' => Controls_Manager::DIMENSIONS,
2627 'size_units' => ['px'],
2628 'default' => [
2629 'top' => 1,
2630 'right' => 1,
2631 'bottom' => 1,
2632 'left' => 1,
2633 ],
2634 'selectors' => [
2635 '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2636 ],
2637 'render_type' => 'template',
2638 'condition' => [
2639 'excerpt_border_type!' => 'none',
2640 ],
2641 ]
2642 );
2643
2644 $this->add_responsive_control(
2645 'excerpt_padding',
2646 [
2647 'label' => esc_html__('Padding', 'king-addons'),
2648 'type' => Controls_Manager::DIMENSIONS,
2649 'size_units' => ['px', '%'],
2650 'default' => [
2651 'top' => 0,
2652 'right' => 0,
2653 'bottom' => 0,
2654 'left' => 0,
2655 ],
2656 'selectors' => [
2657 '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2658 ],
2659 'render_type' => 'template',
2660 'separator' => 'before',
2661 ]
2662 );
2663
2664 $this->add_responsive_control(
2665 'excerpt_margin',
2666 [
2667 'label' => esc_html__('Margin', 'king-addons'),
2668 'type' => Controls_Manager::DIMENSIONS,
2669 'size_units' => ['px', '%'],
2670 'default' => [
2671 'top' => 0,
2672 'right' => 0,
2673 'bottom' => 0,
2674 'left' => 0,
2675 ],
2676 'render_type' => 'template',
2677 'selectors' => [
2678 '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2679 ],
2680 ]
2681 );
2682
2683 $this->end_controls_section();
2684
2685
2686 $this->start_controls_section(
2687 'section_style_date',
2688 [
2689 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Date', 'king-addons'),
2690 'tab' => Controls_Manager::TAB_STYLE,
2691 'show_label' => false,
2692 ]
2693 );
2694
2695 $this->add_control(
2696 'date_color',
2697 [
2698 'label' => esc_html__('Color', 'king-addons'),
2699 'type' => Controls_Manager::COLOR,
2700 'default' => '#ffffff',
2701 'selectors' => [
2702 '{{WRAPPER}} .king-addons-grid-item-date .inner-block' => 'color: {{VALUE}}',
2703 ],
2704 ]
2705 );
2706
2707 $this->add_control(
2708 'date_bg_color',
2709 [
2710 'label' => esc_html__('Background Color', 'king-addons'),
2711 'type' => Controls_Manager::COLOR,
2712 'selectors' => [
2713 '{{WRAPPER}} .king-addons-grid-item-date .inner-block > span' => 'background-color: {{VALUE}}',
2714 ]
2715 ]
2716 );
2717
2718 $this->add_control(
2719 'date_border_color',
2720 [
2721 'label' => esc_html__('Border Color', 'king-addons'),
2722 'type' => Controls_Manager::COLOR,
2723 'default' => '#E8E8E8',
2724 'selectors' => [
2725 '{{WRAPPER}} .king-addons-grid-item-date .inner-block > span' => 'border-color: {{VALUE}}',
2726 ]
2727 ]
2728 );
2729
2730 $this->add_control(
2731 'date_extra_text_color',
2732 [
2733 'label' => esc_html__('Extra Text Color', 'king-addons'),
2734 'type' => Controls_Manager::COLOR,
2735 'default' => '#ffffff',
2736 'selectors' => [
2737 '{{WRAPPER}} .king-addons-grid-item-date .inner-block span[class*="king-addons-grid-extra-text"]' => 'color: {{VALUE}}',
2738 ],
2739 ]
2740 );
2741
2742 $this->add_control(
2743 'date_extra_icon_color',
2744 [
2745 'label' => esc_html__('Extra Icon Color', 'king-addons'),
2746 'type' => Controls_Manager::COLOR,
2747 'default' => '#ffffff',
2748 'selectors' => [
2749 '{{WRAPPER}} .king-addons-grid-item-date .inner-block [class*="king-addons-grid-extra-icon"] i' => 'color: {{VALUE}}',
2750 '{{WRAPPER}} .king-addons-grid-item-date .inner-block [class*="king-addons-grid-extra-icon"] svg' => 'fill: {{VALUE}}'
2751 ],
2752 'separator' => 'after',
2753 ]
2754 );
2755
2756 $this->add_group_control(
2757 Group_Control_Typography::get_type(),
2758 [
2759 'name' => 'date_typography',
2760 'selector' => '{{WRAPPER}} .king-addons-grid-item-date'
2761 ]
2762 );
2763
2764 $this->add_control(
2765 'date_border_type',
2766 [
2767 'label' => esc_html__('Border Type', 'king-addons'),
2768 'type' => Controls_Manager::SELECT,
2769 'options' => [
2770 'none' => esc_html__('None', 'king-addons'),
2771 'solid' => esc_html__('Solid', 'king-addons'),
2772 'double' => esc_html__('Double', 'king-addons'),
2773 'dotted' => esc_html__('Dotted', 'king-addons'),
2774 'dashed' => esc_html__('Dashed', 'king-addons'),
2775 'groove' => esc_html__('Groove', 'king-addons'),
2776 ],
2777 'default' => 'none',
2778 'selectors' => [
2779 '{{WRAPPER}} .king-addons-grid-item-date .inner-block > span' => 'border-style: {{VALUE}};',
2780 ],
2781 'render_type' => 'template',
2782 'separator' => 'before',
2783 ]
2784 );
2785
2786 $this->add_control(
2787 'date_border_width',
2788 [
2789 'label' => esc_html__('Border Width', 'king-addons'),
2790 'type' => Controls_Manager::DIMENSIONS,
2791 'size_units' => ['px'],
2792 'default' => [
2793 'top' => 1,
2794 'right' => 1,
2795 'bottom' => 1,
2796 'left' => 1,
2797 ],
2798 'selectors' => [
2799 '{{WRAPPER}} .king-addons-grid-item-date .inner-block > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2800 ],
2801 'render_type' => 'template',
2802 'condition' => [
2803 'date_border_type!' => 'none',
2804 ],
2805 ]
2806 );
2807
2808 $this->add_control(
2809 'date_text_spacing',
2810 [
2811 'label' => esc_html__('Extra Text Spacing', 'king-addons'),
2812 'type' => Controls_Manager::SLIDER,
2813 'size_units' => ['px'],
2814 'range' => [
2815 'px' => [
2816 'min' => 0,
2817 'max' => 25,
2818 ],
2819 ],
2820 'default' => [
2821 'unit' => 'px',
2822 'size' => 5,
2823 ],
2824 'selectors' => [
2825 '{{WRAPPER}} .king-addons-grid-item-date .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};',
2826 '{{WRAPPER}} .king-addons-grid-item-date .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};',
2827 ],
2828 'separator' => 'before',
2829 ]
2830 );
2831
2832 $this->add_control(
2833 'date_icon_spacing',
2834 [
2835 'label' => esc_html__('Extra Icon Spacing', 'king-addons'),
2836 'type' => Controls_Manager::SLIDER,
2837 'size_units' => ['px'],
2838 'range' => [
2839 'px' => [
2840 'min' => 0,
2841 'max' => 25,
2842 ],
2843 ],
2844 'default' => [
2845 'unit' => 'px',
2846 'size' => 5,
2847 ],
2848 'selectors' => [
2849 '{{WRAPPER}} .king-addons-grid-item-date .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};',
2850 '{{WRAPPER}} .king-addons-grid-item-date .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};',
2851 ],
2852 ]
2853 );
2854
2855 $this->add_responsive_control(
2856 'date_padding',
2857 [
2858 'label' => esc_html__('Padding', 'king-addons'),
2859 'type' => Controls_Manager::DIMENSIONS,
2860 'size_units' => ['px', '%'],
2861 'default' => [
2862 'top' => 0,
2863 'right' => 0,
2864 'bottom' => 0,
2865 'left' => 0,
2866 ],
2867 'selectors' => [
2868 '{{WRAPPER}} .king-addons-grid-item-date .inner-block > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2869 ],
2870 'render_type' => 'template',
2871 'separator' => 'before',
2872 ]
2873 );
2874
2875 $this->add_responsive_control(
2876 'date_margin',
2877 [
2878 'label' => esc_html__('Margin', 'king-addons'),
2879 'type' => Controls_Manager::DIMENSIONS,
2880 'size_units' => ['px', '%'],
2881 'default' => [
2882 'top' => 2,
2883 'right' => 0,
2884 'bottom' => 20,
2885 'left' => 22,
2886 ],
2887 'render_type' => 'template',
2888 'selectors' => [
2889 '{{WRAPPER}} .king-addons-grid-item-date .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2890 ],
2891 ]
2892 );
2893
2894 $this->end_controls_section();
2895
2896
2897 $this->start_controls_section(
2898 'section_style_time',
2899 [
2900 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Time', 'king-addons'),
2901 'tab' => Controls_Manager::TAB_STYLE,
2902 'show_label' => false,
2903 ]
2904 );
2905
2906 $this->add_control(
2907 'time_color',
2908 [
2909 'label' => esc_html__('Color', 'king-addons'),
2910 'type' => Controls_Manager::COLOR,
2911 'default' => '#ffffff',
2912 'selectors' => [
2913 '{{WRAPPER}} .king-addons-grid-item-time .inner-block' => 'color: {{VALUE}}',
2914 ],
2915 ]
2916 );
2917
2918 $this->add_control(
2919 'time_bg_color',
2920 [
2921 'label' => esc_html__('Background Color', 'king-addons'),
2922 'type' => Controls_Manager::COLOR,
2923 'selectors' => [
2924 '{{WRAPPER}} .king-addons-grid-item-time .inner-block > span' => 'background-color: {{VALUE}}',
2925 ]
2926 ]
2927 );
2928
2929 $this->add_control(
2930 'time_border_color',
2931 [
2932 'label' => esc_html__('Border Color', 'king-addons'),
2933 'type' => Controls_Manager::COLOR,
2934 'default' => '#E8E8E8',
2935 'selectors' => [
2936 '{{WRAPPER}} .king-addons-grid-item-time .inner-block > span' => 'border-color: {{VALUE}}',
2937 ],
2938 ]
2939 );
2940
2941 $this->add_control(
2942 'time_extra_text_color',
2943 [
2944 'label' => esc_html__('Extra Text Color', 'king-addons'),
2945 'type' => Controls_Manager::COLOR,
2946 'default' => '#ffffff',
2947 'selectors' => [
2948 '{{WRAPPER}} .king-addons-grid-item-time .inner-block span[class*="king-addons-grid-extra-text"]' => 'color: {{VALUE}}',
2949 ],
2950 ]
2951 );
2952
2953 $this->add_control(
2954 'time_extra_icon_color',
2955 [
2956 'label' => esc_html__('Extra Icon Color', 'king-addons'),
2957 'type' => Controls_Manager::COLOR,
2958 'default' => '#ffffff',
2959 'selectors' => [
2960 '{{WRAPPER}} .king-addons-grid-item-time .inner-block [class*="king-addons-grid-extra-icon"] i' => 'color: {{VALUE}}',
2961 '{{WRAPPER}} .king-addons-grid-item-time .inner-block [class*="king-addons-grid-extra-icon"] svg' => 'fill: {{VALUE}}'
2962 ],
2963 'separator' => 'after',
2964 ]
2965 );
2966
2967 $this->add_group_control(
2968 Group_Control_Typography::get_type(),
2969 [
2970 'name' => 'time_typography',
2971 'selector' => '{{WRAPPER}} .king-addons-grid-item-time'
2972 ]
2973 );
2974
2975 $this->add_control(
2976 'time_border_type',
2977 [
2978 'label' => esc_html__('Border Type', 'king-addons'),
2979 'type' => Controls_Manager::SELECT,
2980 'options' => [
2981 'none' => esc_html__('None', 'king-addons'),
2982 'solid' => esc_html__('Solid', 'king-addons'),
2983 'double' => esc_html__('Double', 'king-addons'),
2984 'dotted' => esc_html__('Dotted', 'king-addons'),
2985 'dashed' => esc_html__('Dashed', 'king-addons'),
2986 'groove' => esc_html__('Groove', 'king-addons'),
2987 ],
2988 'default' => 'none',
2989 'selectors' => [
2990 '{{WRAPPER}} .king-addons-grid-item-time .inner-block > span' => 'border-style: {{VALUE}};',
2991 ],
2992 'render_type' => 'template',
2993 'separator' => 'before',
2994 ]
2995 );
2996
2997 $this->add_control(
2998 'time_border_width',
2999 [
3000 'label' => esc_html__('Border Width', 'king-addons'),
3001 'type' => Controls_Manager::DIMENSIONS,
3002 'size_units' => ['px'],
3003 'default' => [
3004 'top' => 1,
3005 'right' => 1,
3006 'bottom' => 1,
3007 'left' => 1,
3008 ],
3009 'selectors' => [
3010 '{{WRAPPER}} .king-addons-grid-item-time .inner-block > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3011 ],
3012 'render_type' => 'template',
3013 'condition' => [
3014 'time_border_type!' => 'none',
3015 ],
3016 ]
3017 );
3018
3019 $this->add_control(
3020 'time_text_spacing',
3021 [
3022 'label' => esc_html__('Extra Text Spacing', 'king-addons'),
3023 'type' => Controls_Manager::SLIDER,
3024 'size_units' => ['px'],
3025 'range' => [
3026 'px' => [
3027 'min' => 0,
3028 'max' => 25,
3029 ],
3030 ],
3031 'default' => [
3032 'unit' => 'px',
3033 'size' => 5,
3034 ],
3035 'selectors' => [
3036 '{{WRAPPER}} .king-addons-grid-item-time .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};',
3037 '{{WRAPPER}} .king-addons-grid-item-time .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};',
3038 ],
3039 'separator' => 'before',
3040 ]
3041 );
3042
3043 $this->add_control(
3044 'time_icon_spacing',
3045 [
3046 'label' => esc_html__('Extra Icon Spacing', 'king-addons'),
3047 'type' => Controls_Manager::SLIDER,
3048 'size_units' => ['px'],
3049 'range' => [
3050 'px' => [
3051 'min' => 0,
3052 'max' => 25,
3053 ],
3054 ],
3055 'default' => [
3056 'unit' => 'px',
3057 'size' => 5,
3058 ],
3059 'selectors' => [
3060 '{{WRAPPER}} .king-addons-grid-item-time .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};',
3061 '{{WRAPPER}} .king-addons-grid-item-time .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};',
3062 ],
3063 ]
3064 );
3065
3066 $this->add_responsive_control(
3067 'time_padding',
3068 [
3069 'label' => esc_html__('Padding', 'king-addons'),
3070 'type' => Controls_Manager::DIMENSIONS,
3071 'size_units' => ['px', '%'],
3072 'default' => [
3073 'top' => 0,
3074 'right' => 0,
3075 'bottom' => 0,
3076 'left' => 0,
3077 ],
3078 'selectors' => [
3079 '{{WRAPPER}} .king-addons-grid-item-time .inner-block > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3080 ],
3081 'render_type' => 'template',
3082 'separator' => 'before',
3083 ]
3084 );
3085
3086 $this->add_responsive_control(
3087 'time_margin',
3088 [
3089 'label' => esc_html__('Margin', 'king-addons'),
3090 'type' => Controls_Manager::DIMENSIONS,
3091 'size_units' => ['px', '%'],
3092 'default' => [
3093 'top' => 0,
3094 'right' => 0,
3095 'bottom' => 0,
3096 'left' => 0,
3097 ],
3098 'selectors' => [
3099 '{{WRAPPER}} .king-addons-grid-item-time .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3100 ],
3101 'render_type' => 'template',
3102 ]
3103 );
3104
3105 $this->end_controls_section();
3106
3107
3108 $this->start_controls_section(
3109 'section_style_author',
3110 [
3111 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Author', 'king-addons'),
3112 'tab' => Controls_Manager::TAB_STYLE,
3113 'show_label' => false,
3114 ]
3115 );
3116
3117 $this->start_controls_tabs('tabs_grid_author_style');
3118
3119 $this->start_controls_tab(
3120 'tab_grid_author_normal',
3121 [
3122 'label' => esc_html__('Normal', 'king-addons'),
3123 ]
3124 );
3125
3126 $this->add_control(
3127 'author_color',
3128 [
3129 'label' => esc_html__('Color', 'king-addons'),
3130 'type' => Controls_Manager::COLOR,
3131 'default' => '#ffffff',
3132 'selectors' => [
3133 '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'color: {{VALUE}}',
3134 ],
3135 ]
3136 );
3137
3138 $this->add_control(
3139 'author_bg_color',
3140 [
3141 'label' => esc_html__('Background Color', 'king-addons'),
3142 'type' => Controls_Manager::COLOR,
3143 'selectors' => [
3144 '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'background-color: {{VALUE}}',
3145 ]
3146 ]
3147 );
3148
3149 $this->add_control(
3150 'author_border_color',
3151 [
3152 'label' => esc_html__('Border Color', 'king-addons'),
3153 'type' => Controls_Manager::COLOR,
3154 'default' => '#E8E8E8',
3155 'selectors' => [
3156 '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'border-color: {{VALUE}}',
3157 ],
3158 ]
3159 );
3160
3161 $this->add_control(
3162 'author_extra_text_color',
3163 [
3164 'label' => esc_html__('Extra Text Color', 'king-addons'),
3165 'type' => Controls_Manager::COLOR,
3166 'default' => '#ffffff',
3167 'selectors' => [
3168 '{{WRAPPER}} .king-addons-grid-item-author .inner-block span[class*="king-addons-grid-extra-text"]' => 'color: {{VALUE}}',
3169 ],
3170 'separator' => 'after',
3171 ]
3172 );
3173
3174 $this->end_controls_tab();
3175
3176 $this->start_controls_tab(
3177 'tab_grid_author_hover',
3178 [
3179 'label' => esc_html__('Hover', 'king-addons'),
3180 ]
3181 );
3182
3183 $this->add_control(
3184 'author_color_hr',
3185 [
3186 'label' => esc_html__('Color', 'king-addons'),
3187 'type' => Controls_Manager::COLOR,
3188 'default' => '#5B03FF',
3189 'selectors' => [
3190 '{{WRAPPER}} .king-addons-grid-item-author .inner-block a:hover' => 'color: {{VALUE}}',
3191 ],
3192 ]
3193 );
3194
3195 $this->add_control(
3196 'author_bg_color_hr',
3197 [
3198 'label' => esc_html__('Background Color', 'king-addons'),
3199 'type' => Controls_Manager::COLOR,
3200 'selectors' => [
3201 '{{WRAPPER}} .king-addons-grid-item-author .inner-block a:hover' => 'background-color: {{VALUE}}',
3202 ]
3203 ]
3204 );
3205
3206 $this->add_control(
3207 'author_border_color_hr',
3208 [
3209 'label' => esc_html__('Border Color', 'king-addons'),
3210 'type' => Controls_Manager::COLOR,
3211 'default' => '#E8E8E8',
3212 'selectors' => [
3213 '{{WRAPPER}} .king-addons-grid-item-author .inner-block a:hover' => 'border-color: {{VALUE}}',
3214 ],
3215 'separator' => 'after',
3216 ]
3217 );
3218
3219 $this->end_controls_tab();
3220
3221 $this->end_controls_tabs();
3222
3223 $this->add_control(
3224 'author_transition_duration',
3225 [
3226 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'),
3227 'type' => Controls_Manager::NUMBER,
3228 'default' => 0.1,
3229 'min' => 0,
3230 'max' => 5,
3231 'step' => 0.1,
3232 'selectors' => [
3233 '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'transition-duration: {{VALUE}}s',
3234 ],
3235 'separator' => 'after',
3236 ]
3237 );
3238
3239 $this->add_group_control(
3240 Group_Control_Typography::get_type(),
3241 [
3242 'name' => 'author_typography',
3243 'selector' => '{{WRAPPER}} .king-addons-grid-item-author'
3244 ]
3245 );
3246
3247 $this->add_control(
3248 'author_border_type',
3249 [
3250 'label' => esc_html__('Border Type', 'king-addons'),
3251 'type' => Controls_Manager::SELECT,
3252 'options' => [
3253 'none' => esc_html__('None', 'king-addons'),
3254 'solid' => esc_html__('Solid', 'king-addons'),
3255 'double' => esc_html__('Double', 'king-addons'),
3256 'dotted' => esc_html__('Dotted', 'king-addons'),
3257 'dashed' => esc_html__('Dashed', 'king-addons'),
3258 'groove' => esc_html__('Groove', 'king-addons'),
3259 ],
3260 'default' => 'none',
3261 'selectors' => [
3262 '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'border-style: {{VALUE}};',
3263 ],
3264 'render_type' => 'template',
3265 'separator' => 'before',
3266 ]
3267 );
3268
3269 $this->add_control(
3270 'author_border_width',
3271 [
3272 'label' => esc_html__('Border Width', 'king-addons'),
3273 'type' => Controls_Manager::DIMENSIONS,
3274 'size_units' => ['px'],
3275 'default' => [
3276 'top' => 1,
3277 'right' => 1,
3278 'bottom' => 1,
3279 'left' => 1,
3280 ],
3281 'selectors' => [
3282 '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3283 ],
3284 'render_type' => 'template',
3285 'condition' => [
3286 'author_border_type!' => 'none',
3287 ],
3288 ]
3289 );
3290
3291 $this->add_control(
3292 'author_border_radius',
3293 [
3294 'label' => esc_html__('Border Radius', 'king-addons'),
3295 'type' => Controls_Manager::DIMENSIONS,
3296 'size_units' => ['px'],
3297 'default' => [
3298 'top' => 0,
3299 'right' => 0,
3300 'bottom' => 0,
3301 'left' => 0,
3302 ],
3303 'selectors' => [
3304 '{{WRAPPER}} .king-addons-grid-item-author .inner-block a img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3305 ]
3306 ]
3307 );
3308
3309 $this->add_control(
3310 'author_text_spacing',
3311 [
3312 'label' => esc_html__('Extra Text Spacing', 'king-addons'),
3313 'type' => Controls_Manager::SLIDER,
3314 'size_units' => ['px'],
3315 'range' => [
3316 'px' => [
3317 'min' => 0,
3318 'max' => 25,
3319 ],
3320 ],
3321 'default' => [
3322 'unit' => 'px',
3323 'size' => 5,
3324 ],
3325 'selectors' => [
3326 '{{WRAPPER}} .king-addons-grid-item-author .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};',
3327 '{{WRAPPER}} .king-addons-grid-item-author .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};',
3328 ],
3329 'separator' => 'before',
3330 ]
3331 );
3332
3333 $this->add_control(
3334 'author_icon_spacing',
3335 [
3336 'label' => esc_html__('Extra Icon Spacing', 'king-addons'),
3337 'type' => Controls_Manager::SLIDER,
3338 'size_units' => ['px'],
3339 'range' => [
3340 'px' => [
3341 'min' => 0,
3342 'max' => 25,
3343 ],
3344 ],
3345 'default' => [
3346 'unit' => 'px',
3347 'size' => 5,
3348 ],
3349 'selectors' => [
3350 '{{WRAPPER}} .king-addons-grid-item-author .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};',
3351 '{{WRAPPER}} .king-addons-grid-item-author .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};',
3352 ],
3353 ]
3354 );
3355
3356 $this->add_control(
3357 'author_avatar_spacing',
3358 [
3359 'label' => esc_html__('Avatar Spacing', 'king-addons'),
3360 'type' => Controls_Manager::SLIDER,
3361 'size_units' => ['px'],
3362 'range' => [
3363 'px' => [
3364 'min' => 0,
3365 'max' => 25,
3366 ],
3367 ],
3368 'default' => [
3369 'unit' => 'px',
3370 'size' => 10,
3371 ],
3372 'selectors' => [
3373 '{{WRAPPER}} .king-addons-grid-item-author img' => 'margin-right: {{SIZE}}{{UNIT}};',
3374 ],
3375 ]
3376 );
3377
3378 $this->add_responsive_control(
3379 'author_padding',
3380 [
3381 'label' => esc_html__('Padding', 'king-addons'),
3382 'type' => Controls_Manager::DIMENSIONS,
3383 'size_units' => ['px', '%'],
3384 'default' => [
3385 'top' => 0,
3386 'right' => 0,
3387 'bottom' => 0,
3388 'left' => 0,
3389 ],
3390 'selectors' => [
3391 '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3392 ],
3393 'render_type' => 'template',
3394 'separator' => 'before',
3395 ]
3396 );
3397
3398 $this->add_responsive_control(
3399 'author_margin',
3400 [
3401 'label' => esc_html__('Margin', 'king-addons'),
3402 'type' => Controls_Manager::DIMENSIONS,
3403 'size_units' => ['px', '%'],
3404 'default' => [
3405 'top' => 1,
3406 'right' => 10,
3407 'bottom' => 0,
3408 'left' => 22,
3409 ],
3410 'render_type' => 'template',
3411 'selectors' => [
3412 '{{WRAPPER}} .king-addons-grid-item-author .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3413 ],
3414 ]
3415 );
3416
3417 $this->end_controls_section();
3418
3419
3420 $this->start_controls_section(
3421 'section_style_comments',
3422 [
3423 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Comments', 'king-addons'),
3424 'tab' => Controls_Manager::TAB_STYLE,
3425 'show_label' => false,
3426 ]
3427 );
3428
3429 $this->start_controls_tabs('tabs_grid_comments_style');
3430
3431 $this->start_controls_tab(
3432 'tab_grid_comments_normal',
3433 [
3434 'label' => esc_html__('Normal', 'king-addons'),
3435 ]
3436 );
3437
3438 $this->add_control(
3439 'comments_color',
3440 [
3441 'label' => esc_html__('Color', 'king-addons'),
3442 'type' => Controls_Manager::COLOR,
3443 'default' => '#ffffff',
3444 'selectors' => [
3445 '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'color: {{VALUE}}',
3446 ],
3447 ]
3448 );
3449
3450 $this->add_control(
3451 'comments_bg_color',
3452 [
3453 'label' => esc_html__('Background Color', 'king-addons'),
3454 'type' => Controls_Manager::COLOR,
3455 'selectors' => [
3456 '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'background-color: {{VALUE}}',
3457 ]
3458 ]
3459 );
3460
3461 $this->add_control(
3462 'comments_border_color',
3463 [
3464 'label' => esc_html__('Border Color', 'king-addons'),
3465 'type' => Controls_Manager::COLOR,
3466 'default' => '#E8E8E8',
3467 'selectors' => [
3468 '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'border-color: {{VALUE}}',
3469 ],
3470 ]
3471 );
3472
3473 $this->add_control(
3474 'comments_extra_text_color',
3475 [
3476 'label' => esc_html__('Extra Text Color', 'king-addons'),
3477 'type' => Controls_Manager::COLOR,
3478 'default' => '#ffffff',
3479 'selectors' => [
3480 '{{WRAPPER}} .king-addons-grid-item-comments .inner-block span[class*="king-addons-grid-extra-text"]' => 'color: {{VALUE}}',
3481 ],
3482 'separator' => 'after',
3483 ]
3484 );
3485
3486 $this->end_controls_tab();
3487
3488 $this->start_controls_tab(
3489 'tab_grid_comments_hover',
3490 [
3491 'label' => esc_html__('Hover', 'king-addons'),
3492 ]
3493 );
3494
3495 $this->add_control(
3496 'comments_color_hr',
3497 [
3498 'label' => esc_html__('Color', 'king-addons'),
3499 'type' => Controls_Manager::COLOR,
3500 'default' => '#5B03FF',
3501 'selectors' => [
3502 '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a:hover' => 'color: {{VALUE}}',
3503 ],
3504 ]
3505 );
3506
3507 $this->add_control(
3508 'comments_bg_color_hr',
3509 [
3510 'label' => esc_html__('Background Color', 'king-addons'),
3511 'type' => Controls_Manager::COLOR,
3512 'selectors' => [
3513 '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a:hover' => 'background-color: {{VALUE}}',
3514 ]
3515 ]
3516 );
3517
3518 $this->add_control(
3519 'comments_border_color_hr',
3520 [
3521 'label' => esc_html__('Border Color', 'king-addons'),
3522 'type' => Controls_Manager::COLOR,
3523 'default' => '#E8E8E8',
3524 'selectors' => [
3525 '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a:hover' => 'border-color: {{VALUE}}',
3526 ],
3527 'separator' => 'after',
3528 ]
3529 );
3530
3531 $this->end_controls_tab();
3532
3533 $this->end_controls_tabs();
3534
3535 $this->add_control(
3536 'comments_transition_duration',
3537 [
3538 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'),
3539 'type' => Controls_Manager::NUMBER,
3540 'default' => 0.1,
3541 'min' => 0,
3542 'max' => 5,
3543 'step' => 0.1,
3544 'selectors' => [
3545 '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'transition-duration: {{VALUE}}s',
3546 ],
3547 'separator' => 'after',
3548 ]
3549 );
3550
3551 $this->add_group_control(
3552 Group_Control_Typography::get_type(),
3553 [
3554 'name' => 'comments_typography',
3555 'selector' => '{{WRAPPER}} .king-addons-grid-item-comments'
3556 ]
3557 );
3558
3559 $this->add_control(
3560 'comments_border_type',
3561 [
3562 'label' => esc_html__('Border Type', 'king-addons'),
3563 'type' => Controls_Manager::SELECT,
3564 'options' => [
3565 'none' => esc_html__('None', 'king-addons'),
3566 'solid' => esc_html__('Solid', 'king-addons'),
3567 'double' => esc_html__('Double', 'king-addons'),
3568 'dotted' => esc_html__('Dotted', 'king-addons'),
3569 'dashed' => esc_html__('Dashed', 'king-addons'),
3570 'groove' => esc_html__('Groove', 'king-addons'),
3571 ],
3572 'default' => 'none',
3573 'selectors' => [
3574 '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'border-style: {{VALUE}};',
3575 ],
3576 'render_type' => 'template',
3577 'separator' => 'before',
3578 ]
3579 );
3580
3581 $this->add_control(
3582 'comments_border_width',
3583 [
3584 'label' => esc_html__('Border Width', 'king-addons'),
3585 'type' => Controls_Manager::DIMENSIONS,
3586 'size_units' => ['px'],
3587 'default' => [
3588 'top' => 1,
3589 'right' => 1,
3590 'bottom' => 1,
3591 'left' => 1,
3592 ],
3593 'selectors' => [
3594 '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3595 ],
3596 'render_type' => 'template',
3597 'condition' => [
3598 'comments_border_type!' => 'none',
3599 ],
3600 ]
3601 );
3602
3603 $this->add_control(
3604 'comments_text_spacing',
3605 [
3606 'label' => esc_html__('Extra Text Spacing', 'king-addons'),
3607 'type' => Controls_Manager::SLIDER,
3608 'size_units' => ['px'],
3609 'range' => [
3610 'px' => [
3611 'min' => 0,
3612 'max' => 25,
3613 ],
3614 ],
3615 'default' => [
3616 'unit' => 'px',
3617 'size' => 5,
3618 ],
3619 'selectors' => [
3620 '{{WRAPPER}} .king-addons-grid-item-comments .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};',
3621 '{{WRAPPER}} .king-addons-grid-item-comments .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};',
3622 ],
3623 'separator' => 'before'
3624 ]
3625 );
3626
3627 $this->add_control(
3628 'comments_icon_spacing',
3629 [
3630 'label' => esc_html__('Extra Icon Spacing', 'king-addons'),
3631 'type' => Controls_Manager::SLIDER,
3632 'size_units' => ['px'],
3633 'range' => [
3634 'px' => [
3635 'min' => 0,
3636 'max' => 25,
3637 ],
3638 ],
3639 'default' => [
3640 'unit' => 'px',
3641 'size' => 5,
3642 ],
3643 'selectors' => [
3644 '{{WRAPPER}} .king-addons-grid-item-comments .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};',
3645 '{{WRAPPER}} .king-addons-grid-item-comments .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};',
3646 ],
3647 ]
3648 );
3649
3650 $this->add_responsive_control(
3651 'comments_padding',
3652 [
3653 'label' => esc_html__('Padding', 'king-addons'),
3654 'type' => Controls_Manager::DIMENSIONS,
3655 'size_units' => ['px', '%'],
3656 'default' => [
3657 'top' => 0,
3658 'right' => 0,
3659 'bottom' => 0,
3660 'left' => 0,
3661 ],
3662 'selectors' => [
3663 '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3664 ],
3665 'render_type' => 'template',
3666 'separator' => 'before',
3667 ]
3668 );
3669
3670 $this->add_responsive_control(
3671 'comments_margin',
3672 [
3673 'label' => esc_html__('Margin', 'king-addons'),
3674 'type' => Controls_Manager::DIMENSIONS,
3675 'size_units' => ['px', '%'],
3676 'default' => [
3677 'top' => 0,
3678 'right' => 0,
3679 'bottom' => 0,
3680 'left' => 0,
3681 ],
3682 'selectors' => [
3683 '{{WRAPPER}} .king-addons-grid-item-comments .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3684 ],
3685 'render_type' => 'template',
3686 ]
3687 );
3688
3689 $this->add_control(
3690 'comments_radius',
3691 [
3692 'label' => esc_html__('Border Radius', 'king-addons'),
3693 'type' => Controls_Manager::DIMENSIONS,
3694 'size_units' => ['px', '%'],
3695 'default' => [
3696 'top' => 2,
3697 'right' => 2,
3698 'bottom' => 2,
3699 'left' => 2,
3700 ],
3701 'selectors' => [
3702 '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3703 ],
3704 'separator' => 'before',
3705 ]
3706 );
3707
3708 $this->end_controls_section();
3709
3710
3711 $this->start_controls_section(
3712 'section_style_read_more',
3713 [
3714 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Read More', 'king-addons'),
3715 'tab' => Controls_Manager::TAB_STYLE,
3716 'show_label' => false,
3717 ]
3718 );
3719
3720 $this->start_controls_tabs('tabs_grid_read_more_style');
3721
3722 $this->start_controls_tab(
3723 'tab_grid_read_more_normal',
3724 [
3725 'label' => esc_html__('Normal', 'king-addons'),
3726 ]
3727 );
3728
3729 $this->add_group_control(
3730 Group_Control_Background::get_type(),
3731 [
3732 'name' => 'read_more_bg_color',
3733 'label' => esc_html__('Background', 'king-addons'),
3734 'types' => ['classic', 'gradient'],
3735 'fields_options' => [
3736 'color' => [
3737 'default' => '#434900',
3738 ],
3739 ],
3740 'selector' => '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a'
3741 ]
3742 );
3743
3744 $this->add_control(
3745 'read_more_color',
3746 [
3747 'label' => esc_html__('Color', 'king-addons'),
3748 'type' => Controls_Manager::COLOR,
3749 'default' => '#ffffff',
3750 'selectors' => [
3751 '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'color: {{VALUE}}',
3752 ],
3753 ]
3754 );
3755
3756 $this->add_control(
3757 'read_more_border_color',
3758 [
3759 'label' => esc_html__('Border Color', 'king-addons'),
3760 'type' => Controls_Manager::COLOR,
3761 'default' => '#E8E8E8',
3762 'selectors' => [
3763 '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'border-color: {{VALUE}}',
3764 ],
3765 ]
3766 );
3767
3768 $this->add_group_control(
3769 Group_Control_Box_Shadow::get_type(),
3770 [
3771 'name' => 'read_more_box_shadow',
3772 'selector' => '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a',
3773 ]
3774 );
3775
3776 $this->end_controls_tab();
3777
3778 $this->start_controls_tab(
3779 'tab_grid_read_more_hover',
3780 [
3781 'label' => esc_html__('Hover', 'king-addons'),
3782 ]
3783 );
3784
3785 $this->add_group_control(
3786 Group_Control_Background::get_type(),
3787 [
3788 'name' => 'read_more_bg_color_hr',
3789 'label' => esc_html__('Background', 'king-addons'),
3790 'types' => ['classic', 'gradient'],
3791 'fields_options' => [
3792 'color' => [
3793 'default' => '#434900',
3794 ],
3795 ],
3796 'selector' => '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a.king-addons-button-none:hover, {{WRAPPER}} .king-addons-grid-item-read-more .inner-block a:before, {{WRAPPER}} .king-addons-grid-item-read-more .inner-block a:after'
3797 ]
3798 );
3799
3800 $this->add_control(
3801 'read_more_color_hr',
3802 [
3803 'label' => esc_html__('Color', 'king-addons'),
3804 'type' => Controls_Manager::COLOR,
3805 'default' => '#5B03FF',
3806 'selectors' => [
3807 '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a:hover' => 'color: {{VALUE}}',
3808 ],
3809 ]
3810 );
3811
3812 $this->add_control(
3813 'read_more_border_color_hr',
3814 [
3815 'label' => esc_html__('Border Color', 'king-addons'),
3816 'type' => Controls_Manager::COLOR,
3817 'default' => '#E8E8E8',
3818 'selectors' => [
3819 '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a:hover' => 'border-color: {{VALUE}}',
3820 ]
3821 ]
3822 );
3823
3824 $this->add_group_control(
3825 Group_Control_Box_Shadow::get_type(),
3826 [
3827 'name' => 'read_more_box_shadow_hr',
3828 'selector' => '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block :hover a',
3829 ]
3830 );
3831
3832 $this->end_controls_tab();
3833
3834 $this->end_controls_tabs();
3835
3836 $this->add_control(
3837 'read_more_divider',
3838 [
3839 'type' => Controls_Manager::DIVIDER,
3840 'style' => 'thick',
3841 ]
3842 );
3843
3844 $this->add_control_read_more_animation();
3845
3846 $this->add_control(
3847 'read_more_transition_duration',
3848 [
3849 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'),
3850 'type' => Controls_Manager::NUMBER,
3851 'default' => 0.1,
3852 'min' => 0,
3853 'max' => 5,
3854 'step' => 0.1,
3855 'selectors' => [
3856 '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'transition-duration: {{VALUE}}s',
3857 '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a:before' => 'transition-duration: {{VALUE}}s',
3858 '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a:after' => 'transition-duration: {{VALUE}}s',
3859 ],
3860 ]
3861 );
3862
3863 $this->add_control_read_more_animation_height();
3864
3865 $this->add_control(
3866 'read_more_typo_divider',
3867 [
3868 'type' => Controls_Manager::DIVIDER,
3869 'style' => 'thick',
3870 ]
3871 );
3872
3873 $this->add_group_control(
3874 Group_Control_Typography::get_type(),
3875 [
3876 'name' => 'read_more_typography',
3877 'selector' => '{{WRAPPER}} .king-addons-grid-item-read-more a'
3878 ]
3879 );
3880
3881 $this->add_control(
3882 'read_more_border_type',
3883 [
3884 'label' => esc_html__('Border Type', 'king-addons'),
3885 'type' => Controls_Manager::SELECT,
3886 'options' => [
3887 'none' => esc_html__('None', 'king-addons'),
3888 'solid' => esc_html__('Solid', 'king-addons'),
3889 'double' => esc_html__('Double', 'king-addons'),
3890 'dotted' => esc_html__('Dotted', 'king-addons'),
3891 'dashed' => esc_html__('Dashed', 'king-addons'),
3892 'groove' => esc_html__('Groove', 'king-addons'),
3893 ],
3894 'default' => 'none',
3895 'selectors' => [
3896 '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'border-style: {{VALUE}};',
3897 ],
3898 'render_type' => 'template',
3899 'separator' => 'before',
3900 ]
3901 );
3902
3903 $this->add_control(
3904 'read_more_border_width',
3905 [
3906 'label' => esc_html__('Border Width', 'king-addons'),
3907 'type' => Controls_Manager::DIMENSIONS,
3908 'size_units' => ['px'],
3909 'default' => [
3910 'top' => 1,
3911 'right' => 1,
3912 'bottom' => 1,
3913 'left' => 1,
3914 ],
3915 'selectors' => [
3916 '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3917 ],
3918 'render_type' => 'template',
3919 'condition' => [
3920 'read_more_border_type!' => 'none',
3921 ],
3922 ]
3923 );
3924
3925 $this->add_control(
3926 'read_more_icon_spacing',
3927 [
3928 'label' => esc_html__('Extra Icon Spacing', 'king-addons'),
3929 'type' => Controls_Manager::SLIDER,
3930 'size_units' => ['px'],
3931 'range' => [
3932 'px' => [
3933 'min' => 0,
3934 'max' => 25,
3935 ],
3936 ],
3937 'default' => [
3938 'unit' => 'px',
3939 'size' => 5,
3940 ],
3941 'selectors' => [
3942 '{{WRAPPER}} .king-addons-grid-item-read-more .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};',
3943 '{{WRAPPER}} .king-addons-grid-item-read-more .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};',
3944 ],
3945 'separator' => 'before'
3946 ]
3947 );
3948
3949 $this->add_responsive_control(
3950 'read_more_padding',
3951 [
3952 'label' => esc_html__('Padding', 'king-addons'),
3953 'type' => Controls_Manager::DIMENSIONS,
3954 'size_units' => ['px', '%'],
3955 'default' => [
3956 'top' => 0,
3957 'right' => 0,
3958 'bottom' => 0,
3959 'left' => 0,
3960 ],
3961 'selectors' => [
3962 '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3963 ],
3964 'render_type' => 'template',
3965 'separator' => 'before',
3966 ]
3967 );
3968
3969 $this->add_responsive_control(
3970 'read_more_margin',
3971 [
3972 'label' => esc_html__('Margin', 'king-addons'),
3973 'type' => Controls_Manager::DIMENSIONS,
3974 'size_units' => ['px', '%'],
3975 'default' => [
3976 'top' => 0,
3977 'right' => 0,
3978 'bottom' => 0,
3979 'left' => 0,
3980 ],
3981 'selectors' => [
3982 '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3983 ],
3984 'render_type' => 'template',
3985 ]
3986 );
3987
3988 $this->add_control(
3989 'read_more_radius',
3990 [
3991 'label' => esc_html__('Border Radius', 'king-addons'),
3992 'type' => Controls_Manager::DIMENSIONS,
3993 'size_units' => ['px', '%'],
3994 'default' => [
3995 'top' => 2,
3996 'right' => 2,
3997 'bottom' => 2,
3998 'left' => 2,
3999 ],
4000 'selectors' => [
4001 '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4002 ],
4003 'separator' => 'before',
4004 ]
4005 );
4006
4007 $this->end_controls_section();
4008
4009
4010 $this->add_section_style_likes();
4011
4012
4013 $this->add_section_style_sharing();
4014
4015
4016 $this->start_controls_section(
4017 'section_style_separator1',
4018 [
4019 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Separator Style 1', 'king-addons'),
4020 'tab' => Controls_Manager::TAB_STYLE,
4021 'show_label' => false,
4022 ]
4023 );
4024
4025 $this->add_control(
4026 'separator1_color',
4027 [
4028 'label' => esc_html__('Color', 'king-addons'),
4029 'type' => Controls_Manager::COLOR,
4030 'default' => '#ffffff',
4031 'selectors' => [
4032 '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block > span' => 'border-bottom-color: {{VALUE}}',
4033 ],
4034 ]
4035 );
4036
4037 $this->add_control(
4038 'separator1_width',
4039 [
4040 'label' => esc_html__('Width', 'king-addons'),
4041 'type' => Controls_Manager::SLIDER,
4042 'size_units' => ['px', '%'],
4043 'range' => [
4044 'px' => [
4045 'min' => 0,
4046 'max' => 300,
4047 ],
4048 '%' => [
4049 'min' => 0,
4050 'max' => 100,
4051 ],
4052 ],
4053 'default' => [
4054 'unit' => 'px',
4055 'size' => 10,
4056 ],
4057 'selectors' => [
4058 '{{WRAPPER}} .king-addons-grid-sep-style-1:not(.king-addons-grid-item-display-inline) .inner-block > span' => 'width: {{SIZE}}{{UNIT}};',
4059 '{{WRAPPER}} .king-addons-grid-sep-style-1.king-addons-grid-item-display-inline' => 'width: {{SIZE}}{{UNIT}};',
4060 ],
4061 'render_type' => 'template',
4062 'separator' => 'before',
4063 ]
4064 );
4065
4066 $this->add_control(
4067 'separator1_height',
4068 [
4069 'label' => esc_html__('Height', 'king-addons'),
4070 'type' => Controls_Manager::SLIDER,
4071 'size_units' => ['px'],
4072 'range' => [
4073 'px' => [
4074 'min' => 1,
4075 'max' => 100,
4076 ],
4077 ],
4078 'default' => [
4079 'unit' => 'px',
4080 'size' => 1,
4081 ],
4082 'render_type' => 'template',
4083 'selectors' => [
4084 '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block > span' => 'border-bottom-width: {{SIZE}}{{UNIT}};',
4085 ],
4086 ]
4087 );
4088
4089 $this->add_control(
4090 'separator1_border_type',
4091 [
4092 'label' => esc_html__('Type', 'king-addons'),
4093 'type' => Controls_Manager::SELECT,
4094 'options' => [
4095 'solid' => esc_html__('Solid', 'king-addons'),
4096 'double' => esc_html__('Double', 'king-addons'),
4097 'dotted' => esc_html__('Dotted', 'king-addons'),
4098 'dashed' => esc_html__('Dashed', 'king-addons'),
4099 'groove' => esc_html__('Groove', 'king-addons'),
4100 ],
4101 'default' => 'solid',
4102 'selectors' => [
4103 '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block > span' => 'border-bottom-style: {{VALUE}};',
4104 ],
4105 'separator' => 'before',
4106 ]
4107 );
4108
4109 $this->add_responsive_control(
4110 'separator1_margin',
4111 [
4112 'label' => esc_html__('Margin', 'king-addons'),
4113 'type' => Controls_Manager::DIMENSIONS,
4114 'size_units' => ['px', '%'],
4115 'default' => [
4116 'top' => 13,
4117 'right' => 0,
4118 'bottom' => 0,
4119 'left' => 0,
4120 ],
4121 'render_type' => 'template',
4122 'selectors' => [
4123 '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4124 ],
4125 ]
4126 );
4127
4128 $this->add_control(
4129 'separator1_radius',
4130 [
4131 'label' => esc_html__('Border Radius', 'king-addons'),
4132 'type' => Controls_Manager::DIMENSIONS,
4133 'size_units' => ['px', '%'],
4134 'default' => [
4135 'top' => 0,
4136 'right' => 0,
4137 'bottom' => 0,
4138 'left' => 0,
4139 ],
4140 'selectors' => [
4141 '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4142 ],
4143 'separator' => 'before',
4144 ]
4145 );
4146
4147 $this->end_controls_section();
4148
4149
4150 $this->start_controls_section(
4151 'section_style_separator2',
4152 [
4153 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Separator Style 2', 'king-addons'),
4154 'tab' => Controls_Manager::TAB_STYLE,
4155 'show_label' => false,
4156 ]
4157 );
4158
4159 $this->add_control(
4160 'separator2_color',
4161 [
4162 'label' => esc_html__('Color', 'king-addons'),
4163 'type' => Controls_Manager::COLOR,
4164 'default' => '#ffffff',
4165 'selectors' => [
4166 '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block > span' => 'border-bottom-color: {{VALUE}}',
4167 ],
4168 ]
4169 );
4170
4171 $this->add_control(
4172 'separator2_width',
4173 [
4174 'label' => esc_html__('Width', 'king-addons'),
4175 'type' => Controls_Manager::SLIDER,
4176 'size_units' => ['px', '%'],
4177 'range' => [
4178 'px' => [
4179 'min' => 0,
4180 'max' => 300,
4181 ],
4182 '%' => [
4183 'min' => 0,
4184 'max' => 100,
4185 ],
4186 ],
4187 'default' => [
4188 'unit' => '%',
4189 'size' => 20,
4190 ],
4191 'selectors' => [
4192 '{{WRAPPER}} .king-addons-grid-sep-style-2:not(.king-addons-grid-item-display-inline) .inner-block > span' => 'width: {{SIZE}}{{UNIT}};',
4193 '{{WRAPPER}} .king-addons-grid-sep-style-2.king-addons-grid-item-display-inline' => 'width: {{SIZE}}{{UNIT}};',
4194 ],
4195 'render_type' => 'template',
4196 'separator' => 'before',
4197 ]
4198 );
4199
4200 $this->add_control(
4201 'separator2_height',
4202 [
4203 'label' => esc_html__('Height', 'king-addons'),
4204 'type' => Controls_Manager::SLIDER,
4205 'size_units' => ['px'],
4206 'range' => [
4207 'px' => [
4208 'min' => 0,
4209 'max' => 100,
4210 ],
4211 ],
4212 'default' => [
4213 'unit' => 'px',
4214 'size' => 2,
4215 ],
4216 'selectors' => [
4217 '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block > span' => 'border-bottom-width: {{SIZE}}{{UNIT}};',
4218 ],
4219 'render_type' => 'template',
4220 ]
4221 );
4222
4223 $this->add_control(
4224 'separator2_border_type',
4225 [
4226 'label' => esc_html__('Type', 'king-addons'),
4227 'type' => Controls_Manager::SELECT,
4228 'options' => [
4229 'solid' => esc_html__('Solid', 'king-addons'),
4230 'double' => esc_html__('Double', 'king-addons'),
4231 'dotted' => esc_html__('Dotted', 'king-addons'),
4232 'dashed' => esc_html__('Dashed', 'king-addons'),
4233 'groove' => esc_html__('Groove', 'king-addons'),
4234 ],
4235 'default' => 'solid',
4236 'selectors' => [
4237 '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block > span' => 'border-bottom-style: {{VALUE}};',
4238 ],
4239 'separator' => 'before',
4240 ]
4241 );
4242
4243 $this->add_responsive_control(
4244 'separator2_margin',
4245 [
4246 'label' => esc_html__('Margin', 'king-addons'),
4247 'type' => Controls_Manager::DIMENSIONS,
4248 'size_units' => ['px', '%'],
4249 'default' => [
4250 'top' => 13,
4251 'right' => 0,
4252 'bottom' => 0,
4253 'left' => 0,
4254 ],
4255 'selectors' => [
4256 '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4257 ],
4258 'render_type' => 'template',
4259 ]
4260 );
4261
4262 $this->add_control(
4263 'separator2_radius',
4264 [
4265 'label' => esc_html__('Border Radius', 'king-addons'),
4266 'type' => Controls_Manager::DIMENSIONS,
4267 'size_units' => ['px', '%'],
4268 'default' => [
4269 'top' => 0,
4270 'right' => 0,
4271 'bottom' => 0,
4272 'left' => 0,
4273 ],
4274 'selectors' => [
4275 '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4276 ],
4277 'separator' => 'before',
4278 ]
4279 );
4280
4281 $this->end_controls_section();
4282
4283
4284 $this->start_controls_section(
4285 'section_style_tax1',
4286 [
4287 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Taxonomy Style 1', 'king-addons'),
4288 'tab' => Controls_Manager::TAB_STYLE,
4289 'show_label' => false,
4290 ]
4291 );
4292
4293 $this->start_controls_tabs('tabs_grid_tax1_style');
4294
4295 $this->start_controls_tab(
4296 'tab_grid_tax1_normal',
4297 [
4298 'label' => esc_html__('Normal', 'king-addons'),
4299 ]
4300 );
4301
4302 $this->add_control(
4303 'tax1_color',
4304 [
4305 'label' => esc_html__('Color', 'king-addons'),
4306 'type' => Controls_Manager::COLOR,
4307 'default' => '#ffffff',
4308 'selectors' => [
4309 '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'color: {{VALUE}}',
4310 ],
4311 ]
4312 );
4313
4314 $this->add_control(
4315 'tax1_bg_color',
4316 [
4317 'label' => esc_html__('Background Color', 'king-addons'),
4318 'type' => Controls_Manager::COLOR,
4319 'selectors' => [
4320 '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'background-color: {{VALUE}}',
4321 ]
4322 ]
4323 );
4324
4325 $this->add_control(
4326 'tax1_border_color',
4327 [
4328 'label' => esc_html__('Border Color', 'king-addons'),
4329 'type' => Controls_Manager::COLOR,
4330 'default' => '#E8E8E8',
4331 'selectors' => [
4332 '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'border-color: {{VALUE}}',
4333 ],
4334 ]
4335 );
4336
4337 $this->add_control(
4338 'tax1_extra_text_color',
4339 [
4340 'label' => esc_html__('Extra Text Color', 'king-addons'),
4341 'type' => Controls_Manager::COLOR,
4342 'selectors' => [
4343 '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block span[class*="king-addons-grid-extra-text"]' => 'color: {{VALUE}}',
4344 ],
4345 ]
4346 );
4347
4348 $this->add_control(
4349 'tax1_extra_icon_color',
4350 [
4351 'label' => esc_html__('Extra Icon Color', 'king-addons'),
4352 'type' => Controls_Manager::COLOR,
4353 'selectors' => [
4354 '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block [class*="king-addons-grid-extra-icon"] i' => 'color: {{VALUE}}',
4355 '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block [class*="king-addons-grid-extra-icon"] svg' => 'fill: {{VALUE}}'
4356 ],
4357 'separator' => 'after',
4358 ]
4359 );
4360
4361 $this->add_control_tax1_custom_colors($tax_meta_keys[1]);
4362
4363 $this->end_controls_tab();
4364
4365 $this->start_controls_tab(
4366 'tab_grid_tax1_hover',
4367 [
4368 'label' => esc_html__('Hover', 'king-addons'),
4369 ]
4370 );
4371
4372 $this->add_control(
4373 'tax1_color_hr',
4374 [
4375 'label' => esc_html__('Color', 'king-addons'),
4376 'type' => Controls_Manager::COLOR,
4377 'default' => '#5B03FF',
4378 'selectors' => [
4379 '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a:hover' => 'color: {{VALUE}}',
4380 '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-pointer-item:before' => 'background-color: {{VALUE}}',
4381 '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-pointer-item:after' => 'background-color: {{VALUE}}',
4382 ],
4383 ]
4384 );
4385
4386 $this->add_control(
4387 'tax1_bg_color_hr',
4388 [
4389 'label' => esc_html__('Background Color', 'king-addons'),
4390 'type' => Controls_Manager::COLOR,
4391 'selectors' => [
4392 '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a:hover' => 'background-color: {{VALUE}}',
4393 ]
4394 ]
4395 );
4396
4397 $this->add_control(
4398 'tax1_border_color_hr',
4399 [
4400 'label' => esc_html__('Border Color', 'king-addons'),
4401 'type' => Controls_Manager::COLOR,
4402 'default' => '#E8E8E8',
4403 'selectors' => [
4404 '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a:hover' => 'border-color: {{VALUE}}',
4405 ],
4406 ]
4407 );
4408
4409 $this->add_control_tax1_pointer_color_hr();
4410
4411 $this->end_controls_tab();
4412
4413 $this->end_controls_tabs();
4414
4415 $this->add_control_tax1_pointer();
4416
4417 $this->add_control_tax1_pointer_height();
4418
4419 $this->add_control_tax1_pointer_animation();
4420
4421 $this->add_control(
4422 'tax1_transition_duration',
4423 [
4424 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'),
4425 'type' => Controls_Manager::NUMBER,
4426 'default' => 0.1,
4427 'min' => 0,
4428 'max' => 5,
4429 'step' => 0.1,
4430 'selectors' => [
4431 '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'transition-duration: {{VALUE}}s',
4432 '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-pointer-item:before' => 'transition-duration: {{VALUE}}s',
4433 '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-pointer-item:after' => 'transition-duration: {{VALUE}}s',
4434 ],
4435 'separator' => 'after',
4436 ]
4437 );
4438
4439 $this->add_group_control(
4440 Group_Control_Typography::get_type(),
4441 [
4442 'name' => 'tax1_typography',
4443 'selector' => '{{WRAPPER}} .king-addons-grid-tax-style-1'
4444 ]
4445 );
4446
4447 $this->add_control(
4448 'tax1_border_type',
4449 [
4450 'label' => esc_html__('Border Type', 'king-addons'),
4451 'type' => Controls_Manager::SELECT,
4452 'options' => [
4453 'none' => esc_html__('None', 'king-addons'),
4454 'solid' => esc_html__('Solid', 'king-addons'),
4455 'double' => esc_html__('Double', 'king-addons'),
4456 'dotted' => esc_html__('Dotted', 'king-addons'),
4457 'dashed' => esc_html__('Dashed', 'king-addons'),
4458 'groove' => esc_html__('Groove', 'king-addons'),
4459 ],
4460 'default' => 'none',
4461 'selectors' => [
4462 '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'border-style: {{VALUE}};',
4463 ],
4464 'render_type' => 'template',
4465 'separator' => 'before',
4466 ]
4467 );
4468
4469 $this->add_control(
4470 'tax1_border_width',
4471 [
4472 'label' => esc_html__('Border Width', 'king-addons'),
4473 'type' => Controls_Manager::DIMENSIONS,
4474 'size_units' => ['px'],
4475 'default' => [
4476 'top' => 1,
4477 'right' => 1,
4478 'bottom' => 1,
4479 'left' => 1,
4480 ],
4481 'selectors' => [
4482 '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4483 ],
4484 'render_type' => 'template',
4485 'condition' => [
4486 'tax1_border_type!' => 'none',
4487 ],
4488 ]
4489 );
4490
4491 $this->add_control(
4492 'tax1_text_spacing',
4493 [
4494 'label' => esc_html__('Extra Text Spacing', 'king-addons'),
4495 'type' => Controls_Manager::SLIDER,
4496 'size_units' => ['px'],
4497 'range' => [
4498 'px' => [
4499 'min' => 0,
4500 'max' => 25,
4501 ],
4502 ],
4503 'default' => [
4504 'unit' => 'px',
4505 'size' => 5,
4506 ],
4507 'selectors' => [
4508 '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};',
4509 '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};',
4510 ],
4511 'render_type' => 'template',
4512 'separator' => 'before',
4513 ]
4514 );
4515
4516 $this->add_control(
4517 'tax1_icon_spacing',
4518 [
4519 'label' => esc_html__('Extra Icon Spacing', 'king-addons'),
4520 'type' => Controls_Manager::SLIDER,
4521 'size_units' => ['px'],
4522 'range' => [
4523 'px' => [
4524 'min' => 0,
4525 'max' => 25,
4526 ],
4527 ],
4528 'default' => [
4529 'unit' => 'px',
4530 'size' => 5,
4531 ],
4532 'selectors' => [
4533 '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};',
4534 '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};',
4535 ],
4536 ]
4537 );
4538
4539 $this->add_control(
4540 'tax1_gutter',
4541 [
4542 'label' => esc_html__('Gutter', 'king-addons'),
4543 'type' => Controls_Manager::SLIDER,
4544 'size_units' => ['px'],
4545 'range' => [
4546 'px' => [
4547 'min' => 0,
4548 'max' => 20,
4549 ],
4550 ],
4551 'default' => [
4552 'unit' => 'px',
4553 'size' => 3,
4554 ],
4555 'selectors' => [
4556 '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'margin-right: {{SIZE}}{{UNIT}};',
4557 ],
4558 'render_type' => 'template',
4559 'separator' => 'before',
4560 ]
4561 );
4562
4563 $this->add_responsive_control(
4564 'tax1_padding',
4565 [
4566 'label' => esc_html__('Padding', 'king-addons'),
4567 'type' => Controls_Manager::DIMENSIONS,
4568 'size_units' => ['px', '%'],
4569 'default' => [
4570 'top' => 0,
4571 'right' => 0,
4572 'bottom' => 0,
4573 'left' => 0,
4574 ],
4575 'selectors' => [
4576 '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4577 ],
4578 'render_type' => 'template',
4579 ]
4580 );
4581
4582 $this->add_responsive_control(
4583 'tax1_margin',
4584 [
4585 'label' => esc_html__('Margin', 'king-addons'),
4586 'type' => Controls_Manager::DIMENSIONS,
4587 'size_units' => ['px', '%'],
4588 'default' => [
4589 'top' => 0,
4590 'right' => 0,
4591 'bottom' => 0,
4592 'left' => 22,
4593 ],
4594 'selectors' => [
4595 '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4596 ],
4597 'render_type' => 'template',
4598 ]
4599 );
4600
4601 $this->add_control(
4602 'tax1_radius',
4603 [
4604 'label' => esc_html__('Border Radius', 'king-addons'),
4605 'type' => Controls_Manager::DIMENSIONS,
4606 'size_units' => ['px', '%'],
4607 'default' => [
4608 'top' => 2,
4609 'right' => 2,
4610 'bottom' => 2,
4611 'left' => 2,
4612 ],
4613 'selectors' => [
4614 '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4615 ],
4616 'separator' => 'before',
4617 ]
4618 );
4619
4620 $this->end_controls_section();
4621
4622
4623 $this->start_controls_section(
4624 'section_style_tax2',
4625 [
4626 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Taxonomy Style 2', 'king-addons'),
4627 'tab' => Controls_Manager::TAB_STYLE,
4628 'show_label' => false,
4629 ]
4630 );
4631
4632 $this->start_controls_tabs('tabs_grid_tax2_style');
4633
4634 $this->start_controls_tab(
4635 'tab_grid_tax2_normal',
4636 [
4637 'label' => esc_html__('Normal', 'king-addons'),
4638 ]
4639 );
4640
4641 $this->add_control(
4642 'tax2_color',
4643 [
4644 'label' => esc_html__('Color', 'king-addons'),
4645 'type' => Controls_Manager::COLOR,
4646 'default' => '#ffffff',
4647 'selectors' => [
4648 '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'color: {{VALUE}}',
4649 ],
4650 ]
4651 );
4652
4653 $this->add_control(
4654 'tax2_bg_color',
4655 [
4656 'label' => esc_html__('Background Color', 'king-addons'),
4657 'type' => Controls_Manager::COLOR,
4658 'default' => '#5B03FF',
4659 'selectors' => [
4660 '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'background-color: {{VALUE}}',
4661 ]
4662 ]
4663 );
4664
4665 $this->add_control(
4666 'tax2_border_color',
4667 [
4668 'label' => esc_html__('Border Color', 'king-addons'),
4669 'type' => Controls_Manager::COLOR,
4670 'default' => '#E8E8E8',
4671 'selectors' => [
4672 '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'border-color: {{VALUE}}',
4673 ],
4674 'separator' => 'after',
4675 ]
4676 );
4677
4678 $this->end_controls_tab();
4679
4680 $this->start_controls_tab(
4681 'tab_grid_tax2_hover',
4682 [
4683 'label' => esc_html__('Hover', 'king-addons'),
4684 ]
4685 );
4686
4687 $this->add_control(
4688 'tax2_color_hr',
4689 [
4690 'label' => esc_html__('Color', 'king-addons'),
4691 'type' => Controls_Manager::COLOR,
4692 'default' => '#ffffff',
4693 'selectors' => [
4694 '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a:hover' => 'color: {{VALUE}}',
4695 '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-pointer-item:before' => 'background-color: {{VALUE}}',
4696 '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-pointer-item:after' => 'background-color: {{VALUE}}',
4697 ],
4698 ]
4699 );
4700
4701 $this->add_control(
4702 'tax2_bg_color_hr',
4703 [
4704 'label' => esc_html__('Background Color', 'king-addons'),
4705 'type' => Controls_Manager::COLOR,
4706 'default' => '#4D02D8',
4707 'selectors' => [
4708 '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a:hover' => 'background-color: {{VALUE}}',
4709 ]
4710 ]
4711 );
4712
4713 $this->add_control(
4714 'tax2_border_color_hr',
4715 [
4716 'label' => esc_html__('Border Color', 'king-addons'),
4717 'type' => Controls_Manager::COLOR,
4718 'default' => '#E8E8E8',
4719 'selectors' => [
4720 '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a:hover' => 'border-color: {{VALUE}}',
4721 ],
4722 ]
4723 );
4724
4725 $this->add_control_tax2_pointer_color_hr();
4726
4727 $this->end_controls_tab();
4728
4729 $this->end_controls_tabs();
4730
4731 $this->add_control_tax2_pointer();
4732
4733 $this->add_control_tax2_pointer_height();
4734
4735 $this->add_control_tax2_pointer_animation();
4736
4737 $this->add_control(
4738 'tax2_transition_duration',
4739 [
4740 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'),
4741 'type' => Controls_Manager::NUMBER,
4742 'default' => 0.1,
4743 'min' => 0,
4744 'max' => 5,
4745 'step' => 0.1,
4746 'selectors' => [
4747 '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'transition-duration: {{VALUE}}s',
4748 '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-pointer-item:before' => 'transition-duration: {{VALUE}}s',
4749 '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-pointer-item:after' => 'transition-duration: {{VALUE}}s',
4750 ],
4751 'separator' => 'after',
4752 ]
4753 );
4754
4755 $this->add_group_control(
4756 Group_Control_Typography::get_type(),
4757 [
4758 'name' => 'tax2_typography',
4759 'selector' => '{{WRAPPER}} .king-addons-grid-tax-style-2'
4760 ]
4761 );
4762
4763 $this->add_control(
4764 'tax2_border_type',
4765 [
4766 'label' => esc_html__('Border Type', 'king-addons'),
4767 'type' => Controls_Manager::SELECT,
4768 'options' => [
4769 'none' => esc_html__('None', 'king-addons'),
4770 'solid' => esc_html__('Solid', 'king-addons'),
4771 'double' => esc_html__('Double', 'king-addons'),
4772 'dotted' => esc_html__('Dotted', 'king-addons'),
4773 'dashed' => esc_html__('Dashed', 'king-addons'),
4774 'groove' => esc_html__('Groove', 'king-addons'),
4775 ],
4776 'default' => 'none',
4777 'selectors' => [
4778 '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'border-style: {{VALUE}};',
4779 ],
4780 'render_type' => 'template',
4781 'separator' => 'before',
4782 ]
4783 );
4784
4785 $this->add_control(
4786 'tax2_border_width',
4787 [
4788 'label' => esc_html__('Border Width', 'king-addons'),
4789 'type' => Controls_Manager::DIMENSIONS,
4790 'size_units' => ['px'],
4791 'default' => [
4792 'top' => 1,
4793 'right' => 1,
4794 'bottom' => 1,
4795 'left' => 1,
4796 ],
4797 'selectors' => [
4798 '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4799 ],
4800 'render_type' => 'template',
4801 'condition' => [
4802 'tax2_border_type!' => 'none',
4803 ],
4804 ]
4805 );
4806
4807 $this->add_control(
4808 'tax2_text_spacing',
4809 [
4810 'label' => esc_html__('Extra Text Spacing', 'king-addons'),
4811 'type' => Controls_Manager::SLIDER,
4812 'size_units' => ['px'],
4813 'range' => [
4814 'px' => [
4815 'min' => 0,
4816 'max' => 25,
4817 ],
4818 ],
4819 'default' => [
4820 'unit' => 'px',
4821 'size' => 5,
4822 ],
4823 'selectors' => [
4824 '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};',
4825 '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};',
4826 ],
4827 'separator' => 'before',
4828 ]
4829 );
4830
4831 $this->add_control(
4832 'tax2_icon_spacing',
4833 [
4834 'label' => esc_html__('Extra Icon Spacing', 'king-addons'),
4835 'type' => Controls_Manager::SLIDER,
4836 'size_units' => ['px'],
4837 'range' => [
4838 'px' => [
4839 'min' => 0,
4840 'max' => 25,
4841 ],
4842 ],
4843 'default' => [
4844 'unit' => 'px',
4845 'size' => 5,
4846 ],
4847 'selectors' => [
4848 '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};',
4849 '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};',
4850 ],
4851 ]
4852 );
4853
4854 $this->add_control(
4855 'tax2_gutter',
4856 [
4857 'label' => esc_html__('Gutter', 'king-addons'),
4858 'type' => Controls_Manager::SLIDER,
4859 'size_units' => ['px'],
4860 'range' => [
4861 'px' => [
4862 'min' => 0,
4863 'max' => 20,
4864 ],
4865 ],
4866 'default' => [
4867 'unit' => 'px',
4868 'size' => 3,
4869 ],
4870 'selectors' => [
4871 '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'margin-right: {{SIZE}}{{UNIT}};',
4872 ],
4873 'render_type' => 'template',
4874 'separator' => 'before',
4875 ]
4876 );
4877
4878 $this->add_responsive_control(
4879 'tax2_padding',
4880 [
4881 'label' => esc_html__('Padding', 'king-addons'),
4882 'type' => Controls_Manager::DIMENSIONS,
4883 'size_units' => ['px', '%'],
4884 'default' => [
4885 'top' => 2,
4886 'right' => 5,
4887 'bottom' => 2,
4888 'left' => 5,
4889 ],
4890 'selectors' => [
4891 '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4892 ],
4893 'render_type' => 'template',
4894 ]
4895 );
4896
4897 $this->add_responsive_control(
4898 'tax2_margin',
4899 [
4900 'label' => esc_html__('Margin', 'king-addons'),
4901 'type' => Controls_Manager::DIMENSIONS,
4902 'size_units' => ['px', '%'],
4903 'default' => [
4904 'top' => 0,
4905 'right' => 0,
4906 'bottom' => 0,
4907 'left' => 20,
4908 ],
4909 'selectors' => [
4910 '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4911 ],
4912 'render_type' => 'template',
4913 ]
4914 );
4915
4916 $this->add_control(
4917 'tax2_radius',
4918 [
4919 'label' => esc_html__('Border Radius', 'king-addons'),
4920 'type' => Controls_Manager::DIMENSIONS,
4921 'size_units' => ['px', '%'],
4922 'default' => [
4923 'top' => 2,
4924 'right' => 2,
4925 'bottom' => 2,
4926 'left' => 2,
4927 ],
4928 'selectors' => [
4929 '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4930 ],
4931 'separator' => 'before',
4932 ]
4933 );
4934
4935 $this->end_controls_section();
4936
4937
4938 $this->add_section_style_custom_field1();
4939
4940
4941 $this->add_section_style_custom_field2();
4942
4943
4944 $this->add_section_style_grid_slider_nav();
4945
4946
4947 $this->start_controls_section(
4948 'section_style_pwd_protected',
4949 [
4950 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Password Protected', 'king-addons'),
4951 'tab' => Controls_Manager::TAB_STYLE,
4952 'show_label' => false,
4953 ]
4954 );
4955
4956 $this->add_control(
4957 'pwd_protected_color',
4958 [
4959 'label' => esc_html__('Color', 'king-addons'),
4960 'type' => Controls_Manager::COLOR,
4961 'default' => '#9c9c9c',
4962 'selectors' => [
4963 '{{WRAPPER}} .king-addons-grid-item-protected' => 'color: {{VALUE}}',
4964 ],
4965 ]
4966 );
4967
4968 $this->add_control(
4969 'pwd_protected_bg_color',
4970 [
4971 'label' => esc_html__('Background Color', 'king-addons'),
4972 'type' => Controls_Manager::COLOR,
4973 'default' => '#5B03FF',
4974 'selectors' => [
4975 '{{WRAPPER}} .king-addons-grid-item-protected' => 'background-color: {{VALUE}}',
4976 ]
4977 ]
4978 );
4979
4980 $this->add_control(
4981 'pwd_protected_input_color',
4982 [
4983 'label' => esc_html__('Input Background Color', 'king-addons'),
4984 'type' => Controls_Manager::COLOR,
4985 'default' => '#ffffff',
4986 'selectors' => [
4987 '{{WRAPPER}} .king-addons-grid-item-protected input' => 'background-color: {{VALUE}}',
4988 ]
4989 ]
4990 );
4991
4992 $this->add_group_control(
4993 Group_Control_Typography::get_type(),
4994 [
4995 'name' => 'pwd_protected_typography',
4996 'selector' => '{{WRAPPER}} .king-addons-grid-item-protected p'
4997 ]
4998 );
4999
5000 $this->end_controls_section();
5001
5002 }
5003
5004 public function get_related_taxonomies()
5005 {
5006 $relations = [];
5007 foreach (Core::getCustomTypes('post', false) as $slug => $title) {
5008 // `get_object_taxonomies` already returns an array; assign it directly
5009 $relations[$slug] = get_object_taxonomies($slug);
5010 }
5011 return json_encode($relations);
5012 }
5013
5014 public function get_max_num_pages()
5015 {
5016 $query = new WP_Query($this->get_main_query_args(0));
5017 wp_reset_postdata();
5018 return (int)ceil($query->max_num_pages);
5019 }
5020
5021 public function get_main_query_args($slide_offset)
5022 {
5023 $settings = $this->get_settings();
5024 $author = !empty($settings['query_author']) ? implode(',', $settings['query_author']) : '';
5025 $paged = get_query_var('paged') ?: (get_query_var('page') ?: 1);
5026
5027 // Handle no-premium settings
5028 if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
5029 $restricted_layouts = ['1-2', '1-3', '1-4', '1-1-2', '2-1-2', '1vh-3h'];
5030 if (in_array($settings['king_addons_grid_layout_select'], $restricted_layouts, true)) {
5031 $settings['king_addons_grid_layout_select'] = '1-1-3';
5032 }
5033 $settings['slider_enable'] = '';
5034 $settings['query_randomize'] = '';
5035 $settings['order_posts'] = 'date';
5036 }
5037
5038 // Determine posts per page based on layout
5039 switch ($settings['king_addons_grid_layout_select']) {
5040 case '1-2':
5041 case '1-1-1':
5042 $query_posts_per_page = 3;
5043 break;
5044 case '1-3':
5045 case '1-1-2':
5046 case '1vh-3h':
5047 $query_posts_per_page = 4;
5048 break;
5049 case '1-4':
5050 case '2-1-2':
5051 case '1-1-3':
5052 case '2-3':
5053 $query_posts_per_page = 5;
5054 break;
5055 case '2-h':
5056 $query_posts_per_page = 2 * (int)$settings['layout_rows_number'];
5057 break;
5058 case '3-h':
5059 $query_posts_per_page = 3 * (int)$settings['layout_rows_number'];
5060 break;
5061 case '4-h':
5062 $query_posts_per_page = 4 * (int)$settings['layout_rows_number'];
5063 break;
5064 default:
5065 $query_posts_per_page = 3; // Fallback if something else
5066 break;
5067 }
5068
5069 $settings['query_offset'] = !empty($settings['query_offset']) ? $settings['query_offset'] : 0;
5070 $offset = ($paged - 1) * $query_posts_per_page + $settings['query_offset'];
5071 $query_order_by = (!empty($settings['query_randomize'])) ? $settings['query_randomize'] : $settings['order_posts'];
5072
5073 // Override random on front page if not a blog archive
5074 if (is_front_page() && !Core::isBlogArchive()) {
5075 $query_order_by = $settings['order_posts'];
5076 }
5077
5078 // Adjust offset for slider
5079 if ('yes' === $settings['slider_enable']) {
5080 $offset += $query_posts_per_page * $slide_offset;
5081 }
5082
5083 // Default arguments
5084 $args = [
5085 'post_type' => $settings['query_source'],
5086 'tax_query' => $this->get_tax_query_args(),
5087 'post__not_in' => $settings['query_exclude_' . $settings['query_source']],
5088 'posts_per_page' => $query_posts_per_page,
5089 'orderby' => $query_order_by,
5090 'author' => $author,
5091 'paged' => $paged,
5092 'offset' => $offset,
5093 ];
5094
5095 // Exclude posts with no images
5096 if ('yes' === $settings['query_exclude_no_images']) {
5097 $args['meta_key'] = '_thumbnail_id';
5098 }
5099
5100 // Manual selection override
5101 if ('manual' === $settings['query_selection']) {
5102 $post_ids = !empty($settings['query_manual_' . $settings['query_source']])
5103 ? $settings['query_manual_' . $settings['query_source']]
5104 : [''];
5105
5106 $args = [
5107 'post_type' => $settings['query_source'],
5108 'post__in' => $post_ids,
5109 'orderby' => $query_order_by,
5110 'posts_per_page' => $query_posts_per_page,
5111 'offset' => $query_posts_per_page * $slide_offset,
5112 ];
5113 }
5114
5115 // Use current query
5116 if ('current' === $settings['query_source']) {
5117 global $wp_query;
5118 $args = $wp_query->query_vars;
5119 $args['posts_per_page'] = $query_posts_per_page;
5120 $args['orderby'] = $query_order_by;
5121 $args['offset'] = ($paged - 1) * $query_posts_per_page + (int)$settings['query_offset'];
5122 }
5123
5124 // Related posts
5125 if ('related' === $settings['query_source']) {
5126 $args = [
5127 'post_type' => get_post_type(get_the_ID()),
5128 'tax_query' => $this->get_tax_query_args(),
5129 'post__not_in' => [get_the_ID()],
5130 'ignore_sticky_posts' => 1,
5131 'posts_per_page' => $query_posts_per_page,
5132 'orderby' => $query_order_by,
5133 'offset' => $offset,
5134 ];
5135 }
5136
5137 // Add 'order' unless random
5138 if ('rand' !== $query_order_by) {
5139 $args['order'] = $settings['order_direction'];
5140 }
5141
5142 return $args;
5143 }
5144
5145 public function get_tax_query_args()
5146 {
5147 $settings = $this->get_settings();
5148
5149 // If "related" source
5150 if ('related' === $settings['query_source']) {
5151 return [
5152 [
5153 'taxonomy' => $settings['query_tax_selection'],
5154 'field' => 'term_id',
5155 'terms' => wp_get_object_terms(
5156 get_the_ID(),
5157 $settings['query_tax_selection'],
5158 ['fields' => 'ids']
5159 ),
5160 ]
5161 ];
5162 }
5163
5164 // Else build from normal taxonomies
5165 $tax_query = [];
5166 foreach (get_object_taxonomies($settings['query_source']) as $tax) {
5167 $key = 'query_taxonomy_' . $tax;
5168 if (!empty($settings[$key])) {
5169 $tax_query[] = [
5170 'taxonomy' => $tax,
5171 'field' => 'id',
5172 'terms' => $settings[$key],
5173 ];
5174 }
5175 }
5176 return $tax_query;
5177 }
5178
5179 private function get_animation_class($data, $object)
5180 {
5181 if ('none' === $data[$object . '_animation']) {
5182 return '';
5183 }
5184
5185 $class = ' king-addons-' . $object . '-' . $data[$object . '_animation'];
5186 $class .= ' king-addons-anim-size-' . $data[$object . '_animation_size'];
5187 $class .= ' king-addons-animation-timing-' . $data[$object . '_animation_timing'];
5188
5189 if ('yes' === $data[$object . '_animation_tr']) {
5190 $class .= ' king-addons-anim-transparency';
5191 }
5192 return $class;
5193 }
5194
5195 public function render_password_protected_input()
5196 {
5197 if (!post_password_required()) {
5198 return;
5199 }
5200
5201 add_filter('the_password_form', function () {
5202 $output = '<form action="' . esc_url(home_url('wp-login.php?action=postpass')) . '" method="post">';
5203 $output .= '<i class="fas fa-lock"></i>';
5204 $output .= '<p>' . esc_html(get_the_title()) . '</p>';
5205 $output .= '<input type="password" name="post_password" id="post-' . esc_attr(get_the_ID()) . '" placeholder="' . esc_html__('Type and hit Enter...', 'king-addons') . '">';
5206 $output .= '</form>';
5207 return $output;
5208 });
5209
5210 echo '<div class="king-addons-grid-item-protected king-addons-cv-container">';
5211 echo '<div class="king-addons-cv-outer">';
5212 echo '<div class="king-addons-cv-inner">';
5213 echo get_the_password_form();
5214 echo '</div></div></div>';
5215 }
5216
5217 public function render_post_thumbnail($settings, $post_id = null)
5218 {
5219 $id = $post_id ? get_post_thumbnail_id($post_id) : get_post_thumbnail_id();
5220 $src = Group_Control_Image_Size::get_attachment_image_src($id, 'layout_image_crop', $settings);
5221
5222 if (has_post_thumbnail()) {
5223 echo '<div class="king-addons-grid-image-wrap" data-src="' . esc_url($src) . '" style="background-image: url(' . esc_url($src) . ')"></div>';
5224 }
5225 }
5226
5227 public function render_media_overlay($settings)
5228 {
5229 echo '<div class="king-addons-grid-media-hover-bg ' . esc_attr($this->get_animation_class($settings, 'overlay')) . '" data-url="' . esc_url(get_the_permalink()) . '">';
5230 if (king_addons_freemius()->can_use_premium_code__premium_only() && !empty($settings['overlay_image']['url'])) {
5231 echo '<img src="' . esc_url($settings['overlay_image']['url']) . '" alt="' . esc_attr($settings['overlay_image']['alt']) . '">';
5232 }
5233 echo '</div>';
5234 }
5235
5236 public function render_post_title($settings, $class)
5237 {
5238 $open_links_in_new_tab = ('yes' === $settings['open_links_in_new_tab']) ? '_blank' : '_self';
5239
5240 // If premium unavailable, fallback pointer settings
5241 $title_pointer = king_addons_freemius()->can_use_premium_code__premium_only() ? $settings['title_pointer'] : 'none';
5242 $title_pointer_animation = king_addons_freemius()->can_use_premium_code__premium_only() ? $settings['title_pointer_animation'] : 'fade';
5243
5244 $pointer_item_class = ('none' !== $title_pointer) ? 'class="king-addons-pointer-item"' : '';
5245 $class .= ' king-addons-pointer-' . $title_pointer;
5246 $class .= ' king-addons-pointer-line-fx king-addons-pointer-fx-' . $title_pointer_animation;
5247
5248 $tags_whitelist = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'div', 'span', 'p'];
5249 $element_title_tag = Core::validateHTMLTags($settings['element_title_tag'], 'h2', $tags_whitelist);
5250 $trim_type = $settings['element_trim_text_by'];
5251 $limit = $trim_type === 'word_count' ? $settings['element_word_count'] : $settings['element_letter_count'];
5252 $title_text = ($trim_type === 'word_count')
5253 ? wp_trim_words(get_the_title(), $limit)
5254 : mb_substr(html_entity_decode(get_the_title()), 0, $limit) . '...';
5255
5256 echo "<$element_title_tag class=\"$class\">";
5257 echo '<div class="inner-block">';
5258 echo "<a target=\"$open_links_in_new_tab\" $pointer_item_class href=\"" . esc_url(get_the_permalink()) . "\">";
5259 echo esc_html($title_text);
5260 echo '</a></div>';
5261 echo "</$element_title_tag>";
5262 }
5263
5264 public function render_post_content($settings, $class)
5265 {
5266 if ('' === get_the_content()) {
5267 return;
5268 }
5269 $class .= ('yes' === $settings['element_dropcap']) ? ' king-addons-enable-dropcap' : '';
5270
5271 echo "<div class=\"$class\">";
5272 echo '<div class="inner-block">';
5273 echo wp_kses_post(apply_filters('the_content', get_the_content()));
5274 echo '</div></div>';
5275 }
5276
5277 public function render_post_excerpt($settings, $class)
5278 {
5279 if ('' === get_the_excerpt()) {
5280 return;
5281 }
5282 $class .= ('yes' === $settings['element_dropcap']) ? ' king-addons-enable-dropcap' : '';
5283
5284 echo "<div class=\"$class\">";
5285 echo '<div class="inner-block">';
5286 if ('word_count' === $settings['element_trim_text_by']) {
5287 echo '<p>' . esc_html(wp_trim_words(get_the_excerpt(), $settings['element_word_count'])) . '</p>';
5288 } else {
5289 $trimmed = implode('', array_slice(str_split(get_the_excerpt()), 0, $settings['element_letter_count']));
5290 echo '<p>' . esc_html($trimmed) . '...</p>';
5291 }
5292 echo '</div></div>';
5293 }
5294
5295 public function render_post_date($settings, $class)
5296 {
5297 echo "<div class=\"$class\"><div class=\"inner-block\"><span>";
5298 $this->render_extra_text_and_icon($settings, 'before');
5299
5300 // Show modified time or published time
5301 echo ('yes' === $settings['show_last_update_date'])
5302 ? esc_html(get_the_modified_time(get_option('date_format')))
5303 : esc_html(apply_filters('the_date', get_the_date(), get_option('date_format'), '', ''));
5304
5305 $this->render_extra_text_and_icon($settings, 'after');
5306 echo '</span></div></div>';
5307 }
5308
5309 public function render_post_time($settings, $class)
5310 {
5311 echo "<div class=\"$class\"><div class=\"inner-block\"><span>";
5312 $this->render_extra_text_and_icon($settings, 'before');
5313
5314 echo esc_html(get_the_time());
5315
5316 $this->render_extra_text_and_icon($settings, 'after');
5317 echo '</span></div></div>';
5318 }
5319
5320 public function render_post_author($settings, $class)
5321 {
5322 $author_id = get_post_field('post_author');
5323
5324 echo "<div class=\"$class\"><div class=\"inner-block\">";
5325 $this->render_extra_text_and_icon($settings, 'before');
5326
5327 echo '<a href="' . esc_url(get_author_posts_url($author_id)) . '">';
5328 $this->render_extra_text_and_icon($settings, 'before', true);
5329
5330 if ('yes' === $settings['element_show_avatar']) {
5331 echo get_avatar($author_id, $settings['element_avatar_size']);
5332 }
5333 echo '<span>' . esc_html(get_the_author_meta('display_name', $author_id)) . '</span>';
5334 $this->render_extra_text_and_icon($settings, 'after', true);
5335 echo '</a>';
5336
5337 $this->render_extra_text_and_icon($settings, 'after');
5338 echo '</div></div>';
5339 }
5340
5341 public function render_post_comments($settings, $class)
5342 {
5343 if (!comments_open()) {
5344 return;
5345 }
5346 $count = get_comments_number();
5347 if ($count === 1) {
5348 $text = $count . ' ' . $settings['element_comments_text_2'];
5349 } elseif ($count > 1) {
5350 $text = $count . ' ' . $settings['element_comments_text_3'];
5351 } else {
5352 $text = $settings['element_comments_text_1'];
5353 }
5354
5355 echo "<div class=\"$class\"><div class=\"inner-block\">";
5356 $this->render_extra_text_and_icon($settings, 'before');
5357
5358 echo '<a href="' . esc_url(get_comments_link()) . '">';
5359 $this->render_extra_text_and_icon($settings, 'before', true);
5360 echo '<span>' . esc_html($text) . '</span>';
5361 $this->render_extra_text_and_icon($settings, 'after', true);
5362 echo '</a>';
5363
5364 $this->render_extra_text_and_icon($settings, 'after');
5365 echo '</div></div>';
5366 }
5367
5368 public function render_post_read_more($settings, $class)
5369 {
5370 $open_links_in_new_tab = ('yes' === $settings['open_links_in_new_tab']) ? '_blank' : '_self';
5371 $read_more_animation = king_addons_freemius()->can_use_premium_code__premium_only()
5372 ? $settings['read_more_animation']
5373 : 'king-addons-button-none';
5374
5375 echo "<div class=\"$class\"><div class=\"inner-block\">";
5376 echo "<a target=\"$open_links_in_new_tab\" href=\"" . esc_url(get_the_permalink()) . "\" class=\"king-addons-button-effect " . esc_attr($read_more_animation) . "\">";
5377 $this->render_extra_text_and_icon($settings, 'before', true);
5378 echo '<span>' . esc_html($settings['element_read_more_text']) . '</span>';
5379 $this->render_extra_text_and_icon($settings, 'after', true);
5380 echo '</a>';
5381 echo '</div></div>';
5382 }
5383
5384 public function render_post_likes($settings, $class, $post_id)
5385 {
5386 // Intentionally empty; placeholder for likes
5387 }
5388
5389 public function render_post_sharing_icons($settings, $class)
5390 {
5391 // Intentionally empty; placeholder for sharing icons
5392 }
5393
5394 public function render_post_custom_field($settings, $class, $post_id)
5395 {
5396 // Intentionally empty; placeholder for custom fields
5397 }
5398
5399 public function render_post_element_separator($settings, $class)
5400 {
5401 echo "<div class=\"$class {$settings['element_separator_style']}\">";
5402 echo '<div class="inner-block"><span></span></div>';
5403 echo '</div>';
5404 }
5405
5406 public function render_post_taxonomies($settings, $class, $post_id)
5407 {
5408 $terms = wp_get_post_terms($post_id, $settings['element_select']);
5409 $count = 0;
5410 $pointer = king_addons_freemius()->can_use_premium_code__premium_only();
5411
5412 // Pointer settings
5413 $tax1_pointer = $pointer ? $this->get_settings()['tax1_pointer'] : 'none';
5414 $tax1_pointer_animation = $pointer ? $this->get_settings()['tax1_pointer_animation'] : 'fade';
5415 $tax2_pointer = $pointer ? $this->get_settings()['tax2_pointer'] : 'none';
5416 $tax2_pointer_animation = $pointer ? $this->get_settings()['tax2_pointer_animation'] : 'fade';
5417
5418 if ($settings['element_tax_style'] === 'king-addons-grid-tax-style-1') {
5419 $class .= " king-addons-pointer-$tax1_pointer king-addons-pointer-fx-$tax1_pointer_animation";
5420 } else {
5421 $class .= " king-addons-pointer-$tax2_pointer king-addons-pointer-fx-$tax2_pointer_animation";
5422 }
5423 $class .= ' king-addons-pointer-line-fx';
5424
5425 $pointer_item_class = (
5426 (isset($this->get_settings()['tax1_pointer']) && $this->get_settings()['tax1_pointer'] !== 'none') ||
5427 (isset($this->get_settings()['tax2_pointer']) && $this->get_settings()['tax2_pointer'] !== 'none')
5428 ) ? 'king-addons-pointer-item' : '';
5429
5430 echo "<div class=\"$class {$settings['element_tax_style']}\">";
5431 echo '<div class="inner-block">';
5432
5433 $this->render_extra_text_and_icon($settings, 'before');
5434
5435 foreach ($terms as $term) {
5436 // Check if premium color styling
5437 $enable_custom_colors = $pointer ? $this->get_settings()['tax1_custom_color_switcher'] : '';
5438 if ('yes' === $enable_custom_colors) {
5439 $cfc_text = get_term_meta($term->term_id, $this->get_settings()['tax1_custom_color_field_text'], true);
5440 $cfc_bg = get_term_meta($term->term_id, $this->get_settings()['tax1_custom_color_field_bg'], true);
5441
5442 if ($cfc_text || $cfc_bg) {
5443 $style_block = "color:$cfc_text; background-color:$cfc_bg; border-color:$cfc_bg;";
5444 $css_selector = '.elementor-element' . $this->get_unique_selector() . " .king-addons-grid-tax-style-1 .inner-block a.king-addons-tax-id-$term->term_id";
5445 echo "<style>$css_selector{{$style_block}}</style>";
5446 }
5447 }
5448
5449 echo "<a class=\"$pointer_item_class king-addons-tax-id-$term->term_id\" href=\"" . esc_url(get_term_link($term->term_id)) . "\">";
5450 echo esc_html($term->name);
5451 if (++$count !== count($terms)) {
5452 echo '<span class="tax-sep">' . esc_html($settings['element_tax_sep']) . '</span>';
5453 }
5454 echo '</a>';
5455 }
5456
5457 $this->render_extra_text_and_icon($settings, 'after');
5458
5459 echo '</div></div>';
5460 }
5461
5462 /**
5463 * Helper function to render extra text/icon before or after
5464 *
5465 * @param array $settings
5466 * @param string $position 'before'|'after'
5467 * @param bool $iconOnly Render icon only if true
5468 * @noinspection PhpMissingParamTypeInspection
5469 */
5470 private function render_extra_text_and_icon($settings, $position, $iconOnly = false)
5471 {
5472 if ($iconOnly) {
5473 // Render icon
5474 if ($position === $settings['element_extra_icon_pos']) {
5475 ob_start();
5476 Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']);
5477 $extra_icon = ob_get_clean();
5478
5479 echo '<span class="king-addons-grid-extra-icon-' . esc_attr($position) . '">';
5480 echo $extra_icon;
5481 echo '</span>';
5482 }
5483 } else {
5484 // Render text
5485 if ($position === $settings['element_extra_text_pos']) {
5486 echo '<span class="king-addons-grid-extra-text-' . esc_attr($position) . '">';
5487 echo esc_html($settings['element_extra_text']);
5488 echo '</span>';
5489 }
5490 }
5491 }
5492
5493 public function get_elements($type, $settings, $class, $post_id)
5494 {
5495 // Fallback for any pro-only items
5496 if (in_array($type, ['pro-lk', 'pro-shr', 'pro-cf'], true)) {
5497 $type = 'title';
5498 }
5499
5500 switch ($type) {
5501 case 'title':
5502 $this->render_post_title($settings, $class);
5503 break;
5504 case 'content':
5505 $this->render_post_content($settings, $class);
5506 break;
5507 case 'excerpt':
5508 $this->render_post_excerpt($settings, $class);
5509 break;
5510 case 'date':
5511 $this->render_post_date($settings, $class);
5512 break;
5513 case 'time':
5514 $this->render_post_time($settings, $class);
5515 break;
5516 case 'author':
5517 $this->render_post_author($settings, $class);
5518 break;
5519 case 'comments':
5520 $this->render_post_comments($settings, $class);
5521 break;
5522 case 'read-more':
5523 $this->render_post_read_more($settings, $class);
5524 break;
5525 case 'likes':
5526 $this->render_post_likes($settings, $class, $post_id);
5527 break;
5528 case 'sharing':
5529 $this->render_post_sharing_icons($settings, $class);
5530 break;
5531 case 'custom-field':
5532 $this->render_post_custom_field($settings, $class, $post_id);
5533 break;
5534 case 'separator':
5535 $this->render_post_element_separator($settings, $class);
5536 break;
5537 default:
5538 $this->render_post_taxonomies($settings, $class, $post_id);
5539 }
5540 }
5541
5542 public function get_elements_by_location($location, $settings, $post_id)
5543 {
5544 $locations = [];
5545
5546 // Build the elements array by location
5547 foreach ($settings['grid_elements'] as $data) {
5548 // Force it to 'over' in original code
5549 $place = 'over';
5550 $align_vr = king_addons_freemius()->can_use_premium_code__premium_only()
5551 ? $data['element_align_vr']
5552 : 'bottom';
5553
5554 if (!isset($locations[$place])) {
5555 $locations[$place] = [];
5556 }
5557 /** @noinspection PhpConditionAlreadyCheckedInspection */
5558 if ('over' === $place) {
5559 if (!isset($locations[$place][$align_vr])) {
5560 $locations[$place][$align_vr] = [];
5561 }
5562 $locations[$place][$align_vr][] = $data;
5563 } else {
5564 $locations[$place][] = $data;
5565 }
5566 }
5567
5568 // Render elements in the correct location
5569 if (empty($locations[$location])) {
5570 return;
5571 }
5572
5573 if ('over' === $location) {
5574 foreach ($locations[$location] as $align => $elements) {
5575 if ('middle' === $align) {
5576 echo '<div class="king-addons-cv-container"><div class="king-addons-cv-outer"><div class="king-addons-cv-inner">';
5577 }
5578 echo '<div class="king-addons-grid-media-hover-' . esc_attr($align) . ' elementor-clearfix">';
5579 foreach ($elements as $data) {
5580 $class = 'king-addons-grid-item-' . $data['element_select'] .
5581 ' elementor-repeater-item-' . $data['_id'] .
5582 ' king-addons-grid-item-display-' . $data['element_display'] .
5583 ' king-addons-grid-item-align-' . $data['element_align_hr'] .
5584 $this->get_animation_class($data, 'element');
5585 $this->get_elements($data['element_select'], $data, $class, $post_id);
5586 }
5587 echo '</div>';
5588 if ('middle' === $align) {
5589 echo '</div></div></div>';
5590 }
5591 }
5592 } else {
5593 echo '<div class="king-addons-grid-item-' . esc_attr($location) . '-content elementor-clearfix">';
5594 foreach ($locations[$location] as $data) {
5595 $class = 'king-addons-grid-item-' . $data['element_select'] .
5596 ' elementor-repeater-item-' . $data['_id'] .
5597 ' king-addons-grid-item-display-' . $data['element_display'] .
5598 ' king-addons-grid-item-align-' . $data['element_align_hr'];
5599 $this->get_elements($data['element_select'], $data, $class, $post_id);
5600 }
5601 echo '</div>';
5602 }
5603 }
5604
5605 public function add_slider_settings($settings)
5606 {
5607 $slider_is_rtl = is_rtl();
5608 $slider_direction = $slider_is_rtl ? 'rtl' : 'ltr';
5609
5610 $slider_options = [
5611 'rtl' => $slider_is_rtl,
5612 'slidesToShow' => 1,
5613 'infinite' => ('yes' === $settings['slider_loop']),
5614 'speed' => absint($settings['slider_effect_duration'] * 1000),
5615 'arrows' => true,
5616 'autoplay' => ('yes' === $settings['slider_autoplay']),
5617 'autoplaySpeed' => absint($settings['slider_autoplay_duration'] * 1000),
5618 'pauseOnHover' => $settings['slider_pause_on_hover'],
5619 'prevArrow' => '#king-addons-grid-slider-prev-' . $this->get_id(),
5620 'nextArrow' => '#king-addons-grid-slider-next-' . $this->get_id(),
5621 ];
5622
5623 $this->add_render_attribute('slider-settings', [
5624 'dir' => esc_attr($slider_direction),
5625 'data-slick' => wp_json_encode($slider_options),
5626 ]);
5627 }
5628
5629 public function render_magazine_grid($settings, $slide_offset)
5630 {
5631 $posts = new WP_Query($this->get_main_query_args($slide_offset));
5632
5633 // Check premium fallback for layout
5634 if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
5635 $restricted_layouts = ['1-2', '1-3', '1-4', '1-1-2', '2-1-2', '1vh-3h'];
5636 if (in_array($settings['king_addons_grid_layout_select'], $restricted_layouts, true)) {
5637 $settings['king_addons_grid_layout_select'] = '1-1-3';
5638 }
5639 }
5640
5641 echo '<section class="king-addons-magazine-grid king-addons-magazine-grid-add-' . esc_attr($settings['king_addons_grid_layout_select']) .
5642 ' king-addons-magazine-grid-add-rows-' . esc_attr($settings['layout_rows_number']) . '">';
5643
5644 if ($posts->have_posts()) :
5645 // Randomize if needed
5646 if ($settings['query_randomize'] === 'rand' && is_front_page() && !Core::isBlogArchive()) {
5647 shuffle($posts->posts);
5648 }
5649
5650 while ($posts->have_posts()) :
5651 $posts->the_post();
5652 $post_class = implode(' ', get_post_class('king-addons-magazine-grid-item elementor-clearfix', get_the_ID()));
5653
5654 echo "<article class=\"$post_class\">";
5655 $this->render_password_protected_input();
5656
5657 echo '<div class="king-addons-grid-item-inner">';
5658 echo '<div class="king-addons-grid-media-wrap" data-overlay-link="' . esc_attr($settings['overlay_post_link']) . '">';
5659
5660 $this->render_post_thumbnail($settings, get_the_ID());
5661
5662 echo '<div class="king-addons-grid-media-hover king-addons-animation-wrap">';
5663 $this->render_media_overlay($settings);
5664 $this->get_elements_by_location('over', $settings, get_the_ID());
5665 echo '</div></div></div></article>';
5666
5667 endwhile;
5668 wp_reset_postdata();
5669 else:
5670 echo '<h2>' . esc_html($settings['query_not_found_text']) . '</h2>';
5671 endif;
5672
5673 echo '</section>';
5674 }
5675
5676 protected function render()
5677 {
5678 $settings = $this->get_settings();
5679 $render_attribute = '';
5680
5681 // If no premium, reset slider options
5682 if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
5683 $settings['slider_enable'] = '';
5684 $settings['slider_effect'] = '';
5685 }
5686
5687 // Add slider settings if enabled
5688 if ('yes' === $settings['slider_enable']) {
5689 $this->add_slider_settings($settings);
5690 $render_attribute = $this->get_render_attribute_string('slider-settings');
5691 }
5692
5693 echo '<div class="king-addons-magazine-grid-wrap" ' . $render_attribute .
5694 ' data-slide-effect="' . esc_attr($settings['slider_effect']) . '">';
5695
5696 if ('yes' === $settings['slider_enable']) {
5697 for ($i = 0; $i < $settings['slider_amount']; $i++) {
5698 echo '<div class="king-addons-magazine-slide">';
5699 $this->render_magazine_grid($settings, $i);
5700 echo '</div>';
5701 }
5702 } else {
5703 $this->render_magazine_grid($settings, 0);
5704 }
5705
5706 echo '</div>';
5707
5708 // Slider arrows
5709 if ('yes' === $settings['slider_enable']) {
5710 echo '<div class="king-addons-grid-slider-arrow-container">';
5711 echo '<div class="king-addons-grid-slider-prev-arrow king-addons-grid-slider-arrow" id="king-addons-grid-slider-prev-' . esc_html($this->get_id()) . '">';
5712 echo Core::getIcon($settings['slider_nav_icon'], '');
5713 echo '</div>';
5714 echo '<div class="king-addons-grid-slider-next-arrow king-addons-grid-slider-arrow" id="king-addons-grid-slider-next-' . esc_html($this->get_id()) . '">';
5715 echo Core::getIcon($settings['slider_nav_icon'], '');
5716 echo '</div>';
5717 echo '</div>';
5718 }
5719 }
5720 }