AdvancedCustomFields / AdvancedCustomFields/acf
Group fields not saving in Gutenberg
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
Other fields are working good but, group’s sub fields doesn’t save on post update.
function my_theme_share_button_block_fields() {
acf_add_local_field_group(
array(
'key' => 'group_share_button',
'title' => esc_html__( 'Share Button', 'text-domain' ),
'fields' => array(
array(
'key' => 'field_share_title',
'label' => esc_html__( 'Title', 'text-domain' ),
'name' => 'title',
'type' => 'text',
),
array(
'key' => 'field_share_title_tag',
'label' => esc_html__( 'Title Tag', 'text-domain' ),
'name' => 'title_tag',
'type' => 'select',
'choices' => array(
'h1' => 'h1',
'h2' => 'h2',
'h3' => 'h3',
'h4' => 'h4',
'h5' => 'h5',
'h6' => 'h6',
'p' => 'p',
'span' => 'span',
),
'default_value' => 'h2',
),
array(
'key' => 'field_share_button',
'label' => esc_html__( 'Button', 'text-domain' ),
'name' => 'button',
'type' => 'group',
'layout' => 'row',
'sub_fields' => array(
array(
'key' => 'field_share_button_text',
'label' => esc_html__( 'Text', 'text-domain' ),
'name' => 'button_text',
'type' => 'text',
),
array(
'key' => 'field_share_button_url',
'label' => esc_html__( 'Url', 'text-domain' ),
'name' => 'button_url',
'type' => 'url',
),
array(
'key' => 'field_share_button_title_attr',
'label' => esc_html__( 'Title', 'text-domain' ),
'name' => 'button_title',
'type' => 'text',
'instructions' => esc_html__( 'The title attribute.', 'text-domain' ),
),
array(
'key' => 'field_share_button_new_tab',
'label' => esc_html__( 'New Tab', 'text-domain' ),
'name' => 'button_new_tab',
'type' => 'true_false',
'ui' => true,
),
),
),
),
'location' => array(
array(
array(
'param' => 'block',
'operator' => '==',
'value' => 'acf/my-theme-share-button',
),
),
),
'active' => true,
)
);
}
add_action( 'acf/init', 'my_theme_share_button_block_fields' );
WordPress: 5.6
ACF Pro: 5.9.3
Server info:

Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Gutenberg block field registration shown in the report with WordPress 5.6 and ACF Pro 5.9.3, focusing on the acf/init registration and the group field's sub_fields. Done means the group subfields retain their values after the post is updated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100