PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / 2.5.0
Forumax – AI Powered Advanced Community Forum Plugin v2.5.0
2.5.1 2.5.0 2.4.4 2.4.3 2.4.2 2.4.1 2.4.0 trunk 1.0.8 1.1.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 All 31 releases
← All changes | includes/Elementor/Forum_Tab.php +101 -52 1.1.0 → 2.5.0 View file →
@@ -15,17 +15,17 @@
15 15 return 'ama_forum_tab';
16 16 }
17 17
18 18 public function get_title() {
19 - return esc_html__( 'BBPC Forum Tabs', 'bbp-core' );
19 + return esc_html__( 'Forum Tabs (Forumax)', 'forumax' );
20 20 }
21 21
22 22 public function get_icon() {
23 - return 'bbpc_icon_ama_forum_tab';
23 + return 'bbpc_icon_ama_forum_tab eicon-tabs';
24 24 }
25 25
26 26 public function get_categories() {
27 - return [ 'bbp-core' ];
27 + return [ 'forumax' ];
28 28 }
29 29
30 30 public function get_style_depends() {
31 31 return['bbpc-el-widgets'];
@@ -32,34 +32,36 @@
32 32 }
33 33
34 34 // scripts dependencies
35 35 public function get_script_depends() {
36 - return [ '' ];
36 + return [ 'bbpc-forumTab' ];
37 37 }
38 38
39 39
40 - protected function register_controls() {
41 - // --- Forum Filter Options
40 + protected function register_controls(): void
41 + {
42 +
43 +
44 + //======================= Forum Filter Options ==================
42 45 $this->start_controls_section(
43 46 'forum_filter', [
44 - 'label' => __( 'Forum Filter Options', 'bbp-core' ),
47 + 'label' => __( 'Forum Filter Options', 'forumax' ),
45 48 ]
46 49 );
47 50
48 51 $this->add_control(
49 - 'forum_tab_title',
50 - [
51 - 'label' => __( 'Forum Tab Title', 'bbp-core' ),
52 + 'forum_tab_title', [
53 + 'label' => __( 'Forum Tab Title', 'forumax' ),
52 54 'type' => \Elementor\Controls_Manager::TEXT,
53 - 'default' => __( 'Show Forums', 'bbp-core' ),
54 - 'placeholder' => __( 'Enter the tab title', 'bbp-core' ),
55 + 'default' => __( 'Show Forums', 'forumax' ),
56 + 'placeholder' => __( 'Enter the tab title', 'forumax' ),
55 57 ]
56 58 );
57 59
58 60 $this->add_control(
59 61 'ppp', [
60 - 'label' => esc_html__( 'Show Forums', 'bbp-core' ),
61 - 'description' => esc_html__( 'Show the forums count at the initial view. Default is 9 forums in a row.', 'bbp-core' ),
62 + 'label' => esc_html__( 'Show Forums', 'forumax' ),
63 + 'description' => esc_html__( 'Show the forums count at the initial view. Default is 9 forums in a row.', 'forumax' ),
62 64 'default' => 9
63 65 ]
64 66 );
65 67
@@ -64,9 +66,9 @@
64 66 );
65 67
66 68 $this->add_control(
67 69 'order', [
68 - 'label' => esc_html__( 'Order', 'bbp-core' ),
70 + 'label' => esc_html__( 'Order', 'forumax' ),
69 71 'type' => Controls_Manager::SELECT,
70 72 'options' => [
71 73 'ASC' => 'ASC',
72 74 'DESC' => 'DESC'
@@ -74,56 +76,78 @@
74 76 'default' => 'ASC'
75 77 ]
76 78 );
77 79
80 + //==== View More Button
81 + $this->add_control(
82 + 'more_txt_heading', [
83 + 'label' => esc_html__( 'View More Button', 'forumax' ),
84 + 'type' => Controls_Manager::HEADING,
85 + 'separator' => 'before',
86 + ]
87 + );
88 +
89 + $this->add_control(
90 + 'is_forum_tab_btn', [
91 + 'label' => esc_html__( 'Button (Show/Hide)', 'forumax' ),
92 + 'type' => \Elementor\Controls_Manager::SWITCHER,
93 + 'label_on' => esc_html__( 'Show', 'forumax' ),
94 + 'label_off' => esc_html__( 'Hide', 'forumax' ),
95 + 'return_value' => 'yes',
96 + 'default' => 'yes',
97 + ]
98 + );
99 +
78 100 $this->add_control(
79 101 'more_txt', [
80 - 'label' => esc_html__( 'More button text', 'bbp-core' ),
102 + 'label' => esc_html__( 'Button Label', 'forumax' ),
81 103 'type' => Controls_Manager::TEXT,
82 104 'label_block' => true,
83 - 'separator' => 'before',
84 - 'default' => 'Show more'
105 + 'default' => esc_html__('View More', 'forumax'),
106 + 'condition' => [
107 + 'is_forum_tab_btn' => 'yes'
108 + ]
85 109 ]
86 110 );
87 111
88 112 $this->add_control(
89 - 'more_url',
90 - [
91 - 'label' => esc_html__( 'More button link', 'bbp-core' ),
113 + 'more_url', [
114 + 'label' => esc_html__( 'Button URL', 'forumax' ),
92 115 'type' => \Elementor\Controls_Manager::URL,
93 - 'placeholder' => __( 'https://your-link.com', 'bbp-core' ),
94 116 'default' => [
95 - 'url' => get_post_type_archive_link( 'forum' ),
117 + 'url' => '#',
96 118 'is_external' => true,
97 119 'nofollow' => true,
98 120 ],
121 + 'condition' => [
122 + 'is_forum_tab_btn' => 'yes'
123 + ]
99 124 ]
100 - );
125 + ); //End View More Button
101 126
127 + $this->end_controls_section(); // End Forum Filter Options
102 128
103 - $this->end_controls_section();
104 129
105 - //-------- Topic Filter Options
130 + //======================== Topic Filter Options =========================//
106 131 $this->start_controls_section(
107 132 'topic_filter', [
108 - 'label' => __( 'Topic Filter Options', 'bbp-core' ),
133 + 'label' => __( 'Topic Filter Options', 'forumax' ),
109 134 ]
110 135 );
111 136
112 137 $this->add_control(
113 - 'topics_tab_title',
114 - [
115 - 'label' => __( 'Topics Tab Title', 'bbp-core' ),
138 + 'topics_tab_title', [
139 + 'label' => __( 'Topics Tab Title', 'forumax' ),
116 140 'type' => \Elementor\Controls_Manager::TEXT,
117 - 'default' => __( 'Show Topics', 'bbp-core' ),
118 - 'placeholder' => __( 'Enter the tab title', 'bbp-core' ),
141 + 'default' => __( 'Show Topics', 'forumax' ),
142 + 'placeholder' => __( 'Enter the tab title', 'forumax' ),
119 143 ]
120 144 );
121 145
122 146 $this->add_control(
123 147 'ppp2', [
124 - 'label' => esc_html__( 'Show Forums', 'bbp-core' ),
125 - 'description' => esc_html__( 'Show the forums count at the initial view. Default is 9 forums in a row.', 'bbp-core' ),
148 + 'label' => esc_html__( 'Show Forums', 'forumax' ),
149 + 'description' => esc_html__( 'Show the forums count at the initial view. Default is 9 forums in a row.', 'forumax' ),
126 150 'label_block' => true,
127 151 'default' => 6
128 152 ]
129 153 );
@@ -129,9 +153,9 @@
129 153 );
130 154
131 155 $this->add_control(
132 156 'order2', [
133 - 'label' => esc_html__( 'Order', 'bbp-core' ),
157 + 'label' => esc_html__( 'Order', 'forumax' ),
134 158 'type' => Controls_Manager::SELECT,
135 159 'options' => [
136 160 'ASC' => 'ASC',
137 161 'DESC' => 'DESC'
@@ -139,45 +163,73 @@
139 163 'default' => 'ASC'
140 164 ]
141 165 );
142 166
167 + //==== View More Button
168 + $this->add_control(
169 + 'more_txt2_heading', [
170 + 'label' => esc_html__( 'View More Button', 'forumax' ),
171 + 'type' => Controls_Manager::HEADING,
172 + 'separator' => 'before',
173 + ]
174 + );
175 +
176 + $this->add_control(
177 + 'is_topic_tab_btn', [
178 + 'label' => esc_html__( 'Button (Show/Hide)', 'forumax' ),
179 + 'type' => \Elementor\Controls_Manager::SWITCHER,
180 + 'label_on' => esc_html__( 'Show', 'forumax' ),
181 + 'label_off' => esc_html__( 'Hide', 'forumax' ),
182 + 'return_value' => 'yes',
183 + 'default' => 'yes',
184 + ]
185 + );
186 +
187 +
143 188 $this->add_control(
144 189 'more_txt2', [
145 - 'label' => esc_html__( 'More button text', 'bbp-core' ),
190 + 'label' => esc_html__( 'Button Label', 'forumax' ),
146 191 'type' => Controls_Manager::TEXT,
147 192 'label_block' => true,
148 - 'default' => 'Show more'
193 + 'default' => esc_html__('View More', 'forumax'),
194 + 'condition' => [
195 + 'is_topic_tab_btn' => 'yes'
196 + ]
149 197 ]
150 198 );
151 199
152 200 $this->add_control(
153 201 'more_url2', [
154 - 'label' => esc_html__( 'More button link', 'bbp-core' ),
202 + 'label' => esc_html__( 'Button URL', 'forumax' ),
155 203 'type' => \Elementor\Controls_Manager::URL,
156 - 'placeholder' => __( 'https://your-link.com', 'bbp-core' ),
157 204 'default' => [
158 - 'url' => get_post_type_archive_link( 'topic' ),
205 + 'url' => '#',
159 206 'is_external' => true,
160 207 'nofollow' => true,
161 208 ],
209 + 'condition' => [
210 + 'is_topic_tab_btn' => 'yes'
211 + ]
162 212 ]
163 213 );
164 214
165 - $this->end_controls_section();
215 + $this->end_controls_section(); //End Topic Filter Options
166 216
217 +
218 + //===================== Forum Tab Title ======================//
167 219 $this->start_controls_section(
168 220 'forum_tab_style', [
169 - 'label' => __( 'Forum Tab Title', 'bbp-core' ),
221 + 'label' => __( 'Forum Tab Title', 'forumax' ),
170 222 'tab' => Controls_Manager::TAB_STYLE,
171 223 ]
172 224 );
173 225
226 +
174 227 $this->add_group_control(
175 228 \Elementor\Group_Control_Typography::get_type(),
176 229 [
177 230 'name' => 'forum_tab_title',
178 - 'label' => __( 'Tab Label Typography', 'bbp-core' ),
179 - 'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
231 + 'label' => __( 'Tab Label Typography', 'forumax' ),
180 232 'selector' => '{{WRAPPER}} .community-area .nav-tabs .nav-item button',
181 233 ]
182 234 );
183 235
@@ -183,14 +235,10 @@
183 235
184 236 $this->add_control(
185 237 'forum_tab_title_color',
186 238 [
187 - 'label' => __( 'Tab Label Color', 'bbp-core' ),
239 + 'label' => __( 'Tab Label Color', 'forumax' ),
188 240 'type' => \Elementor\Controls_Manager::COLOR,
189 - 'scheme' => [
190 - 'type' => \Elementor\Core\Schemes\Color::get_type(),
191 - 'value' => \Elementor\Core\Schemes\Color::COLOR_1,
192 - ],
193 241 'selectors' => [
194 242 '{{WRAPPER}} .community-area .nav-tabs .nav-item button' => 'color: {{VALUE}}',
195 243 ],
196 244 ]
@@ -197,11 +245,12 @@
197 245 );
198 246
199 247 $this->end_controls_section();
200 248
249 +
201 250 $this->start_controls_section(
202 251 'forum_tab_button', [
203 - 'label' => esc_html__( 'Forum Tab Button', 'bbp-core' ),
252 + 'label' => esc_html__( 'Forum Tab Button', 'forumax' ),
204 253 'tab' => Controls_Manager::TAB_STYLE,
205 254 ]
206 255 );
207 256
@@ -206,9 +255,9 @@
206 255 );
207 256
208 257 $this->add_responsive_control(
209 258 'tab_btn_margin', [
210 - 'label' => esc_html__( 'Margin', 'bbp-core' ),
259 + 'label' => esc_html__( 'Margin', 'forumax' ),
211 260 'type' => Controls_Manager::DIMENSIONS,
212 261 'size_units' => [ 'px', '%', 'em' ],
213 262 'selectors' => [
214 263 '{{WRAPPER}} .tab-content .show-more-btn.show-more-round' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
@@ -217,9 +266,9 @@
217 266 );
218 267
219 268 $this->add_responsive_control(
220 269 'tab_btn_padding', [
221 - 'label' => esc_html__( 'Tab button padding', 'bbp-core' ),
270 + 'label' => esc_html__( 'Tab button padding', 'forumax' ),
222 271 'type' => Controls_Manager::DIMENSIONS,
223 272 'size_units' => [ 'px', '%', 'em' ],
224 273 'selectors' => [
225 274 '{{WRAPPER}} .tab-content .show-more-btn.show-more-round' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',