Support

Account

Home Forums General Issues Group fields not saving.

Unread

Group fields not saving.

  • 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

    Here is server info:

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.