Home Forums ACF PRO Exlude fields in acf_form() function Reply To: Exlude fields in acf_form() function

  • Yes, this can work.

    In this plugin I added my own field setting. Before ACF 5.5 it uses an ACF filter to remove fields from the display. After ACF 5.5 it uses the acf/prepare_field filter to remove fields.

    There are also some internal functions in ACF that can be used to get field groups for a specific post as well as the fields in those groups. For example

    $groups = acf_get_field_groups(array('post_id' => $post_id);

    that will give you groups on a page

    $fields = acf_get_fields($group['key']);

    I think will give you an array of fields in a groups…. but you’ll need to look in the ACF code to make sure how to use these.

    However, this can’t be used to remove fields from a group. In order to not show fields by removing them from a group the fields need to be removed when the field group is loaded/created