Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit 5f991c8

Browse files
author
Michael Sisk
committed
Update storyline drop down output.
Ensures that only the bottom-most storyline in a tree displays comics.
1 parent caf77f6 commit 5f991c8

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

-/php/tags.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6568,24 +6568,25 @@ public function start_el( &$output, $term, $depth = 0, $args = array(), $current
65686568
array(
65696569
'taxonomy' => $term->taxonomy,
65706570
'field' => 'id',
6571+
'include_children' => false,
65716572
'terms' => $term->term_id
65726573
)
65736574
)
65746575
) );
65756576

6577+
$output .= '<optgroup label="' . $term_pad . $term_title . ( $show_count ? " ({$term->count})" : '' ) . '">';
6578+
65766579
if ( $the_posts->have_posts() ) {
6577-
$output .= '<optgroup label="' . $term_pad . $term_title . ( $show_count ? " ({$term->count})" : '' ) . '">';
6578-
65796580
$i = 0;
65806581

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

65846585
$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>';
65856586
}
6586-
6587-
$output .= '</optgroup>';
65886587
}
6588+
6589+
$output .= '</optgroup>';
65896590
} else {
65906591
$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>';
65916592
}

0 commit comments

Comments
 (0)