Home › Forums › Front-end Issues › Pre-Populate GF form with ACF Field Data › Reply To: Pre-Populate GF form with ACF Field Data
As long as GF is still working the way it worked in that post. I’m not very familiar with GF, I can help you get things out of ACF but putting them somewhere else…
When getting the value for a user you need to give ACF the $post_id argument.
add_filter('gform_field_value_dept_name', 'my_user_info');
function my_user_info($value){
$id = get_current_user_id();
$post_id = 'user_'.$id;
return get_field('dept_name', $post_id);
}
see getting values from other places on this page http://www.advancedcustomfields.com/resources/get_field/
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.