acf_get_local_field_group()
Returns information about a field group by key.
It does not return information about fields included in the group. To get field information, use acf_get_local_fields().
No Hooks.
Returns
(array|null).
Usage
acf_get_local_field_group( $key );
- $key(string)
- A field-group key, for example
group_survey_settingsorgroup_5ca9fac07f675.
Default:''
Examples
#1 Get field-group information
Suppose a field group has been registered under the group_survey_settings key. Retrieving its information and its contents will look like this:
$group_info = acf_get_local_field_group( 'group_survey_settings' ); print_r( $group_info );
[ [key] => group_survey_settings [title] => Survey settings [local] => json [location] => [ [0] => [ [0] => [ [param] => options_page [operator] => == [value] => survey-settings ] ] ] [menu_order] => 0 [position] => normal [style] => default [label_placement] => top [instruction_placement] => label [hide_on_screen] => [active] => 1 [description] => [show_in_rest] => 0 [modified] => 1637111347 [local_file] => F:\server\www\site.edit/wp-content/themes/my-theme/includes/acf/field-groups-json/group_survey_settings.json ]
Changelog
| Since 5.7.10 | Introduced. |
acf_get_local_field_group() acf get local field group code ACF 6.8.8
function acf_get_local_field_group( $key = '' ) {
return acf_get_local_store( 'groups' )->get( $key );
}