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