Kirki: Can I use a background-field within repeater fields?

I would like to know if it is possible to use the background field within a group of repetitive fields, I tried with the code below, but it didn’t work:

Kirki::add_field(’emporium_kirki_config’, [
‘type’ => ‘repeater’,
‘label’ => esc_html__(‘Banners’, ’emporium’),
‘section’ => ‘section_banner_oddeven’,
‘priority’ => 10,
‘row_label’ => [
‘type’ => ‘field’,
‘value’ => esc_html__(‘Banner’, ’emporium’),
‘field’ => ‘link_text’,
],
‘button_label’ => esc_html__(‘Add new’, ’emporium’),
‘settings’ => ‘setting_banner_oddeven’,
‘default’ => [
[
‘banner_image’ => [
‘background-color’ => ‘rgba(20,20,20,.8)’,
‘background-image’ => ”,
‘background-repeat’ => ‘repeat’,
‘background-position’ => ‘center center’,
‘background-size’ => ‘cover’,
‘background-attachment’ => ‘scroll’,
],
‘banner_title’ => esc_html__(‘Lorem ipsum’, ‘kirki’),
‘banner_text’ => esc_html__(‘Lorem ipsum sit amet dolor’, ‘kirki’),
‘banner_url’ => ”,
]
],
‘fields’ => [
‘banner_image’ => [
‘type’ => ‘background’,
‘label’ => esc_html__(‘Background Control’, ‘kirki’),
‘description’ => esc_html__(‘Background conrols are pretty complex – but extremely useful if properly used.’, ‘kirki’),
‘transport’ => ‘auto’,
],
‘banner_title’ => [
‘type’ => ‘text’,
‘label’ => esc_html__(‘Title’, ’emporium’),
‘description’ => esc_html__(‘Title of the banner’, ’emporium’),
‘default’ => ”,
],
‘banner_text’ => [
‘type’ => ‘textarea’,
‘label’ => esc_html__(‘Text’, ’emporium’),
‘description’ => esc_html__(‘Text of the banner’, ’emporium’),
‘default’ => ”,
],
‘banner_url’ => [
‘type’ => ‘link’,
‘label’ => esc_html__(‘Link’, ’emporium’),
‘description’ => esc_html__(‘Link for the button’, ’emporium’),
],
]
]);

Read more here:: Kirki: Can I use a background-field within repeater fields?

Leave a Reply

Your email address will not be published. Required fields are marked *