config = wp_parse_args( $config, $this->config ); $this->controller = $controller; $this->sections = $sections; } /** * Generates child repeater fields * * @return void */ public function generate_fields() { foreach ( $this->sections as $section_id => $section ) { $this->controller->add_control( $section_id, array( 'label' => $section['label'], 'type' => Controls_Manager::HEADING, 'separator' => 'before', ) ); foreach ( $section['fields'] as $field_id => $field ) { $this->controller->add_control( $field_id, $field ); } } } }