Warning: This method has been deprecated. Use Automator()->helpers->recipe->field->text( array $args ) instead.

Automator_Helpers_Recipe_Field::text_field( string $option_code = 'TEXT', string $label = null, bool $tokens = true, string $type = 'text', string $default = null,  $required = true, string $description = '', string $placeholder = null )


Parameters Parameters

$option_code

(string) (Optional)

Default value: 'TEXT'

$label

(string) (Optional)

Default value: null

$tokens

(bool) (Optional)

Default value: true

$type

(string) (Optional)

Default value: 'text'

$default

(string) (Optional)

Default value: null

(bool) (Required)

$description

(string) (Optional)

Default value: ''

$placeholder

(string) (Optional)

Default value: null


Top ↑

Return Return

(mixed)


Source Source

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

	public function text_field( $option_code = 'TEXT', $label = null, $tokens = true, $type = 'text', $default = null, $required = true, $description = '', $placeholder = null ) {
		if ( defined( 'AUTOMATOR_DEBUG_MODE' ) && true === AUTOMATOR_DEBUG_MODE ) {
			_doing_it_wrong( 'Automator()->helpers->recipe->field->text_field()', 'Use Automator()->helpers->recipe->field->text( array $args ) instead.', '3.0' );
		}
		$option = array(
			'option_code'     => $option_code,
			'label'           => $label,
			'description'     => $description,
			'placeholder'     => $placeholder,
			'input_type'      => $type,
			'supports_tokens' => $tokens,
			'required'        => $required,
			'default'         => $default,
		);

		if ( 'textarea' === $type ) {
			$option['supports_tinymce'] = true;
		}
		$option = $this->text( $option );
		$option = apply_filters_deprecated( 'uap_option_text_field', array( $option ), '3.0', 'automator_option_text_field' );

		return apply_filters( 'automator_option_text_field', $option );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0 Introduced.