Custom Meta FREE

Docs Field Groups Custom Meta

#Custom Meta

ACF Extended allows developers to add custom metas values in the Field Group settings directly from the Field Group administration.

Settings

Render this title on edit post screen

Field groups with a lower order will appear first

Shown in field group list

Select items to hide them from the edit screen.

Select user roles that are allowed to view and edit this field group in post edition

Add custom meta data to the field group.

1
2
1

View raw field group data.

Array
(
    [ID] => 37
    [key] => group_5f20935b9a777
    [title] => Field Group
    [fields] => Array()
    [location] => Array
         (
             [0] => Array
                 (
                     [0] => Array
                         (
                             [param] => post_type
                             [operator] => ==
                             [value] => post
                         )
                 )
         )
    [menu_order] => 0
    [position] => normal
    [style] => default
    [label_placement] => left
    [instruction_placement] => acfe_instructions_tooltip
    [hide_on_screen] => Array()
    [active] => 1
    [description] =>
    [acfe_display_title] =>
    [acfe_autosync] =>
    [acfe_permissions] =>
    [acfe_meta] => Array()
    [acfe_note] =>
    [_valid] => 1
)
WP_Post Object
(
    [ID] => 37
    [post_author] => 1
    [post_date] => 2020-07-28 23:06:48
    [post_date_gmt] => 2020-07-28 21:06:48
    [post_content] => a:13:{s:8:"location";a:1:{i:0;a:1:{i:0;a:3:{s:5:"param";s:9:"post_type";s:8:"operator";s:2:"==";s:5:"value";s:4:"post";}}}s:8:"position";s:6:"normal";s:5:"style";s:7:"default";s:15:"label_placement";s:4:"left";s:21:"instruction_placement";s:25:"acfe_instructions_tooltip";s:14:"hide_on_screen";a:1:{i:0;s:11:"the_content";}s:11:"description";s:0:"";s:18:"acfe_display_title";s:0:"";s:13:"acfe_autosync";s:0:"";s:16:"acfe_permissions";s:0:"";s:9:"acfe_form";i:0;s:9:"acfe_meta";a:2:{s:13:"5f3a7307cc3ba";a:2:{s:13:"acfe_meta_key";s:3:"foo";s:15:"acfe_meta_value";s:3:"bar";}s:13:"5f3a730dcc3bb";a:2:{s:13:"acfe_meta_key";s:3:"key";s:15:"acfe_meta_value";s:5:"value";}}s:9:"acfe_note";s:0:"";}
    [post_title] => Field Group
    [post_excerpt] => field-group
    [post_status] => publish
    [comment_status] => closed
    [ping_status] => closed
    [post_password] =>
    [post_name] => group_5f20935b9a777
    [to_ping] =>
    [pinged] =>
    [post_modified] => 2020-08-17 14:07:55
    [post_modified_gmt] => 2020-08-17 12:07:55
    [post_content_filtered] =>
    [post_parent] => 0
    [guid] => /?post_type=acf-field-group&p=37
    [menu_order] => 0
    [post_type] => acf-field-group
    [post_mime_type] =>
    [comment_count] => 0
    [filter] => raw
)

Add personal note. Only visible to administrators

#Using Settings

You can add custom meta in your field group declaration from the acfe.meta key. Usage example:

acf_add_local_field_group(array(
    'key'    => 'group_my_field_group',
    'title'  => 'My Field Group',
    'active' => true,

    'acfe'   => array(
        'meta' => array(
            array(
                'key'   => 'my key',
                'value' => 'my value',
            ),
            array(
                'key'   => 'my second key',
                'value' => 'my second value',
            ),
        ),
    ),

));

You can retrieve settings using acf_get_field_group() and the acfe_get() helper. Usage example:

$field_group = acf_get_field_group('group_my_field_group');
/**
 * $field_group = array(
 *     'key'    => 'group_my_field_group',
 *     'title'  => 'My Field Group',
 *     'active' => true,
 *     'acfe'   => array(
 *         'meta' => array(
 *             array(
 *                 'key'   => 'my key',
 *                 'value' => 'my value',
 *             ),
 *             array(
 *                 'key'   => 'my second key',
 *                 'value' => 'my second value',
 *             ),
 *         ),
 *     ),
 * )
 */


$meta = acfe_get($field_group, 'acfe.meta');
/*
 * $meta = array(
 *     array(
 *         'key'   => 'my key',
 *         'value' => 'my value',
 *     ),
 *     array(
 *         'key'   => 'my second key',
 *         'value' => 'my second value',
 *     ),
 * ),
 */