Validate::validate_is_numeric( object $field )
Description #
Validate is_url
field.
Parameters #
- $fieldobject (Required) Instance of @see
AP_Field
object.
Source #
File: lib/class-validate.php
public static function validate_is_numeric( $field ) { if ( ! empty( $field->unsafe_value() ) && ! is_numeric( $field->unsafe_value() ) ) { $field->add_error( 'is-numeric', sprintf( // Translators: placeholder contain field label. __( 'Value provided in field %s is not numeric.', 'anspress-question-answer' ), $field->get( 'label' ) ) ); } }
Expand full source code Collapse full source code View on GitHub: lib/class-validate.php:419
Add your comment