Support

Account

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 ?

  • No, there is nothing built into ACF that will do this. Getting every field value for every field sorted by where they are located would be a time consuming task that under most conditions would time out.

    Let’s say we wanted to get all the values for all the posts and ignore for a minute users, terms and options. Here is the sequence of things you’d need to do.

    1. get all the post types registered on the site
    2. Loop through the post types and do a WP_Query to get all posts in each post type
    3. Loop through all the posts in each post type and get all the fields for each post

    And the above will not tell you the fields that are no longer used. It will only give you a list of the fields that are active in a field group.

    ACF does not know where fields are located unless it has a “$post_id” value to work with. This value is either assumed to be the current post ID that is being viewed or you must supply it when calling a function.