hello, if you can help me.
I tested all the initial part of the registration, field validations in front end, however ..
for the item Product ID,
cannot be duplicated.
I need to validate the same before saving to the db.
Can you help me?
code below …
–/–
function salvar_formulario($post_id){
if($post_id != ‘cadastro_item’){
return $post_id;
}
$identificaitem = $_POST[‘acf’][‘field_58779b4’];
$item = $_POST[‘acf’][‘field_5fa30fd2’];
$quantidade = $_POST[‘acf’][‘field_5fac22’];
$seunome = $_POST[‘acf’][‘field_5f4ed30’];
$post = array(
‘post_status’ => ‘publish’,
‘post_title’ => $item,
‘post_type’ => ‘cadastro_item’
);
$id = wp_insert_post($post);