AnsPress_Validation::required( string $field )

Description #

Check if field is empty or not set

Parameters #

  • $field
    string (Required)

Changelog #

VersionDescription
2.0.1Introduced.

Source #

File: includes/class/validation.php

	public function required($field) {
		if ( ! isset( $this->fields[$field] ) || '' == $this->fields[ $field ] ) {
			$this->errors[ $field ] = __( 'This field is required', 'anspress-question-answer' );
		}
	}

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