Support

Account

Home Forums General Issues Function documentation

Solved

Function documentation

  • Today I was doing some digging into the ACF documentation and I could not find a function that would do what I wanted, so off to Google it was to find something that would help achieve what I was looking for.

    What I found was some posts here on the forums where certain functions mentioned that would do what I was looking for – these functions were acf_get_fields() and acf_get_field_groups(). But what I am puzzled about is as to why these functions cannot be found in the ACF Documentation.

    Is there some documentation that I am missing?

  • The documentation on this site is mainly aimed at the 90% of the users that will likely never need to use many of the functions in ACF. Also, these functions are mostly meant for internal use by ACF and could change. However the some of them are pretty stable and have existed for a long time.

  • Would be good to know about them however 😉

    In my case I am writing a front end form which loads a field group and I do not want include certain fields if a certain condition is not met.

    What I ended up with is using the acf_get_fields function to get all the fields from a group into an array, then run a foreach on the fields and on certain fields run a check each field.

    So if the admin is reading these forums, it would be good if this function was in the documentation, it would have save me some time 😉

    Cheers

  • Removing fields under specific conditions is one of the uses for acf/prepare_field

  • Awesome! Thanks John,

    I was under the impression that this would only apply to the back end and not to front end forms, but a quick test shows that it works for front end forms as well.

    Cheers!

  • This is exactly what’s happening with me. I have been using acf_get_fields() which I learned about from a blog, but now I can’t find actual documentation lol

    I am using it in order to get the info of a repeater and its subfields, mainly the title of the parent group in the repeater, which I couldn’t get to by using get_field().

    Any advice would be appreciated.

    thanks!

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

You must be logged in to reply to this topic.