0

Is it possible to put a maxlength on the input fields i use in the customizer.

Like putting some extra setting in the array : maxlength = > 50;

via :

$wp_customize->add_control( 'textblock-text-content', array(
            'label'      => 'Tekstblok tekst',
            'section'   => 'textblock_background_section',
            'type'   => 'textarea',
        ));

I couldnt find any solution, i hope anybody here can guide me to a fix.

Flierp
  • 1

1 Answers1

1

Accoding to Customizer Objects docs, you could use the input_attrs parameter like this:

$wp_customize->add_control('textblock-text-content', array(
    'label' => 'Tekstblok tekst',
    'section' => 'textblock_background_section',
    'type' => 'textarea',
    'input_attrs' => array(
        'maxlength' => 20
    )
));
Riccardo
  • 1,309
  • 1
  • 25
  • 35