Home › Forums › ACF PRO › Can I get a field list for a form which is "location rule" applied ? › Reply To: Can I get a field list for a form which is "location rule" applied ?
There are internal function in ACF, for example there is a function that gets the field groups based on $post_id, I forget the name of it right now and don’t want to dig, I think it’s acf_get_field_groups()
and you can pass this function an array of arguments if one of them is 'post_id' => $post_id
then it will return a list of field groups for that post.
Like I said, ACF requires a post ID to get the field groups or any fields. That post ID could be one of the types that ACF uses for posts, users, terms, etc.
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.