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);