I am trying to set up an edit function on my site for a custom post type with tags and a category.
I understood that you can pass the values in the URL, but that you cannot “preload” an Entity by ID passed by a GET parameter to map the values of the fields with the loaded Entity. This was my first BIG disappointment. Seems weird, as obviously, you will not pass a full content through a GET parameter…
So, I tried to code it. But the docs are not very clear despite there are many questions about it in various places.
I am using gform_pre_render hook, after trying gform_field_value. My questions is:
- How to set-up select and multiselect fields with a value?
- Why is there absolutely nothing about that in the docs? Setting the default values of all supported fields should be a basic feature for a form solution!
What I have tried:
- In gform_pre_render, setting defaultValue works for input text field, not for dropdowns.
- I read in some posts that isSelected should be used, but it does not seem to work anymore
So what is exactly expected to select the value of various fields in a) gform_pre_render b) gform_field_value ???
Thanks a lot.