How to Use Attributes

How to Use Attributes

You can use some attibutes for fields. Let’s see some examples for how to use attributes.

array(
  'id'            => 'unique_option_101',
  'type'          => 'text',
  'title'         => 'Text Field',
  'attributes'    => array(
    'maxlength'   => 10,
    'placeholder' => 'do stuff',
    'readyonly'   => 'only-key'
    'disabled'    => 'only-key'
  ),
),

array(
  'id'            => 'unique_option_102',
  'type'          => 'textarea',
  'title'         => 'Text Field',
  'attributes'    => array(
    'rows'        => 10,
    'cols'        => 5,
    'placeholder' => 'do stuff',
  ),
),

Last updated