Skip to content

Commit

Permalink
replace case/switch with if/else
Browse files Browse the repository at this point in the history
  • Loading branch information
benlk committed Mar 31, 2016
1 parent 4bc2b5d commit 630934d
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions inc/widgets/largo-taxonomy-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,10 @@ function widget( $args, $instance ) {

$tax_items = get_categories($term_args);

switch ( $instance['taxonomy'] ) {
case 'series':
$this->render_series_list( $tax_items, $instance );
break;
case 'category':
$this->render_term_list( $tax_items, $instance );
break;
case 'post_tag':
$this->render_term_list( $tax_items, $instance );
break;
default:
$this->render_term_list( $tax_items, $instance );
if ( $instance['taxonomy'] === 'series' ) {
$this->render_series_list( $tax_items, $instance );
} else {
$this->render_term_list( $tax_items, $instance );
}

echo '</ul>';
Expand Down

0 comments on commit 630934d

Please sign in to comment.