Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Existing Repeater not updating when new fields added. #1927

Closed
tnchuntic opened this issue Jun 20, 2018 · 4 comments
Closed

Existing Repeater not updating when new fields added. #1927

tnchuntic opened this issue Jun 20, 2018 · 4 comments
Labels

Comments

@tnchuntic
Copy link

Issue description:

Existing Repeater not updating when new fields is added.

Version used:

WP Latest 4.9.6
Kirki 3.0.33

Using theme_mods or options?

theme_mods

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

Step 1: Create repeater with 2 fields
Step 2: Add and save data to fields
Step 3: Add new fields to repeater
Step 4: Update saved data
Step 5: Thats it will save only the first 2 fields value, but if you add new link it will get the 5 fields value.

Code:
Kirki::add_field(THEME_CUSTOMISER_ID, array(
'type' => 'repeater',
'label' => esc_attr__('Copyrights Links', TEXTDOMAIN),
'section' => 'copyrights_section',
'priority' => 10,
'row_label' => array(
'type' => 'field',
'value' => esc_attr__('Custom Link', TEXTDOMAIN),
'field' => 'link_text',
),
'button_label' => esc_attr__('Add Links', TEXTDOMAIN),
'settings' => 'copyright_links',
'default' => array(
array(
'link_text' => esc_attr__('Disclaimer', TEXTDOMAIN),
'link_url' => '/disclaimer',
'link_new_tab' => false,
'link_relationship' => '',
'link_class' => ''
),
array(
'link_text' => esc_attr__('Privacy Policy', TEXTDOMAIN),
'link_url' => '/privacy-policy',
'link_new_tab' => false,
'link_relationship' => '',
'link_class' => ''
),
array(
'link_text' => esc_attr__('Terms & Conditions', TEXTDOMAIN),
'link_url' => '/terms-conditions',
'link_new_tab' => false,
'link_relationship' => '',
'link_class' => ''
),
),
'fields' => array(
'link_text' => array(
'type' => 'text',
'label' => esc_attr__('Link Text', TEXTDOMAIN),
'description' => esc_attr__('This will be the label for your link', TEXTDOMAIN),
'default' => ''
),
'link_url' => array(
'type' => 'url',
'label' => esc_attr__('Link URL', TEXTDOMAIN),
'description' => esc_attr__('This will be the link URL', TEXTDOMAIN),
'default' => ''
),
'link_new_tab' => array(
'type' => 'checkbox',
'label' => esc_attr__('Open New Tab', TEXTDOMAIN),
'default' => false
),
'link_relationship' => array(
'type' => 'text',
'label' => esc_attr__('Link Relationship (XFN)', TEXTDOMAIN),
'description' => esc_attr__('This will be the link Relationship', TEXTDOMAIN),
'default' => ''
),
'link_class' => array(
'type' => 'text',
'label' => esc_attr__('CSS Classes (Optional)', TEXTDOMAIN),
'description' => esc_attr__('This will be the link Relationship', TEXTDOMAIN),
'default' => ''
)
)
));

Screenshots

screen shot 2018-06-20 at 8 58 38 pm

screen shot 2018-06-20 at 8 58 51 pm

@aristath aristath added the bug label Jun 20, 2018
@LeiShengyuan
Copy link

I have the same problem!

@clkdigital
Copy link

Has anyone found a solution for this yet?

@ArekZw
Copy link

ArekZw commented Nov 16, 2018

The same: #1540

@aristath
Copy link
Contributor

Closing as a duplicate of #1540
There is a plan to fix this, but it will take some time as it depends on other refactors and rewrites.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants