Prepopulate fields
-
I would like to define “placeholders” in the default_value field which dynamically populate field values.
So for example a field “company name” should be filled in with the user meta “company_name”. For this I could think about using the default_value for this field like “%%usermeta:company_name%%”.
A custom functions then hooks into “acf/render_field” and replaces the “$field[‘value’]” with “get_user_meta(get_current_user_id(), ‘company_name’, true)” and clears the default_value.
But, this is not working. The input value just stays empty.
I’ve increased the priority of the action to max but still empty. It seems this hook doesn’t apply with acf_get_fields() your are using.hmmm, what am I missing here?
- The topic ‘Prepopulate fields’ is closed to new replies.