PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 2.5.2
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v2.5.2
4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 All 200 releases
betterdocs / includes / Admin / Customizer / Sections / FaqBuilder.php

FaqBuilder.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 2.5.2, at includes/Admin/Customizer/Sections/FaqBuilder.php

748 lines 29.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPDeveloper\BetterDocs\Admin\Customizer\Sections;
4
5 use WP_Customize_Control;
6 use WPDeveloper\BetterDocs\Admin\Customizer\Controls\SelectControl;
7 use WPDeveloper\BetterDocs\Admin\Customizer\Controls\ToggleControl;
8 use WPDeveloper\BetterDocs\Admin\Customizer\Controls\SeparatorControl;
9 use WPDeveloper\BetterDocs\Admin\Customizer\Controls\AlphaColorControl;
10 use WPDeveloper\BetterDocs\Admin\Customizer\Controls\RadioImageControl;
11 use WPDeveloper\BetterDocs\Admin\Customizer\Controls\RangeValueControl;
12 use WPDeveloper\BetterDocs\Admin\Customizer\Controls\MultiDimensionControl;
13
14 class FaqBuilder extends Section {
15 /**
16 * Section Priority
17 * @var int
18 */
19 protected $priority = 600;
20
21 /**
22 * Get the section id.
23 * @return string
24 */
25 public function get_id() {
26 return 'betterdocs_faq_section';
27 }
28
29 /**
30 * Get the title of the section.
31 * @return string
32 */
33 public function get_title() {
34 return __( 'FAQ', 'betterdocs' );
35 }
36
37 public function section_seperator() {
38 $this->customizer->add_setting( 'betterdocs_faq_section_seperator', [
39 'default' => $this->defaults['betterdocs_faq_section_seperator'],
40 'sanitize_callback' => 'esc_html'
41 ] );
42
43 $this->customizer->add_control( new SeparatorControl(
44 $this->customizer, 'betterdocs_faq_section_seperator', [
45 'label' => __( 'Docs Page FAQ', 'betterdocs' ),
46 'settings' => 'betterdocs_faq_section_seperator',
47 'section' => 'betterdocs_faq_section',
48 'priority' => 624
49 ] )
50 );
51 }
52
53 public function faq_switch() {
54 $this->customizer->add_setting( 'betterdocs_faq_switch', [
55 'default' => $this->defaults['betterdocs_faq_switch'],
56 'capability' => 'edit_theme_options'
57 ] );
58
59 $this->customizer->add_control( new ToggleControl(
60 $this->customizer,
61 'betterdocs_faq_switch', [
62 'label' => __( 'Enable FAQ', 'betterdocs' ),
63 'section' => 'betterdocs_faq_section',
64 'settings' => 'betterdocs_faq_switch',
65 'type' => 'light', // light, ios, flat
66 'priority' => 625
67 ] )
68 );
69 }
70
71 public function select_specific_faq() {
72 $this->customizer->add_setting( 'betterdocs_select_specific_faq', [
73 'default' => $this->defaults['betterdocs_select_specific_faq'],
74 'capability' => 'edit_theme_options'
75 ] );
76
77 $this->customizer->add_control(
78 new WP_Customize_Control(
79 $this->customizer,
80 'betterdocs_select_specific_faq',
81 [
82 'label' => __( 'Select FAQ Groups', 'betterdocs' ),
83 'section' => 'betterdocs_faq_section',
84 'settings' => 'betterdocs_select_specific_faq',
85 'type' => 'select',
86 'choices' => betterdocs()->query->get_faq_terms( [
87 'all' => __( 'Show All', 'betterdocs' )
88 ] ),
89 'priority' => 626
90 ]
91 )
92 );
93 }
94
95 public function select_faq_template() {
96 $this->customizer->add_setting( 'betterdocs_select_faq_template', [
97 'default' => $this->defaults['betterdocs_select_faq_template'],
98 'capability' => 'edit_theme_options',
99 'sanitize_callback' => [$this->sanitizer, 'select']
100 ] );
101
102 $this->customizer->add_control(
103 new RadioImageControl(
104 $this->customizer,
105 'betterdocs_select_faq_template',
106 [
107 'type' => 'betterdocs-radio-image',
108 'settings' => 'betterdocs_select_faq_template',
109 'section' => 'betterdocs_faq_section',
110 'label' => __( 'Select FAQ Layout', 'betterdocs' ),
111 'priority' => 627,
112 'choices' => [
113 'layout-1' => [
114 'label' => __( 'Modern Layout', 'betterdocs' ),
115 'image' => $this->assets->icon( 'customizer/faq/layout-1.png', true )
116 ],
117 'layout-2' => [
118 'label' => __( 'Classic Layout', 'betterdocs' ),
119 'image' => $this->assets->icon( 'customizer/faq/layout-2.png', true )
120 ]
121 ]
122 ]
123 )
124 );
125 }
126
127 public function faq_title_text() {
128 $this->customizer->add_setting( 'betterdocs_faq_title_text', [
129 'default' => $this->defaults['betterdocs_faq_title_text'],
130 'capability' => 'edit_theme_options',
131 'sanitize_callback' => 'esc_html'
132 ] );
133
134 $this->customizer->add_control(
135 new SelectControl(
136 $this->customizer,
137 'betterdocs_faq_title_text',
138 [
139 'label' => __( 'Section Title Text', 'betterdocs' ),
140 'section' => 'betterdocs_faq_section',
141 'priority' => 628,
142 'settings' => 'betterdocs_faq_title_text',
143 'type' => 'text'
144 ]
145 )
146 );
147 }
148
149 public function faq_title_margin() {
150 $this->customizer->add_setting( 'betterdocs_faq_title_margin', [
151 'default' => $this->defaults['betterdocs_faq_title_margin'],
152 'transport' => 'postMessage',
153 'capability' => 'edit_theme_options'
154 ] );
155
156 $this->customizer->add_control(
157 new MultiDimensionControl(
158 $this->customizer,
159 'betterdocs_faq_title_margin',
160 [
161 'label' => __( 'FAQ Section Title Margin (PX)', 'betterdocs' ),
162 'section' => 'betterdocs_faq_section',
163 'settings' => 'betterdocs_faq_title_margin',
164 'priority' => 629,
165 'input_fields' => [
166 'input1' => __( 'top', 'betterdocs' ),
167 'input2' => __( 'right', 'betterdocs' ),
168 'input3' => __( 'bottom', 'betterdocs' ),
169 'input4' => __( 'left', 'betterdocs' )
170 ],
171 'defaults' => [
172 'input1' => 0,
173 'input2' => 0,
174 'input3' => 0,
175 'input4' => 0
176 ]
177 ]
178 )
179 );
180 }
181
182 public function faq_title_color() {
183 $this->customizer->add_setting( 'betterdocs_faq_title_color', [
184 'default' => $this->defaults['betterdocs_faq_title_color'],
185 'capability' => 'edit_theme_options',
186 'transport' => 'postMessage',
187 'sanitize_callback' => [$this->sanitizer, 'rgba']
188 ] );
189
190 $this->customizer->add_control(
191 new AlphaColorControl(
192 $this->customizer,
193 'betterdocs_faq_title_color',
194 [
195 'label' => __( 'Section Title Color', 'betterdocs' ),
196 'section' => 'betterdocs_faq_section',
197 'settings' => 'betterdocs_faq_title_color',
198 'priority' => 630
199 ]
200 )
201 );
202 }
203
204 public function faq_title_font_size() {
205 $this->customizer->add_setting( 'betterdocs_faq_title_font_size', [
206 'default' => $this->defaults['betterdocs_faq_title_font_size'],
207 'capability' => 'edit_theme_options',
208 'transport' => 'postMessage',
209 'sanitize_callback' => [$this->sanitizer, 'integer']
210 ] );
211
212 $this->customizer->add_control( new RangeValueControl(
213 $this->customizer, 'betterdocs_faq_title_font_size', [
214 'type' => 'betterdocs-range-value',
215 'section' => 'betterdocs_faq_section',
216 'settings' => 'betterdocs_faq_title_font_size',
217 'label' => __( 'Section Title Font Size', 'betterdocs' ),
218 'priority' => 631,
219 'input_attrs' => [
220 'class' => '',
221 'min' => 0,
222 'max' => 50,
223 'step' => 1,
224 'suffix' => 'px' // optional suffix
225 ]
226 ] )
227 );
228 }
229
230 public function faq_category_title_color() {
231 $this->customizer->add_setting( 'betterdocs_faq_category_title_color', [
232 'default' => $this->defaults['betterdocs_faq_category_title_color'],
233 'capability' => 'edit_theme_options',
234 'transport' => 'postMessage',
235 'sanitize_callback' => [$this->sanitizer, 'rgba']
236 ] );
237
238 $this->customizer->add_control(
239 new AlphaColorControl(
240 $this->customizer,
241 'betterdocs_faq_category_title_color',
242 [
243 'label' => __( 'Group Title Color', 'betterdocs' ),
244 'section' => 'betterdocs_faq_section',
245 'priority' => 632,
246 'settings' => 'betterdocs_faq_category_title_color'
247 ]
248 )
249 );
250 }
251
252 public function faq_category_name_font_size() {
253 $this->customizer->add_setting( 'betterdocs_faq_category_name_font_size', [
254 'default' => $this->defaults['betterdocs_faq_category_name_font_size'],
255 'capability' => 'edit_theme_options',
256 'transport' => 'postMessage',
257 'sanitize_callback' => [$this->sanitizer, 'integer']
258
259 ] );
260
261 $this->customizer->add_control( new RangeValueControl(
262 $this->customizer, 'betterdocs_faq_category_name_font_size', [
263 'type' => 'betterdocs-range-value',
264 'section' => 'betterdocs_faq_section',
265 'settings' => 'betterdocs_faq_category_name_font_size',
266 'label' => __( 'Group Title Font Size', 'betterdocs' ),
267 'priority' => 633,
268 'input_attrs' => [
269 'class' => '',
270 'min' => 0,
271 'max' => 50,
272 'step' => 1,
273 'suffix' => 'px' // optional suffix
274 ]
275 ] )
276 );
277 }
278
279 public function faq_category_name_padding() {
280 $this->customizer->add_setting( 'betterdocs_faq_category_name_padding', [
281 'default' => $this->defaults['betterdocs_faq_category_name_padding'],
282 'transport' => 'postMessage',
283 'capability' => 'edit_theme_options'
284 ] );
285
286 $this->customizer->add_control(
287 new MultiDimensionControl(
288 $this->customizer,
289 'betterdocs_faq_category_name_padding',
290 [
291 'label' => __( 'Group Title Padding (PX)', 'betterdocs' ),
292 'section' => 'betterdocs_faq_section',
293 'settings' => 'betterdocs_faq_category_name_padding',
294 'priority' => 634,
295 'input_fields' => [
296 'input1' => __( 'top', 'betterdocs' ),
297 'input2' => __( 'right', 'betterdocs' ),
298 'input3' => __( 'bottom', 'betterdocs' ),
299 'input4' => __( 'left', 'betterdocs' )
300 ],
301 'defaults' => [
302 'input1' => 20,
303 'input2' => 20,
304 'input3' => 20,
305 'input4' => 20
306 ]
307 ]
308 )
309 );
310 }
311
312 public function faq_list_color() {
313 $this->customizer->add_setting( 'betterdocs_faq_list_color', [
314 'default' => $this->defaults['betterdocs_faq_list_color'],
315 'capability' => 'edit_theme_options',
316 'transport' => 'postMessage',
317 'sanitize_callback' => [$this->sanitizer, 'rgba']
318 ] );
319
320 $this->customizer->add_control(
321 new AlphaColorControl(
322 $this->customizer,
323 'betterdocs_faq_list_color',
324 [
325 'label' => __( 'FAQ List Color', 'betterdocs' ),
326 'section' => 'betterdocs_faq_section',
327 'settings' => 'betterdocs_faq_list_color',
328 'priority' => 635
329 ]
330 )
331 );
332 }
333
334 public function faq_list_background_color() {
335 $this->customizer->add_setting( 'betterdocs_faq_list_background_color', [
336 'default' => $this->defaults['betterdocs_faq_list_background_color'],
337 'capability' => 'edit_theme_options',
338 'transport' => 'postMessage',
339 'sanitize_callback' => [$this->sanitizer, 'rgba']
340 ] );
341
342 $this->customizer->add_control(
343 new AlphaColorControl(
344 $this->customizer,
345 'betterdocs_faq_list_background_color',
346 [
347 'label' => __( 'FAQ List Background Color', 'betterdocs' ),
348 'section' => 'betterdocs_faq_section',
349 'settings' => 'betterdocs_faq_list_background_color',
350 'priority' => 636
351 ]
352 )
353 );
354 }
355
356 public function faq_list_content_background_color() {
357 $this->customizer->add_setting( 'betterdocs_faq_list_content_background_color', [
358 'default' => $this->defaults['betterdocs_faq_list_content_background_color'],
359 'capability' => 'edit_theme_options',
360 'transport' => 'postMessage',
361 'sanitize_callback' => [$this->sanitizer, 'rgba']
362 ] );
363
364 $this->customizer->add_control(
365 new AlphaColorControl(
366 $this->customizer,
367 'betterdocs_faq_list_content_background_color',
368 [
369 'label' => __( 'FAQ List Content Background Color', 'betterdocs' ),
370 'section' => 'betterdocs_faq_section',
371 'settings' => 'betterdocs_faq_list_content_background_color',
372 'priority' => 637
373 ]
374 )
375 );
376 }
377
378 public function faq_list_content_color() {
379 $this->customizer->add_setting( 'betterdocs_faq_list_content_color', [
380 'default' => $this->defaults['betterdocs_faq_list_content_color'],
381 'capability' => 'edit_theme_options',
382 'transport' => 'postMessage',
383 'sanitize_callback' => [$this->sanitizer, 'rgba']
384 ] );
385
386 $this->customizer->add_control(
387 new AlphaColorControl(
388 $this->customizer,
389 'betterdocs_faq_list_content_color',
390 [
391 'label' => __( 'FAQ List Content Color', 'betterdocs' ),
392 'section' => 'betterdocs_faq_section',
393 'settings' => 'betterdocs_faq_list_content_color',
394 'priority' => 638
395 ]
396 )
397 );
398 }
399
400 public function faq_list_content_font_size() {
401 $this->customizer->add_setting( 'betterdocs_faq_list_content_font_size', [
402 'default' => $this->defaults['betterdocs_faq_list_content_font_size'],
403 'capability' => 'edit_theme_options',
404 'transport' => 'postMessage',
405 'sanitize_callback' => [$this->sanitizer, 'integer']
406
407 ] );
408
409 $this->customizer->add_control( new RangeValueControl(
410 $this->customizer, 'betterdocs_faq_list_content_font_size', [
411 'type' => 'betterdocs-range-value',
412 'section' => 'betterdocs_faq_section',
413 'settings' => 'betterdocs_faq_list_content_font_size',
414 'label' => __( 'FAQ Content Font Size', 'betterdocs' ),
415 'priority' => 639,
416 'input_attrs' => [
417 'class' => '',
418 'min' => 0,
419 'max' => 50,
420 'step' => 1,
421 'suffix' => 'px' //optional suffix
422 ]
423 ] )
424 );
425 }
426
427 public function faq_list_font_size() {
428 $this->customizer->add_setting( 'betterdocs_faq_list_font_size', [
429 'default' => $this->defaults['betterdocs_faq_list_font_size'],
430 'capability' => 'edit_theme_options',
431 'transport' => 'postMessage',
432 'sanitize_callback' => [$this->sanitizer, 'integer']
433
434 ] );
435
436 $this->customizer->add_control( new RangeValueControl(
437 $this->customizer, 'betterdocs_faq_list_font_size', [
438 'type' => 'betterdocs-range-value',
439 'section' => 'betterdocs_faq_section',
440 'settings' => 'betterdocs_faq_list_font_size',
441 'label' => __( 'FAQ List Font Size', 'betterdocs' ),
442 'priority' => 640,
443 'input_attrs' => [
444 'class' => '',
445 'min' => 0,
446 'max' => 50,
447 'step' => 1,
448 'suffix' => 'px' // optional suffix
449 ]
450 ] )
451 );
452 }
453
454 public function faq_list_padding() {
455 $this->customizer->add_setting( 'betterdocs_faq_list_padding', [
456 'default' => $this->defaults['betterdocs_faq_list_padding'],
457 'transport' => 'postMessage',
458 'capability' => 'edit_theme_options'
459 ] );
460
461 $this->customizer->add_control(
462 new MultiDimensionControl(
463 $this->customizer,
464 'betterdocs_faq_list_padding',
465 [
466 'label' => __( 'FAQ List Padding (PX)', 'betterdocs' ),
467 'section' => 'betterdocs_faq_section',
468 'settings' => 'betterdocs_faq_list_padding',
469 'priority' => 641,
470 'input_fields' => [
471 'input1' => __( 'top', 'betterdocs' ),
472 'input2' => __( 'right', 'betterdocs' ),
473 'input3' => __( 'bottom', 'betterdocs' ),
474 'input4' => __( 'left', 'betterdocs' )
475 ],
476 'defaults' => [
477 'input1' => 20,
478 'input2' => 20,
479 'input3' => 20,
480 'input4' => 20
481 ]
482 ]
483 )
484 );
485 }
486
487 public function faq_category_title_color_layout_2() {
488 $this->customizer->add_setting( 'betterdocs_faq_category_title_color_layout_2', [
489 'default' => $this->defaults['betterdocs_faq_category_title_color_layout_2'],
490 'capability' => 'edit_theme_options',
491 'transport' => 'postMessage',
492 'sanitize_callback' => [$this->sanitizer, 'rgba']
493 ] );
494
495 $this->customizer->add_control(
496 new AlphaColorControl(
497 $this->customizer,
498 'betterdocs_faq_category_title_color_layout_2',
499 [
500 'label' => __( 'Group Title Color', 'betterdocs' ),
501 'section' => 'betterdocs_faq_section',
502 'priority' => 642,
503 'settings' => 'betterdocs_faq_category_title_color_layout_2'
504 ]
505 )
506 );
507 }
508
509 public function faq_category_name_font_size_layout_2() {
510 $this->customizer->add_setting( 'betterdocs_faq_category_name_font_size_layout_2', [
511 'default' => $this->defaults['betterdocs_faq_category_name_font_size_layout_2'],
512 'capability' => 'edit_theme_options',
513 'transport' => 'postMessage',
514 'sanitize_callback' => [$this->sanitizer, 'integer']
515
516 ] );
517
518 $this->customizer->add_control( new RangeValueControl(
519 $this->customizer, 'betterdocs_faq_category_name_font_size_layout_2', [
520 'type' => 'betterdocs-range-value',
521 'section' => 'betterdocs_faq_section',
522 'settings' => 'betterdocs_faq_category_name_font_size_layout_2',
523 'label' => __( 'Group Title Font Size', 'betterdocs' ),
524 'priority' => 643,
525 'input_attrs' => [
526 'class' => '',
527 'min' => 0,
528 'max' => 50,
529 'step' => 1,
530 'suffix' => 'px' // optional suffix
531 ]
532 ] )
533 );
534 }
535
536 public function faq_category_name_padding_layout_2() {
537 $this->customizer->add_setting( 'betterdocs_faq_category_name_padding_layout_2', [
538 'default' => $this->defaults['betterdocs_faq_category_name_padding_layout_2'],
539 'transport' => 'postMessage',
540 'capability' => 'edit_theme_options'
541 ] );
542
543 $this->customizer->add_control(
544 new MultiDimensionControl(
545 $this->customizer,
546 'betterdocs_faq_category_name_padding_layout_2',
547 [
548 'label' => __( 'Group Title Padding (PX)', 'betterdocs' ),
549 'section' => 'betterdocs_faq_section',
550 'settings' => 'betterdocs_faq_category_name_padding_layout_2',
551 'priority' => 644,
552 'input_fields' => [
553 'input1' => __( 'top', 'betterdocs' ),
554 'input2' => __( 'right', 'betterdocs' ),
555 'input3' => __( 'bottom', 'betterdocs' ),
556 'input4' => __( 'left', 'betterdocs' )
557 ],
558 'defaults' => [
559 'input1' => 20,
560 'input2' => 20,
561 'input3' => 20,
562 'input4' => 20
563 ]
564 ]
565 )
566 );
567 }
568
569 public function faq_list_color_layout_2() {
570 $this->customizer->add_setting( 'betterdocs_faq_list_color_layout_2', [
571 'default' => $this->defaults['betterdocs_faq_list_color_layout_2'],
572 'capability' => 'edit_theme_options',
573 'transport' => 'postMessage',
574 'sanitize_callback' => [$this->sanitizer, 'rgba']
575 ] );
576
577 $this->customizer->add_control(
578 new AlphaColorControl(
579 $this->customizer,
580 'betterdocs_faq_list_color_layout_2',
581 [
582 'label' => __( 'FAQ List Color', 'betterdocs' ),
583 'section' => 'betterdocs_faq_section',
584 'settings' => 'betterdocs_faq_list_color_layout_2',
585 'priority' => 645
586 ]
587 )
588 );
589 }
590
591 public function faq_list_background_color_layout_2() {
592 $this->customizer->add_setting( 'betterdocs_faq_list_background_color_layout_2', [
593 'default' => $this->defaults['betterdocs_faq_list_background_color_layout_2'],
594 'capability' => 'edit_theme_options',
595 'transport' => 'postMessage',
596 'sanitize_callback' => [$this->sanitizer, 'rgba']
597 ] );
598
599 $this->customizer->add_control(
600 new AlphaColorControl(
601 $this->customizer,
602 'betterdocs_faq_list_background_color_layout_2',
603 [
604 'label' => __( 'FAQ List Background Color', 'betterdocs' ),
605 'section' => 'betterdocs_faq_section',
606 'settings' => 'betterdocs_faq_list_background_color_layout_2',
607 'priority' => 646
608 ]
609 )
610 );
611 }
612
613 public function faq_list_content_background_color_layout_2() {
614 $this->customizer->add_setting( 'betterdocs_faq_list_content_background_color_layout_2', [
615 'default' => $this->defaults['betterdocs_faq_list_content_background_color_layout_2'],
616 'capability' => 'edit_theme_options',
617 'transport' => 'postMessage',
618 'sanitize_callback' => [$this->sanitizer, 'rgba']
619 ] );
620
621 $this->customizer->add_control(
622 new AlphaColorControl(
623 $this->customizer,
624 'betterdocs_faq_list_content_background_color_layout_2',
625 [
626 'label' => __( 'FAQ List Content Background Color', 'betterdocs' ),
627 'section' => 'betterdocs_faq_section',
628 'settings' => 'betterdocs_faq_list_content_background_color_layout_2',
629 'priority' => 647
630 ]
631 )
632 );
633 }
634
635 public function faq_list_content_color_layout_2() {
636 $this->customizer->add_setting( 'betterdocs_faq_list_content_color_layout_2', [
637 'default' => $this->defaults['betterdocs_faq_list_content_color_layout_2'],
638 'capability' => 'edit_theme_options',
639 'transport' => 'postMessage',
640 'sanitize_callback' => [$this->sanitizer, 'rgba']
641 ] );
642
643 $this->customizer->add_control(
644 new AlphaColorControl(
645 $this->customizer,
646 'betterdocs_faq_list_content_color_layout_2',
647 [
648 'label' => __( 'FAQ List Content Color', 'betterdocs' ),
649 'section' => 'betterdocs_faq_section',
650 'settings' => 'betterdocs_faq_list_content_color_layout_2',
651 'priority' => 648
652 ]
653 )
654 );
655 }
656
657 public function faq_list_content_font_size_layout_2() {
658 $this->customizer->add_setting( 'betterdocs_faq_list_content_font_size_layout_2', [
659 'default' => $this->defaults['betterdocs_faq_list_content_font_size_layout_2'],
660 'capability' => 'edit_theme_options',
661 'transport' => 'postMessage',
662 'sanitize_callback' => [$this->sanitizer, 'integer']
663 ] );
664
665 $this->customizer->add_control( new RangeValueControl(
666 $this->customizer, 'betterdocs_faq_list_content_font_size_layout_2', [
667 'type' => 'betterdocs-range-value',
668 'section' => 'betterdocs_faq_section',
669 'settings' => 'betterdocs_faq_list_content_font_size_layout_2',
670 'label' => __( 'FAQ Content Font Size', 'betterdocs' ),
671 'priority' => 649,
672 'input_attrs' => [
673 'class' => '',
674 'min' => 0,
675 'max' => 50,
676 'step' => 1,
677 'suffix' => 'px' //optional suffix
678 ]
679 ]
680 ) );
681 }
682
683 public function faq_list_font_size_layout_2() {
684 $this->customizer->add_setting( 'betterdocs_faq_list_font_size_layout_2', [
685 'default' => $this->defaults['betterdocs_faq_list_font_size_layout_2'],
686 'capability' => 'edit_theme_options',
687 'transport' => 'postMessage',
688 'sanitize_callback' => [$this->sanitizer, 'integer']
689
690 ] );
691
692 $this->customizer->add_control(
693 new RangeValueControl(
694 $this->customizer,
695 'betterdocs_faq_list_font_size_layout_2',
696 [
697 'type' => 'betterdocs-range-value',
698 'section' => 'betterdocs_faq_section',
699 'settings' => 'betterdocs_faq_list_font_size_layout_2',
700 'label' => __( 'FAQ List Font Size', 'betterdocs' ),
701 'priority' => 650,
702 'input_attrs' => [
703 'class' => '',
704 'min' => 0,
705 'max' => 50,
706 'step' => 1,
707 'suffix' => 'px'
708 // optional suffix
709 ]
710 ]
711 )
712 );
713 }
714
715 public function faq_list_padding_layout_2() {
716 $this->customizer->add_setting( 'betterdocs_faq_list_padding_layout_2', [
717 'default' => $this->defaults['betterdocs_faq_list_padding_layout_2'],
718 'transport' => 'postMessage',
719 'capability' => 'edit_theme_options'
720 ] );
721
722 $this->customizer->add_control(
723 new MultiDimensionControl(
724 $this->customizer,
725 'betterdocs_faq_list_padding_layout_2',
726 [
727 'label' => __( 'FAQ List Padding (PX)', 'betterdocs' ),
728 'section' => 'betterdocs_faq_section',
729 'settings' => 'betterdocs_faq_list_padding_layout_2',
730 'priority' => 651,
731 'input_fields' => [
732 'input1' => __( 'top', 'betterdocs' ),
733 'input2' => __( 'right', 'betterdocs' ),
734 'input3' => __( 'bottom', 'betterdocs' ),
735 'input4' => __( 'left', 'betterdocs' )
736 ],
737 'defaults' => [
738 'input1' => 20,
739 'input2' => 20,
740 'input3' => 20,
741 'input4' => 20
742 ]
743 ]
744 )
745 );
746 }
747 }
748