Permalink
Browse files

Update storyline drop down output.

Ensures that only the bottom-most storyline in a tree displays comics.
  • Loading branch information...
1 parent caf77f6 commit 5f991c808f0f405d35a4c869f8f5d0b914d217af Michael Sisk committed May 6, 2014
Showing with 5 additions and 4 deletions.
  1. +5 −4 -/php/tags.php
View
@@ -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>';
}

0 comments on commit 5f991c8

Please sign in to comment.