text

The following extra arguments may be added to the option id ‘text’

NameTypeDefaultDescription
dynamicArray
The text option supports dynamic content such as post title, excerpt, post id etc.
  $options->add_option(
 'option_text',
   [
     'type'        => 'text',
     'description' => __( 'Set text description', 'zionbuilder' ),
     'title'       => __( 'Title text', 'zionbuilder' ),                
     'dynamic'     => [
         'enabled' => true,
   ],                
 ]
);
iconStringName of the icon that appears at the end of the input
clearableBooleanControls if the ‘x’ icon which clears the input text should appear.
sizeStringCan be ‘narrow’, ‘big’
errorBooleanfalseIf true, will mark the field as red
Text option with dynamic enabled and clearable true

As a basic example:

public function options( $options ) {
        $options->add_option(
            'option_text',
            [
                'type'        => 'text',
                'description' => __( 'Set text description', 'zionbuilder' ),
                'title'       => __( 'Title text', 'zionbuilder' ),
                'default'     => __( 'Default string value', 'zionbuilder' ),
                'dynamic'     => [
                    'enabled' => true,
                ],
                'size'        => 'narrow',
                'icon'        => 'search',
                'clearable'   => true,
                'error'       => false,
            ]
        );

}

Was this article helpful ?

82 people consider this article helpful
Thank you! We will improve this article.

Didn’t find what you’re looking for? Please let us know

Submit a ticket