Support » Plugins » [Plugin: Gravity Forms Custom Post Types] Automatically Choose Category

  • First of all, still love this plugin. It’s awesome and great work.

    I am trying to map a form to a custom post type and tag it with a particular category automatically. For example, I want the post to automatically have category X while the user doesn’t even see an option to choose the category. Is this possible with the plugin?

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • jaznz

    (@jaznz)

    I need to achieve exactly the same thing.

    I have options for user to select regional location in my Gravity form, which maps beautifully to these subcategories, but I need the parent category to be checked by default and therefore mapped to by default without the user seeing this.

    Any ideas?

    Thanks

    Jonathan

    (@jg-visual)

    I’m not exactly sure how you have everything setup, but you most likely want to use the gform_pre_submission hook to adjust the form. Since I did this a while ago, I’ve forgotten a lot of how it is done, but the code I have within the hooked function is:


    //Set the category to be education
    //Education is category ID 9
    $_POST['input_9_1'] = 9;

    This is where education was the category I wanted chosen by default.

    I hope that’s at least slightly helpful for you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Gravity Forms Custom Post Types] Automatically Choose Category’ is closed to new replies.