Hello,
I have a category dropdown on my form: State > Base. The user selects their base using this dropdown. In a separate text field, they write the name of their neighborhood. When the form is submitted, I want to take the neighborhood text and turn it into a category. So the post created by the form will be saved under: State > Base > Neighborhoods > Neighborhood Name. If the neighborhood already exists then the post will be saved in that category.
I think I need to use gform_post_data to accomplish this but it's not working. This is what I have so far:
add_filter('gform_post_data_6', 'update_cat');
function update_cat($post_data){
$post_data['post_category'] .= 'neighborhood';
return $post_data;
}
Any tips?