Gravity Forms stores custom field data this way when handling multi-value field types because it's a standard way of storing custom field data in WordPress.
You store multiple custom field values, using the same custom field key, and then you can pull all of them in to display them in your theme template by looking through the values that are pulled together as an array using built in WordPress functions.
I understand you are unhappy with the situation, but the way Gravity Forms is doing things is not wrong or incorrect. It's just that as with anything there are a variety of ways to accomplish the same thing. Gravity Forms does it this way, ACF chose to do it another way.
What we can do is look into adding a hook to Gravity Forms that can be used to tell Gravity Forms to store the values as an array in a single custom field rather than as multiple custom fields. I'll pass this along to our lead developer to see if this is something we can have implemented.
In the mean time, what David suggested is definitely one way you can handle this. If you need to store the values in a specific format so another plugin you are using can work with it, then you can do this by using the gform_pre_submission hook to manipulate the data.
Gravity Forms itself stores data in a serialized format, so there could be some added complexity going on here that you could be encountering.
I am going to forward this to our lead developer who will take a look at what you are doing and respond to you with some suggestions.
Posted 12 years ago on Wednesday May 2, 2012 |
Permalink