PluginProbe
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder / 2.0.5
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder v2.0.5
3.1.4 3.0.8 3.0.9 3.1.0 3.1.2 3.1.3 3.0.7 3.0.5 3.0.4 3.0.3 3.0.2 trunk 1.5.0 1.5.1 1.5.2 1.6.1 1.6.2 1.6.3 1.6.4 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 All 93 releases
ultimate-store-kit / traits / global-terms-query-controls.php

global-terms-query-controls.php in Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder 2.0.5, at traits/global-terms-query-controls.php

169 lines 5.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace UltimateStoreKit\Traits;
4
5 use Elementor\Controls_Manager;
6
7 defined('ABSPATH') || die();
8 trait Global_Terms_Query_Controls {
9 protected function render_terms_query_controls($taxonomy = 'category') {
10
11 $this->start_controls_section(
12 'section_term_query',
13 [
14 'label' => __('Query', 'ultimate-store-kit'),
15 'tab' => Controls_Manager::TAB_CONTENT,
16 ]
17 );
18
19 $this->add_control(
20 'display_category',
21 [
22 'label' => __('Type', 'ultimate-store-kit'),
23 'type' => Controls_Manager::SELECT,
24 'default' => 'all',
25 'options' => [
26 'all' => __('All', 'ultimate-store-kit'),
27 'parents' => __('Only Parents', 'ultimate-store-kit'),
28 'child' => __('Only Child', 'ultimate-store-kit')
29 ],
30 ]
31 );
32
33 // $this->add_control(
34 // 'item_limit',
35 // [
36 // 'label' => esc_html__('Item Limit', 'ultimate-store-kit'),
37 // 'type' => Controls_Manager::SLIDER,
38 // 'range' => [
39 // 'px' => [
40 // 'min' => 1,
41 // 'max' => 20,
42 // ],
43 // ],
44 // 'default' => [
45 // 'size' => 6,
46 // ],
47 // ]
48 // );
49
50 $this->start_controls_tabs(
51 'tabs_terms_include_exclude',
52 [
53 'condition' => ['display_category' => 'all']
54 ]
55 );
56 $this->start_controls_tab(
57 'tab_term_include',
58 [
59 'label' => __('Include', 'ultimate-store-kit'),
60 'condition' => ['display_category' => 'all']
61 ]
62 );
63
64 $this->add_control(
65 'cats_include_by_id',
66 [
67 'label' => __('Categories', 'ultimate-store-kit'),
68 'type' => Controls_Manager::SELECT2,
69 'multiple' => true,
70 'label_block' => true,
71 'condition' => [
72 'display_category' => 'all'
73 ],
74 'options' => ultimate_store_kit_get_category($taxonomy),
75 ]
76 );
77
78 $this->end_controls_tab();
79
80 $this->start_controls_tab(
81 'tab_term_exclude',
82 [
83 'label' => __('Exclude', 'ultimate-store-kit'),
84 'condition' => ['display_category' => 'all']
85 ]
86 );
87
88 $this->add_control(
89 'cats_exclude_by_id',
90 [
91 'label' => __('Categories', 'ultimate-store-kit'),
92 'type' => Controls_Manager::SELECT2,
93 'multiple' => true,
94 'label_block' => true,
95 'condition' => [
96 'display_category' => 'all'
97 ],
98 'options' => ultimate_store_kit_get_category($taxonomy),
99 ]
100 );
101
102 $this->end_controls_tab();
103 $this->end_controls_tabs();
104 $this->add_control(
105 'child_cats_notice',
106 [
107 'type' => Controls_Manager::RAW_HTML,
108 'raw' => __('WARNING!, Must Select Parent Category from Child Categories of.', 'ultimate-store-kit'),
109 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
110 'condition' => [
111 'display_category' => 'child',
112 'parent_cats' => 'none'
113 ],
114 ],
115 );
116 $this->add_control(
117 'parent_cats',
118 [
119 'label' => __('Child Categories of', 'ultimate-store-kit'),
120 'type' => Controls_Manager::SELECT,
121 'default' => 'none',
122 'options' => ultimate_store_kit_get_only_parent_cats($taxonomy),
123 'condition' => [
124 'display_category' => 'child'
125 ],
126 ]
127 );
128
129
130 $this->add_control(
131 'orderby',
132 [
133 'label' => __('Order By', 'ultimate-store-kit'),
134 'type' => Controls_Manager::SELECT,
135 'default' => 'name',
136 'options' => [
137 'name' => esc_html__('Name', 'ultimate-store-kit'),
138 'count' => esc_html__('Count', 'ultimate-store-kit'),
139 'slug' => esc_html__('Slug', 'ultimate-store-kit'),
140 // 'menu_order' => esc_html__('Menu Order', 'ultimate-store-kit'),
141 // 'rand' => esc_html__('Random', 'ultimate-store-kit'),
142 ],
143 ]
144 );
145
146 $this->add_control(
147 'order',
148 [
149 'label' => __('Order', 'ultimate-store-kit'),
150 'type' => Controls_Manager::SELECT,
151 'default' => 'desc',
152 'options' => [
153 'desc' => __('Descending', 'ultimate-store-kit'),
154 'asc' => __('Ascending', 'ultimate-store-kit'),
155 ],
156 ]
157 );
158 $this->add_control(
159 'hide_empty',
160 [
161 'label' => __('Hide Empty', 'ultimate-store-kit'),
162 'type' => Controls_Manager::SWITCHER,
163 ]
164 );
165
166 $this->end_controls_section();
167 }
168 }
169