I've added a Post Category field to my form but it doesn't seem to order them alphabetical.
How do I fix this?
From here by Carl Hancock:
Currently there is no way to change the sort order of the Category drop down.
That was 5 months ago.
I am having the same issue....the sort order of the categories in a Post Category field is alphabetical (what I want) when building the form. But when using the form, the order is not. Is there a work around for this issue yet? It is key to my form. Post Category fields do not support conditional logic, so I am using a single large sub-category field to cover a number of different parent categories; alphabetical sort is essential.
I'm willing to hack a core file or two, and then re-do the hack when ever I upgrade if need be.
The sort order should be alphabetical. If it is not on the front end, then it is a bug. We'll look into it.
Good to hear! I'm looking forward to what you find out.
I may have done something inadvertently dumb that is messing it up, but if so, I sure can't figure out what it is.
I've solved my problem using the gform_post_submission action. The code is placed in my theme's functions.php file.
Here's the code in case it might help someone else:
I used one main dropdown field (general condition) and eleven subcategory dropdowns with conditional logic.
Since a post category is an array, appending the values of all subcategories to the end of the array works. If a subcategory was not selected, the value is null; so the append only catches the single subcategory that was selected.
The filters/hooks part of Gravity Forms is very impressive....it really does allow for doing just about anything.
Thanks for a great plugin!
I am having the same problem with disordered categories. It's baffling, because the categories aren't being sorted alphabetically or by category ID.
What version of Gravity Forms are you using and do you have an example of this happening on a public form?
I am using 22.214.171.124, and I don't have an example at the moment.
@braindouche, we were not able to replicate this problem but we were able to add some extra protection to ensure the category drop down is sorted alphabetically. The fix will be included in the 1.6 release, or if you need it before the final release of 1.6, please send me an email at firstname.lastname@example.org and I will get the latest release candidate to you. Thank you.