themeum / kirki

Extending the customizer
https://kirki.org
MIT License
1.26k stars 328 forks source link

Repeater - new field does not work #2349

Open congthien opened 4 years ago

congthien commented 4 years ago

Issue description:

First, I added an image field in the repeater control.

After some days, I add a new field to the same repeater control. The field appears in Customizer. However, it does not save the value.

I see this problem a long time ago.

Have any solution?

Thank you!

Version used:

Kirki Customizer Framework plugin - v3.1.5

Using theme_mods or options?

theme_mods

Code to reproduce the issue (config + field(s))

Kirki::add_config( 'apccollective_theme', array(
                'capability'    => 'edit_theme_options',
                'option_type'   => 'theme_mod',
            ) );
$wp_customize->add_section( 'section_clients',
            array(
                'priority'       => 24,
                'capability'     => 'edit_theme_options',
                'theme_supports' => '',
                'title'          => esc_html__( 'Section Clients' ),
                'description'    => '',
            )
        );
Kirki::add_field( 'apccollective_theme', array(
            'type'        => 'repeater',
            'label'       => esc_attr__( 'Item' ),
            'section'     => 'section_clients',
            'priority'    => 12,
            'settings'    => 'client_items',
            'default'     => array( ),
            'row_label' => array(
                'type'  => 'field',
                'value' => esc_attr__('Item' ),
                //'field' => 'name',
            ),
            'fields' => array(
                                 // old file
                'client_logo' => array(
                    'type'        => 'image',
                    'label'       => esc_attr__( 'Image' ),
                    'default'     => '',
                ),
                // new field
                'client_url' => array(
                    'type'        => 'link',
                    'label'       => esc_attr__( 'Link'),
                    'default'     => '#',
                ),

            )
        ) );
nervewax commented 3 years ago

I'm also getting this same bug.

Likely a duplicate of https://github.com/kirki-framework/kirki/issues/1540