Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825

Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830

Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825
Automator_Helpers_Recipe_Field::text( $args = array() )


Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830

Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825

Parameters Parameters

$args

(Optional)

Default value: array()


Top ↑

Return Return

(mixed|void)


Source Source

File: src/core/lib/helpers/class-automator-recipe-helpers-field.php

	public function text( array $args = array() ) {
		$defaults    = array(
			'option_code' => 'TEXT',
			'input_type'  => 'text',
			'label'       => esc_attr__( 'Text', 'uncanny-automator' ),
			'placeholder' => '',
			'description' => '',
			'required'    => true,
			'tokens'      => true,
			'default'     => null,
		);
		$args        = wp_parse_args( $args, $defaults );
		$option_code = $args['option_code'];
		$label       = $args['label'];
		$description = $args['description'];
		$placeholder = $args['placeholder'];
		$tokens      = $args['tokens'];
		$type        = $args['input_type'];
		$default     = $args['default'];
		$required    = $args['required'];
		$option = array(
			'option_code'     => $option_code,
			'label'           => $label,
			'description'     => $description,
			'placeholder'     => $placeholder,
			'input_type'      => $type,
			'supports_tokens' => $tokens,
			'required'        => $required,
			'default_value'   => $default,
		);
		if ( 'textarea' === $type ) {
			$option['supports_tinymce'] = true;
		}
		return apply_filters( 'automator_option_text_field', $option );
	}