WC_Settings_Page::output_sections
Output sections.
Method of the class: WC_Settings_Page{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Settings_Page = new WC_Settings_Page(); $WC_Settings_Page->output_sections();
WC_Settings_Page::output_sections() WC Settings Page::output sections code WC 10.5.0
public function output_sections() {
global $current_section;
$sections = $this->get_sections();
if ( empty( $sections ) || 1 === count( $sections ) ) {
return;
}
echo '<ul class="subsubsub">';
$array_keys = array_keys( $sections );
foreach ( $sections as $id => $label ) {
$url = admin_url( 'admin.php?page=wc-settings&tab=' . $this->id . '§ion=' . sanitize_title( $id ) );
$class = ( $current_section === $id ? 'current' : '' );
$separator = ( end( $array_keys ) === $id ? '' : '|' );
$text = esc_html( $label );
echo "<li><a href='$url' class='$class'>$text</a> $separator </li>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
echo '</ul><br class="clear" />';
}