-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Description
Hello,
I came with an idea, maybe it could be great to have something like that :
->addText('start_time', [
'required' => true,
'placeholder' => '00:00:00',
'regex' => '/^(((([0-1][0-9])|(2[0-3])):?[0-5][0-9]:?[0-5][0-9]+$))/'
])And in the back it would do something like that :
add_filter(
'acf/validate_value/name=start_time',
function($valid, $value, $field, $input_name) {
if (!$valid) {
return $valid;
}
$regex = '/^(((([0-1][0-9])|(2[0-3])):?[0-5][0-9]:?[0-5][0-9]+$))/';
if (!preg_match($regex, $value)) {
$valid = 'Please enter a string as follows: hh:mm:ss.';
}
return $valid;
},
10,
4
);Don't know if that would be a good idea. Tell me.
Metadata
Metadata
Assignees
Labels
No labels