Changeset 33764 for trunk/src/wp-includes/category-template.php
- Timestamp:
- 08/26/2015 07:41:55 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/category-template.php
r33763 r33764 462 462 * 463 463 * @since 2.1.0 464 * @since 4.4.0 Introduced the `hide_title_if_no_cats` argument. 464 465 * 465 466 * @param string|array $args { … … 492 493 * @type string $title_li Text to use for the list title `<li>` element. Pass an empty string 493 494 * to disable. Default 'Categories'. 495 * @type bool $hide_title_if_no_cats Whether to hide the `$title_li` element if there are no terms in 496 * the list. Default false (title will always be shown). 494 497 * @type int $depth Category depth. Used for tab indentation. Default 0. 495 498 * @type string $taxonomy Taxonomy name. Default 'category'. … … 508 511 'exclude_tree' => '', 'current_category' => 0, 509 512 'hierarchical' => true, 'title_li' => __( 'Categories' ), 513 'hide_title_if_no_cats' => false, 510 514 'echo' => 1, 'depth' => 0, 511 515 'taxonomy' => 'category' … … 535 539 536 540 $output = ''; 537 if ( $r['title_li'] && 'list' == $r['style'] ) {541 if ( $r['title_li'] && 'list' == $r['style'] && ( ! empty( $categories ) || ! $r['hide_title_if_no_cats'] ) ) { 538 542 $output = '<li class="' . esc_attr( $r['class'] ) . '">' . $r['title_li'] . '<ul>'; 539 543 }
Note: See TracChangeset
for help on using the changeset viewer.