PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.2.0
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.2.0
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 3.5.2 All 199 releases
betterdocs / includes / Admin / Customizer / Controls / MultiDimensionControl.php

MultiDimensionControl.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.2.0, at includes/Admin/Customizer/Controls/MultiDimensionControl.php

59 lines 1.2 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\Controls;
4
5 use WP_Customize_Control;
6
7 class MultiDimensionControl extends WP_Customize_Control {
8 /**
9 * Control name.
10 * @var string
11 */
12 public $type = 'betterdocs-multi-dimension';
13
14 public $defaults;
15 public $input_fields;
16
17 /**
18 * Enqueue scripts/styles.
19 *
20 * @since 1.0.0
21 */
22 public function enqueue() {
23 betterdocs()->assets->enqueue(
24 'betterdocs-customizer-dimension-control',
25 'customizer/js/customizer-dimension-control.js',
26 [ 'jquery' ]
27 );
28 }
29
30 /**
31 * Render the control's content.
32 *
33 * @version 1.0.0
34 */
35 public function render_content() {
36 if ( $this->value() ) {
37 if ( is_array( $this->value() ) ) {
38 $dimension_val = $this->value();
39 } else {
40 $dimension_val = (array) json_decode( $this->value() );
41 }
42 } else {
43 $dimension_val = $this->defaults;
44 }
45
46 betterdocs()->views->get(
47 'admin/customizer/controls/multidimension',
48 [
49 'control' => $this,
50 'hasLabel' => isset( $this->label ) && '' !== $this->label,
51 'label' => $this->label,
52 'hasDescription' => isset( $this->description ) && '' !== $this->description,
53 'description' => $this->description,
54 'dimension_val' => $dimension_val
55 ]
56 );
57 }
58 }
59