Home › Forums › General Issues › get_field_object from user doenst work › Reply To: get_field_object from user doenst work
I’m not sure what you are trying to do and you may need to supply more details.
If you are just trying to use get_field_object(), the best way to do this is to use the field key
$field_object = get_field_object('field_01234abcd');
If you want to get the values from this user then you need to supply the correct $post_id value for the user. The $post_id value you need is created something like this
$post_id = 'user_'.$current_user_id; // <= you will need to get the current user id
then to get the values
$values = get_field('your-field-name-here', $post_id);
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.