Skip to content

Commit

Permalink
Update storyline drop down output.
Browse files Browse the repository at this point in the history
Ensures that only the bottom-most storyline in a tree displays comics.
  • Loading branch information
Michael Sisk committed May 6, 2014
1 parent caf77f6 commit 5f991c8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions -/php/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -6568,24 +6568,25 @@ public function start_el( &$output, $term, $depth = 0, $args = array(), $current
array(
'taxonomy' => $term->taxonomy,
'field' => 'id',
'include_children' => false,
'terms' => $term->term_id
)
)
) );

$output .= '<optgroup label="' . $term_pad . $term_title . ( $show_count ? " ({$term->count})" : '' ) . '">';

if ( $the_posts->have_posts() ) {
$output .= '<optgroup label="' . $term_pad . $term_title . ( $show_count ? " ({$term->count})" : '' ) . '">';

$i = 0;

while ( $the_posts->have_posts() ) { $the_posts->the_post();
$i++;

$output .= '<option value="' . get_the_ID() . '" data-webcomic-url="' . apply_filters( 'the_permalink', get_permalink() ) . '"' . ( $selected === get_the_ID() ? ' selected' : '' ) . '>' . $term_pad . apply_filters( 'term_dropdown_webcomic_title', the_title( '', '', false ), get_post(), $i ) . '</option>';
}

$output .= '</optgroup>';
}

$output .= '</optgroup>';
} else {
$output .= '<option value="' . $term->term_id . '" data-webcomic-url="' . ( 'archive' === $target ? get_term_link( $term, $term->taxonomy ) : WebcomicTag::get_relative_webcomic_link( $target, $term->term_id, false, $term->taxonomy, preg_replace( '/_(storyline|character)$/', '', $term->taxonomy ) ) ) . '"' . ( $selected === $term->term_id ? ' selected' : '' ) . '>' . $term_pad . $term_title . ( $show_count ? " ({$term->count})" : '' ) . '</option>';
}
Expand Down

0 comments on commit 5f991c8

Please sign in to comment.