Validate::validate_is_url( 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_url( $field ) { if ( ! empty( $field->unsafe_value() ) && false === filter_var( $field->unsafe_value(), FILTER_VALIDATE_URL ) ) { $field->add_error( 'is-url', sprintf( // Translators: placeholder contain field label. __( 'Value provided in field %s is not a valid URL.', 'anspress-question-answer' ), $field->get( 'label' ) ) ); } }
Expand full source code Collapse full source code View on GitHub: lib/class-validate.php:400
Add your comment