Input::set_subtype()

Description #

Check and set sub type of a field.

Changelog #

VersionDescription
4.1.8Introduced.

Source #

File: lib/form/class-input.php

	private function set_subtype() {
		$allowed_subtype = array(
			'text',
			'hidden',
			'number',
			'email',
			'password',
			'date',
			'datetime-local',
			'color',
			'url',
		);

		$subtype = 'text';

		if ( in_array( $this->args['subtype'], $allowed_subtype, true ) ) {
			$subtype = $this->args['subtype'];
		}

		$this->subtype = $subtype;
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment