Hi there,
I have form 1, which I would like to show up as a draft post under custom post type "pv_listing" and form 2, which I would like to show up as a draft post under custom post type "pv_events"
This thread http://forum.gravityhelp.com/topic/add-a-form-to-create-a-new-custom-post-type#post-3425 worked fine for me when I only had 1 form for 1 custom post type.
So I tried to improvise, first by copying, amending, and pasting the whole snippet of code for form 2. When that didn't work, I tried modifying as below. I have zero coding skills, so both tries just made my screen go blank.
add_filter( "gform_post_data", "update_post_type", 10, 2 );
function update_post_type( $post_data, $form ) {
if( $form["id"] == '1' ) {
$post_data["post_type"] = "pv_listing";
elseif( $form["id"] == '2' ) {
$post_data["post_type"] = "pv_event";
}
return $post_data;
Can you let me know the correct way to do this?
Thanks!