themeum / kirki

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

Double radio options issue #1706

Closed AlxMedia closed 6 years ago

AlxMedia commented 6 years ago

Issue description:

When adding two radio selections in the same section, only one of them can be selected. It jumps over to each section so you can't have two options saved. https://i.imgur.com/eK5nhTn.png

The code I use is:

// Blog: Single - Related Posts
Kirki::add_field( 'theme_config_id', array(
    'type'          => 'radio',
    'settings'      => 'related-posts',
    'label'         => esc_attr__( 'Single - Related Posts', 'kirkitheme' ),
    'description'   => esc_attr__( 'Shows randomized related articles below the post', 'kirkitheme' ),
    'section'       => 'blog',
    'default'       => 'categories',
    'choices'       => array(
        '1'         => esc_attr__( 'Disable', 'kirkitheme' ),
        'categories'=> esc_attr__( 'Related by categories', 'kirkitheme' ),
        'tags'      => esc_attr__( 'Related by tags', 'kirkitheme' ),
    ),
) );
// Blog: Single - Post Navigation
Kirki::add_field( 'theme_config_id', array(
    'type'          => 'radio',
    'settings'      => 'post-nav',
    'label'         => esc_attr__( 'Single - Post Navigation', 'kirkitheme' ),
    'description'   => esc_attr__( 'Shows links to the next and previous article', 'kirkitheme' ),
    'section'       => 'blog',
    'default'       => 's1',
    'choices'       => array(
        '1'         => esc_attr__( 'Disable', 'kirkitheme' ),
        's1'        => esc_attr__( 'Sidebar Primary', 'kirkitheme' ),
        'content'   => esc_attr__( 'Below content', 'kirkitheme' ),
    ),
) );

Only one section can be selected. When I change to radio-buttonset everything works fine.

An issue or something I've missed?

Should be the last issue I've bumped into.

aristath commented 6 years ago

Did you try the v3.0.20 version? This was a bug in 3.0.19, I fixed it after a few hours and 3.0.20 was released

AlxMedia commented 6 years ago

I didn't realize you already updated it. Works perfectly well now. Great stuff.