AnsPress_Validation::validate( string $field, array $actions )
Description #
Validate a field based on actions passed
Parameters #
- $fieldstring (Required)
- $actionsarray (Required)
Source #
File: includes/class/validation.php
private function validate($field, $actions) { foreach ( $actions as $type => $param ) { if ( isset( $this->errors[$field] ) ) { return; } switch ( $type ) { case 'required': $this->required( $field ); break; case 'length_check': $this->length_check( $field, $param ); break; case 'comma_separted_count': $this->comma_separted_count( $field, $param ); break; case 'is_email': $this->is_email( $field ); break; default: $this->errors[$field] = apply_filters( 'ap_validation_validate_field', $field, $actions ); break; } } }
Expand full source code Collapse full source code View on GitHub: includes/class/validation.php:345
Add your comment