PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Custom Post Types instead of Category Dropdown

  1. Hello,

    I came across this plugin which might come handy to what I want to do.

    http://wordpress.org/extend/plugins/gravity-forms-custom-post-types/

    I have 10 different custom post types representing each of my categories.

    I need a dropdown which will display these custom post types (so essentially replacing the categories dropdown) so that the post is submitted to the correct place.

    Any ideas on how to achieve this?

    thanks
    Andy

    Posted 7 years ago on Wednesday October 31, 2012 | Permalink
  2. Here is how you can dynamically populate a drop down:
    http://www.gravityhelp.com/documentation/page/Dynamically_Populating_Drop_Down_Fields

    That example shows how to populate a drop down from posts. You can modify that to use just your custom posts or custom post types. The information you put into the drop down is up to you: the procedure for populating the drop down is the same.

    Posted 7 years ago on Wednesday October 31, 2012 | Permalink
  3. ok this is helpful but i don't think it's exactly what I need.

    Dropdown menu (what the end-user sees) needs to have fixed names such as:

    Going Out
    Well Being
    Fashion
    etc...

    corresponding to custom post types:

    os_going_out
    os_well_being
    os_fashion
    etc...

    I think the best way to do this is with a nested IF statement when the form is submitted...

    any help along these lines? Unfortunately i am not very experienced with php but i know how to edit a custom function :)

    Posted 7 years ago on Wednesday October 31, 2012 | Permalink
  4. any help with this? do i need to clarify better?

    Posted 7 years ago on Monday November 5, 2012 | Permalink
  5. Rothbert
    Member

    Any progress with this Andy?

    Posted 7 years ago on Saturday November 24, 2012 | Permalink
  6. Andy, if you know your custom post types and they are not changing, you can create your own drop down with all the custom post type titles (Going Out, etc), and use the values to set the corresponding actual custom post type names (os_going_out, etc.)

    That is how you would set it up if you know all the post types from the outset. However, I am not sure what you need to do with the actual custom post types once they are in a drop down in your form.

    Posted 7 years ago on Monday November 26, 2012 | Permalink