AnsPress_Validation::length_check( string $field, string $param )
Description #
Check length of a string, if less then specified then return error
Parameters #
- $fieldstring (Required)
- $paramstring (Required)
Source #
File: includes/class/validation.php
private function length_check( $field, $param ) { // Dont check if Administrator. if ( current_user_can( 'manage_options' ) ) { return; } if ( $param != 0 && ( ! isset( $this->fields[$field] ) || mb_strlen( strip_tags( $this->fields[$field] ) ) <= $param ) ) { $this->errors[$field] = sprintf( __( 'Field value should be at least %d characters', 'anspress-question-answer' ), $param ); } }
Expand full source code Collapse full source code View on GitHub: includes/class/validation.php:96
Add your comment