items ) ); if ( array() === $keys ) { return ''; } return in_array( $this->current, $keys, true ) ? $this->current : $keys[0]; } public function html(): string { if ( array() === $this->items ) { return ''; } $current = $this->current_key(); $base = remove_query_arg( array( $this->arg, 'paged' ), $this->url ); $html = ''; foreach ( array_map( 'strval', array_keys( $this->items ) ) as $i => $key ) { $view = $this->items[ $key ]; $count = max( 0, (int) ( $view['count'] ?? 0 ) ); $link = 0 === $i ? $base : add_query_arg( $this->arg, rawurlencode( $key ), $base ); $html .= '
  • ' . esc_html( (string) ( $view['label'] ?? $key ) ) . '' . esc_html( \RoosterLMS\I18n\Format::number( $count ) ) . '
  • '; } $label = '' !== $this->label ? $this->label : __( 'Status', 'rooster-lms' ); return ''; } }