Home › Forums › ACF PRO › Custom validation message does not show › Reply To: Custom validation message does not show
It could be that the key is incorrect.
Is this field that you are trying to validate a sub field of a repeater, flex or groups field?
Is this field a cloned field?
Try this
function custom_validate ($valid, $value, $field, $input_name) {
if (strpos($field['key'], 'field_64ad703e1fab1') !== false) {
return $field['key'];
}
return $valid;
}
add_filter ('acf/validate_value', 'custom_validate', 10, 4);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.