Generic.php
5 months ago
Number.php
5 months ago
Text.php
5 months ago
Textarea.php
5 months ago
URL.php
5 months ago
Textarea.php
51 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Override field methods |
| 4 | * |
| 5 | * @package kirki-framework/control-generic |
| 6 | * @copyright Copyright (c) 2023, Themeum |
| 7 | * @license https://opensource.org/licenses/MIT |
| 8 | * @since 1.0 |
| 9 | */ |
| 10 | |
| 11 | namespace Kirki\Field; |
| 12 | |
| 13 | /** |
| 14 | * Field overrides. |
| 15 | */ |
| 16 | class Textarea extends Generic { |
| 17 | |
| 18 | /** |
| 19 | * The field type. |
| 20 | * |
| 21 | * @access public |
| 22 | * @since 1.0 |
| 23 | * @var string |
| 24 | */ |
| 25 | public $type = 'kirki-textarea'; |
| 26 | |
| 27 | /** |
| 28 | * Filter arguments before creating the control. |
| 29 | * |
| 30 | * @access public |
| 31 | * @since 0.1 |
| 32 | * @param array $args The field arguments. |
| 33 | * @param WP_Customize_Manager $wp_customize The customizer instance. |
| 34 | * @return array |
| 35 | */ |
| 36 | public function filter_control_args( $args, $wp_customize ) { |
| 37 | if ( $args['settings'] === $this->args['settings'] ) { |
| 38 | $args = parent::filter_control_args( $args, $wp_customize ); |
| 39 | |
| 40 | // Set the control-type. |
| 41 | $args['type'] = 'kirki-generic'; |
| 42 | |
| 43 | // Choices. |
| 44 | $args['choices'] = isset( $args['choices'] ) ? $args['choices'] : []; |
| 45 | $args['choices']['element'] = 'textarea'; |
| 46 | $args['choices']['rows'] = '5'; |
| 47 | } |
| 48 | return $args; |
| 49 | } |
| 50 | } |
| 51 |