Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Is BuddyPress capable of this?


andradenation
Member

@andradenation

Gotta love GF.
Use the code below in your WP or BP theme functions.php file to tie a specific form to a custom post type.
Remember to set the form[“id”] to the id of the GF in the backend and then the slug of the CPT in the appropriate place below and that form will be tied to add posts to the CPT.

`
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”] = “custom-post-type”;
}
return $post_data;
}
`

Skip to toolbar