I've got multiple forms that will be posting to a single Custom Post Type, and I'd like to be able to add a taxonomy term to each in order to filter them for displaying on separate pages.
Using the code by Alex Cancado from this post, I've edited it down to this, which works only when logged in:
/* Custom Post Type & Taxonomy Form Hooks */
add_filter("gform_post_data", "new_post_type", 10, 2);
function new_post_type($post_data, $form){
$post_data["post_type"] = "free-services";
if($form["id"] == '3'){
$post_data["tax_input"] = array("service-types" => "psa-and-events");
}
return $post_data;
}
Like I said, when I'm logged into WP and fill out the form, the custom taxonomy comes in perfectly. When I'm logged out I get nothing. I'm wondering how I can get it to work without being logged in too.
Thanks,