Custom class-gf-field $value is never an array

I made a custom class-gf-field-contact with multiple inputs but the $value is always a string, never an array. Even when I duplicate “class-gf-field-address.php”, only change the class name and $type it still doesn’t return $value as an array.

Can anyone help me out? :thinking:

Can you share your code, so we can give it a try?

Yes ofcourse.

The first php file “bla” is a copy of address, which doesn’t work. The second is my own contact field. Ofcourse I also included these files in my functions.php

Hi Martijn. I see that you also opened a support ticket, and Richard replied to that. If you would like to share the resolution here, please do that once it’s all resolved. Thank you.

Hi Chris. I Indeed also opened a support ticket.
For the community:
My fields were not showing in the editor until I saved my edits, when I refreshed they were not visible anymore.
What solved this problem was putting the custom fields inside a custom plugin.

The values problem was fixed with this:

IMPORTANT: For this to work you have to remove the field from the form, than add it again. I’ve updated the gist, removed the class-gf-field-ba.php, modified the class-gf-field-contact.php. The contact class works for me, the function “get_form_editor_inline_script_on_page_render” was the missing piece

1 Like