Support

Account

Home Forums Front-end Issues Get User Sub-Field Select Options

Helping

Get User Sub-Field Select Options

  • I am attempting to get a list of all of the options available for a particular select field. That select field is within a repeater field, and is associated with user profiles, rather than posts.

    I have tried using get_field_objects() to get the full list of fields, but, unless I specify a User ID that actually has data associated with my custom fields, the get_field_objects() function returns false.

    So, if I try get_field_objects() all by itself, I get false.

    If I try get_field_objects( 'user_1' ), I also get false, because the user with an ID of 1 hasn’t added any of the ACF field information to their profile.

    I am finding that I have to know ahead of time which user(s) has added extra information to their profile before I can even get the list of fields.

    Then, of course, I have to loop through the sub-fields until I find the one I’m looking for, and return its choices.

    Is there any easier way to just get all field/sub-field objects that are assigned to the User Profile form; or do I have to know a specific user ID in order to get them? Thanks.

  • Are you trying to get the choice of the select field?

    Or all of the choices that have been selected?

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.