Kirki: Repeater row label shows only the first choice when the type is set to field and the field is a radio-image or radio

Created on 20 Apr 2017  路  7Comments  路  Source: kirki-framework/kirki

Issue description:

Repeater row label shows only the first choice when the type is set to field and the field is a radio-image or radio

Version used:

Develop and Stable versions (testeds)

Using theme_mods or options?

Theme_mods

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

// Config
Kirki::add_config( 'odin_kirki', array(
    'capability'    => 'edit_theme_options',
    'option_type'   => 'theme_mod',
) );

// Panel
Kirki::add_panel( 'footer_panel', array(
    'priority'    => 60,
    'title'       => __( 'Footer', 'odin' ),
    'description' => __( 'Footer customization settings', 'odin' ),
  )
);

// Section
Kirki::add_section( 'odin_social_links', array(
    'title'          => __( 'Social Links', 'odin' ),
    'description'    => __( 'Social Profiles and Page from your Brand', 'odin' ),
    'panel'          => 'footer_panel', 
    'priority'       => 50,
    'capability'     => 'edit_theme_options',
) );

// Fields
// Social links
Kirki::add_field( 'odin_kirki', array(
  'type'     => 'repeater',
    'label'    => __( 'Social Profiles', 'odin' ),
    'section'  => 'odin_social_links',
  'row_label' => array(
        'type' => 'field',
        'value' => esc_attr__('Profile', 'odin' ),
    'field' => 'social_type',
    ),
  'settings' => 'social_links',
  'fields' => array(
    'social_type' => array(
            'type'        => 'radio-image',
            'label'       => __( 'What social network?', 'odin' ),
      'choices'     => array(
        'twitter' => get_template_directory_uri() . '/src/icons/png/twitter.png',
        'facebook'   => get_template_directory_uri() . '/src/icons/png/facebook.png',
        'google-plus' => get_template_directory_uri() . '/src/icons/png/google-plus.png',
        'instagram'   => get_template_directory_uri() . '/src/icons/png/instagram.png',
        'linkedin' => get_template_directory_uri() . '/src/icons/png/linkedin.png',
        'whatsapp'  => get_template_directory_uri() . '/src/icons/png/whatsapp.png',
        'pinterest' => get_template_directory_uri() . '/src/icons/png/pinterest.png',
        'snapchat'  => get_template_directory_uri() . '/src/icons/png/snapchat.png',
        'youtube'   => get_template_directory_uri() . '/src/icons/png/youtube.png',
        'vimeo'   => get_template_directory_uri() . '/src/icons/png/vimeo.png',
        ),
        ),
        'link_url' => array(
            'type'        => 'text',
            'label'       => __( 'Profile URL or Slug', 'odin' ),
        ),
    ),
) );

2017-04-20_000131

All 7 comments

Fixed in develop branch 馃憤

Nice Work @aristath !
I tried to find the code snippet to fix this and send a PR, but I could not.

@aristath .. the problem persists in develop version :[

Work only in first row with 'dafault' => '', but when default is defined, the row label assume the value and fixed his, not changing when other radio is selected.

reopened the issue, I'll take another look tomorrow.
Thanks for the thorough testing!

I believe it's ok now. 馃憤

Oh yes! Fixed!

Was this page helpful?
0 / 5 - 0 ratings