Field GroupsPRO

Docs Fields Field Groups

#Field Render

Display an ACF Field Groups selector as radio, checkbox or select field type.

Field Group

#Field Settings

Setting nameDescription
Allow Field GroupsFilter which field groups can be chosen
AppearanceSelect the appearance of this field
Default ValueEnter each default value on a new line
Return ValueReturn the field group key, field group object or field group id
Allow NullAllow empty value
LayoutChoose the layout
ToggleAllow to toggle all values
Allow Custom
Allow custom value
Save Custom
Save custom value in the field settings
Select multiple valuesAllow multiple values selection
Stylised UIEnable Select2 UI style

#Field Value

#Return Format: Field Group Key

$field_groups = get_field('field_groups');

// group_63b84a1c13631

#Return Format: Field Group Object

$field_groups = get_field('field_groups');

/**
 * array(
 *     'ID'                    => 270,
 *     'key'                   => 'group_63b84a1c13631',
 *     'title'                 => 'My Field Group',
 *     'fields'                => array(),
 *     'location'              => array(
 *         array(
 *             array(
 *                 'param'    => 'post_type',
 *                 'operator' => '==',
 *                 'value'    => 'page',
 *             ),
 *         ),
 *     ),
 *     'menu_order'            => 0,
 *     'position'              => 'normal',
 *     'style'                 => 'default',
 *     'label_placement'       => 'left',
 *     'instruction_placement' => 'tooltip',
 *     'hide_on_screen'        => array(
 *         'the_content',
 *         'preview',
 *     ),
 *     'active'                => true,
 *     'description'           => 'Description',
 *     'show_in_rest'          => 0,
 *     'modified'              => 1673484326,
 * )
 */

#Return Format: Field Group ID

$field_groups = get_field('field_groups');

// 270

#Unformatted Value

$field_groups = get_field('field_groups', false, false);

// group_63b84a1c13631