• Hi! Great addition to Gravity Forms.

    We’re using custom post types AND custom taxonomies. We’ve set up a simple form to allow logged in users to submit new custom posts and select from a variety of custom taxonomy terms.

    Everything is working fine EXCEPT … when we use a MULTI SELECT box with a custom taxonomy.

    The MULTI SELECT field populates properly.

    The FORM ENTRY data saves correctly — we see multiple taxonomy terms saved with the submission data.

    Unfortunately, when we view the the new post via the custom post type edit page, only one custom taxonomy term appears to have been saved with the post data.

    Is there a way to get ALL of the custom taxonomy terms that are selected via the MULTI SELECT box to be saved with the new post?

    Bill 😀

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter billras101

    (@billras101)

    After a bit of tinkering, I think I figured out a fix. In the file gfctaddonbase.php …

    – – – – – – –
    I UPDATED THIS FUNCTION:
    – – – – – – –

    [Code moderated as per the Forum Rules. Please use the pastebin]

    – – – – – – –
    TO THIS:
    – – – – – –

    [Code moderated.]

    – – – – –

    1. In the original, the first ‘if’ was looking for $field[‘type’] = ‘checkbox’, but the app returned the ‘multiselect’ when using the multi select field type.

    2. ‘wp_set_object_terms’ did not seem to work properly when adding multiple terms, so I swapped it out for wp_set_post_terms and used the string of ids returned by $$entry[$field[‘id’]] (from the section of code after the ‘else if’) to populate the $term_ids variable.

    After testing, the revised code seems to be working as expected.

    Any concerns or advice … ?

    Bill 😀

    Plugin Author bradvin

    (@bradvin)

    Hi Bill

    thanks for posting the code. I got it even though it is moderated above. My only concern is that checkboxes are not handled correctly now. I have been working on that exact function to fix your issue and I will paste the updated code so you can give it a go

    thanks again 🙂

    cheers
    Brad

    Hi Bradvin,

    could you share the update? We are facing the same issue and can’t see the code by Bill as it is moderated..

    Thanks!

    Plugin Author bradvin

    (@bradvin)

    Hi taeke

    the original post from bill can be found here : http://pastebin.com/ykqenuar

    Plugin Author bradvin

    (@bradvin)

    Sorry I cannot release my update yet, as I am in the middle of making some major changes and the plugin is not working 🙂

    Thanks Brad!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Gravity Forms Custom Post Types] When taxonomy used with Multi Select, only one taxonomyi’ is closed to new replies.