Skip to content

Control: Textarea

Ale Mostajo edited this page Feb 25, 2020 · 1 revision

Control used as a field type to display a HTML <textarea>.

Textarea

Usage

// Namespace and use statement...

class Settings extends Model
{
    // Class properties...

    protected function init()
    {
        // Other properties...

        $this->tabs = [
            'tab_id' => [
                'fields' => [

                    'textarea_field' => [
                        'type' => 'textarea',
                        'title' => __( 'Textarea' ),
                        'description' => __( 'Textarea description.' ),
                        'control' => [
                            'wide' => true,
                            'attributes' => [
                                'placeholder' => __( 'Description', 'my-domain' ),
                                'rows' => 5,
                            ]
                        ],
                    ],

                    // Other fields...
                ],
            ],
        ];
    }
}

Control options

Control Data type Description
wide bool Flag that indicates if the input should display wider or small.
attributes array HTML attributes listed as an array.

Clone this wiki locally