Hi Courtney,
Thanks for contacting me here.
Can you tell me more about the goal you’re trying to achieve here? It would help me understand if there’s a better/different way to handle this. We don’t have any integration with WPForms right now, but if I understood the bigger picture, perhaps I can make a different suggestion.
Please let me know.
I’d like to create the form within WPForms to take advantage of the other simultaneous integrations that it has. WPForms has a way to assign it’s fields to correspond with the custom meta keys for other plugins. Just select the field in WPForms, then add in the custom meta key from the other plugin. It’ll pass the values along. I’ve done so with The Events Calendar already. They provided https://theeventscalendar.com/knowledgebase/wordpress-post-meta-data/. I’m hunting for a similar list for Business Directory Plugin.
I’ll need to ask my developer and see what he says.
I will have him check into this and I’ll report back when I know more.
Here’s what he has to say:
Not all of our fields are post metadata (some are custom taxonomies or regular post information: title, content, excerpt, categories, tags). That information won’t be available via post metadata.
And even the information that is available via post metadata, that doesn’t mean it should be handled by other plugins. We usually perform some conversions before the data is stored and also when retrieving the data. For instance, some data is stored as serialized PHP but that’s obviously not the way you enter the information (or read it) so direct access to our meta fields can be very dangerous and unexpected data can result.
Still, the answer here would be that for fields that are metadata (association “meta”) the meta key is this: _wpbdp[fields][FIELD_ID], where FIELD_ID is the ID of the field. The ID can be obtained from the URLs on the “Manage Form Fields” screen.
For instance, the value for a field with ID 5 (if it is a field with “meta” association) could be retrieved with code like this:
<?php
$value = get_post_meta( $post_id, '_wpbdp[fields][5]', true );
?>
Hope that helps! Try that and let me know if you run into more issues.