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!
📣 “ACF Chat Fridays”— Advanced Custom Fields (@wp_acf) January 31, 2023
The ACF team holds their first open office hours this Friday! Come and talk ACF, and ask questions about building sites with the plugin.
We’d love to see you there!
📆 Friday 3rd Feb - 3pm UTC
👉 Register here - https://t.co/3UtvQbE4CU pic.twitter.com/oTwW9K1XQ0
© 2023 Advanced Custom Fields.