Support

Account

Home Forums ACF PRO Empty Array on 'acf/get_field_groups' Reply To: Empty Array on 'acf/get_field_groups'

  • Hi drs-nyc and elliot upon facing this problem I did come up some solution. Some one in the forum did suggest to use post.

    Here’s the code:

    function is_field_group_exists($value, $type='post_title') {
            $exists = false;
            if ($field_groups = get_posts(array('post_type'=>'acf-field-group'))) {
                foreach ($field_groups as $field_group) {
                    if ($field_group->$type == $value) {
                        $exists = true;
                    }
                }
            }
            return $exists;
        }