sections[] = $section; } /** * Returns the sections. * * @return Section_Interface[] */ public function get_sections(): array { return $this->sections; } /** * Renders the items of the bucket. * * @return string */ public function render(): string { if ( empty( $this->sections ) ) { return ''; } $rendered_sections = []; foreach ( $this->sections as $section ) { $section_content = $section->render(); if ( $section_content === '' ) { continue; } $rendered_sections[] = $section->get_prefix() . $section_content . \PHP_EOL; } return \implode( \PHP_EOL, $rendered_sections ); } }