We're successfully using Gravity forms to create a post that is converted into a page within functions.php. We're also changing the parent page based on a selection made in the form. Here's the code we're using:
add_filter("gform_post_data", "change_post_type", 10, 2);
function change_post_type($post_data, $form){
//only change post type on form id X
if($form["id"] != 1)
return $post_data;
//add other page data here
$post_data["post_type"] = "page";
$post_data["post_parent"] = $_POST["input_8"]; // Parent page is pulled from drop down on form
return $post_data;
}
What we'd like to do next is change the page template in the above function. Does anyone know if this is possible?
Many thanks.