Home › Forums › General Issues › custom post type ui with acf field with unique value › Reply To: custom post type ui with acf field with unique value
i used post object field but even this simple code that i put in function.php is not working
and posts are published
add_filter('acf/validate_value/name=persona', 'require_unique', 10, 4);
function require_unique($valid, $value, $field, $input) {
if (!$valid) {
return $valid;
}
$valid = 'This Value is not Unique';
return $valid;
}
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.