Home › Forums › ACF PRO › How can I check that the acf field value is not a duplicate when adding a post? › Reply To: How can I check that the acf field value is not a duplicate when adding a post?
I made a temporary solution until the developers tell me what to do next. The field is now being validated in the Draft. If the value is already in the database, then after saving to the draft, the field is erased.
// validate for published post (allow draft to save without validation)
if ( $post->post_status == 'draft' ) {
// bail early if validation fails
if ( ! acf_validate_save_post() ) {
return;
}
}
Edit file and the code above on 321 lines
/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-post.php
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.