Home › Forums › General Issues › How to var dump › Reply To: How to var dump
Aha, I missed that this was for a profile! It’s good that you’re seeing the <pre>
tags, but to get user profile fields you have to pass in the user ID prepended with “user_”.
http://www.advancedcustomfields.com/resources/how-to/how-to-get-values-from-a-user/
So to get the field for user ID zero:
$user_id = 0;
$field = get_field('test_acf_upload', 'user_'.$user_id);
echo '<pre>'.print_r($field, true).'</pre>';
You could get the user ID with a variety of functions.
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.