← All changes
|
includes/Admin/Customizer/Controls/MultiDimensionControl.php
+46
-43
3.5.0
→
4.9.2
View file →
| @@ -4,52 +4,55 @@ | ||
| 4 | 4 | |
| 5 | 5 | use WP_Customize_Control; |
| 6 | 6 | |
| 7 | 7 | class MultiDimensionControl extends WP_Customize_Control { |
| 8 | - /** | |
| 9 | - * Control name. | |
| 10 | - * @var string | |
| 11 | - */ | |
| 12 | - public $type = 'betterdocs-multi-dimension'; | |
| 8 | + /** | |
| 9 | + * Control name. | |
| 10 | + * @var string | |
| 11 | + */ | |
| 12 | + public $type = 'betterdocs-multi-dimension'; | |
| 13 | 13 | |
| 14 | - public $defaults; | |
| 15 | - public $input_fields; | |
| 14 | + public $defaults; | |
| 15 | + public $input_fields; | |
| 16 | 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 | - } | |
| 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 | 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 | - } | |
| 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 | 45 | |
| 46 | - betterdocs()->views->get( 'admin/customizer/controls/multidimension', [ | |
| 47 | - 'control' => $this, | |
| 48 | - 'hasLabel' => isset( $this->label ) && '' !== $this->label, | |
| 49 | - 'label' => $this->label, | |
| 50 | - 'hasDescription' => isset( $this->description ) && '' !== $this->description, | |
| 51 | - 'description' => $this->description, | |
| 52 | - 'dimension_val' => $dimension_val | |
| 53 | - ] ); | |
| 54 | - } | |
| 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 | + } | |
| 55 | 58 | } |