Validate::validate_required( object $field )
Description #
Validate required
field.
Parameters #
- $fieldobject (Required) Instance of @see
AP_Field
object.
Source #
File: lib/class-validate.php
public static function validate_required( $field ) { if ( '' === $field->value() || is_null( $field->value() ) ) { $field->add_error( 'required', sprintf( // Translators: placeholder contain field label. __( '%s field is required.', 'anspress-question-answer' ), $field->get( 'label' ) ) ); } }
Expand full source code Collapse full source code View on GitHub: lib/class-validate.php:343
Add your comment