Setting Types checkboxes using add_post_meta
-
Hello,
I can’t manage to set my Types checkboxes using add_post_meta on a custom form sending. I tried serialising my variable before using the function, it is successfully created in the DB but nothing checked in my post edit screen. Am I getting this wrong ?
Here is the related code :
$fiche = array( 'post_title' => $_POST['nom'], 'post_content' => "", 'post_type' => 'fiche-animal', 'post_status' => 'draft' ); $id_post = wp_insert_post($fiche); add_post_meta( $id_post, 'wpcf-urgence', $_POST['urgence'] );
“urgence” being my checkboxes array.
Thank you in advance.
Latverius
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Setting Types checkboxes using add_post_meta’ is closed to new replies.