-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Labels
Description
Hi,
I followed this gist.
I created a parent section and it has 3 sub sections.
$this->addSettingSections(
'my_parent_slug',
array(
'section_id' => 'section_id_parent',
'tab_slug' => 'my_tab_slug',
'title' => 'Repeat this section',
'repeatable' => true,
'collapsible' => array(
'toggle_all_button' => array( 'top-left', 'bottom-left' ),
),
'content' => array(
array(
'section_id' => 'section_id_1',
'title' => __( 'Section 1', 'admin-page-framework-loader' ),
),
array(
'section_id' => 'section_id_2',
'title' => __( 'Section 2', 'admin-page-framework-loader' ),
),
array(
'section_id' => 'section_id_3',
'title' => __( 'Section 3', 'admin-page-framework-loader' ),
),
)
),
array(
'section_id' => 'dont_repeat_this',
'tab_slug' => 'my_tab_slug',
)
);
Here is the field section
$this->apf->addSettingFields(
array('section_id_parent', 'section_id_1'),
array(
'field_id' => 'section_id_1_field_1',
'type' => 'text',
'title' => 'Section 1 Field 1',
),
array(
'field_id' => 'section_id_1_field_2',
'type' => 'text',
'title' => 'Section 1 Field 2',
),
array(
'field_id' => 'section_id_1_field_3',
'title' => __( 'Section 1 Field 3', 'admin-page-framework-loader' ),
'type' => 'select',
'default' => 'none',
'label' => array(
0 => __( 'Plain', 'admin-page-framework-loader' ),
1 => __( 'Red', 'admin-page-framework-loader' ),
2 => __( 'Green', 'admin-page-framework-loader' ),
3 => __( 'Blue', 'admin-page-framework-loader' ),
4 => __( 'Yellow', 'admin-page-framework-loader' ),
5 => __( 'Orange', 'admin-page-framework-loader' ),
),
'repeatable' => true
)
);
Similarly repeated for section 2 and 3
When I use repeatable in section_id_parent the repeat icon appears for each sub section along with the parent section.
How to make the parent section Repeat this section repeatable and not individual sections?
Attaching a screenshot.