Support

Account

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