Ticket #16792: patchCategoryWalkerSkippedCategory.patch
| File patchCategoryWalkerSkippedCategory.patch, 4.1 KB (added by samo9789, 2 years ago) |
|---|
-
wp-includes/category-template.php
832 832 833 833 $cat_name = esc_attr( $category->name ); 834 834 $cat_name = apply_filters( 'list_cats', $cat_name, $category ); 835 $link = '<a href="' . esc_attr( get_term_link($category) ) . '" '; 836 if ( $use_desc_for_title == 0 || empty($category->description) ) 837 $link .= 'title="' . esc_attr( sprintf(__( 'View all posts filed under %s' ), $cat_name) ) . '"'; 838 else 839 $link .= 'title="' . esc_attr( strip_tags( apply_filters( 'category_description', $category->description, $category ) ) ) . '"'; 840 $link .= '>'; 841 $link .= $cat_name . '</a>'; 835 if ($cat_name && strlen($cat_name)) { 836 $link = '<a href="' . esc_attr( get_term_link($category) ) . '" '; 837 if ( $use_desc_for_title == 0 || empty($category->description) ) 838 $link .= 'title="' . esc_attr( sprintf(__( 'View all posts filed under %s' ), $cat_name) ) . '"'; 839 else 840 $link .= 'title="' . esc_attr( strip_tags( apply_filters( 'category_description', $category->description, $category ) ) ) . '"'; 841 $link .= '>'; 842 $link .= $cat_name . '</a>'; 842 843 843 if ( !empty($feed_image) || !empty($feed) ) {844 $link .= ' ';844 if ( !empty($feed_image) || !empty($feed) ) { 845 $link .= ' '; 845 846 846 if ( empty($feed_image) )847 $link .= '(';847 if ( empty($feed_image) ) 848 $link .= '('; 848 849 849 $link .= '<a href="' . get_term_feed_link( $category->term_id, $category->taxonomy, $feed_type ) . '"';850 $link .= '<a href="' . get_term_feed_link( $category->term_id, $category->taxonomy, $feed_type ) . '"'; 850 851 851 if ( empty($feed) ) {852 $alt = ' alt="' . sprintf(__( 'Feed for all posts filed under %s' ), $cat_name ) . '"';853 } else {854 $title = ' title="' . $feed . '"';855 $alt = ' alt="' . $feed . '"';856 $name = $feed;857 $link .= $title;858 }852 if ( empty($feed) ) { 853 $alt = ' alt="' . sprintf(__( 'Feed for all posts filed under %s' ), $cat_name ) . '"'; 854 } else { 855 $title = ' title="' . $feed . '"'; 856 $alt = ' alt="' . $feed . '"'; 857 $name = $feed; 858 $link .= $title; 859 } 859 860 860 $link .= '>';861 $link .= '>'; 861 862 862 if ( empty($feed_image) )863 $link .= $name;864 else865 $link .= "<img src='$feed_image'$alt$title" . ' />';863 if ( empty($feed_image) ) 864 $link .= $name; 865 else 866 $link .= "<img src='$feed_image'$alt$title" . ' />'; 866 867 867 $link .= '</a>';868 $link .= '</a>'; 868 869 869 if ( empty($feed_image) )870 $link .= ')';871 }870 if ( empty($feed_image) ) 871 $link .= ')'; 872 } 872 873 873 if ( !empty($show_count) )874 $link .= ' (' . intval($category->count) . ')';874 if ( !empty($show_count) ) 875 $link .= ' (' . intval($category->count) . ')'; 875 876 876 if ( !empty($show_date) )877 $link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp);877 if ( !empty($show_date) ) 878 $link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp); 878 879 879 if ( 'list' == $args['style'] ) { 880 $output .= "\t<li"; 881 $class = 'cat-item cat-item-' . $category->term_id; 882 if ( !empty($current_category) ) { 883 $_current_category = get_term( $current_category, $category->taxonomy ); 884 if ( $category->term_id == $current_category ) 885 $class .= ' current-cat'; 886 elseif ( $category->term_id == $_current_category->parent ) 887 $class .= ' current-cat-parent'; 880 if ( 'list' == $args['style'] ) { 881 $output .= "\t<li"; 882 $class = 'cat-item cat-item-' . $category->term_id; 883 if ( !empty($current_category) ) { 884 $_current_category = get_term( $current_category, $category->taxonomy ); 885 if ( $category->term_id == $current_category ) 886 $class .= ' current-cat'; 887 elseif ( $category->term_id == $_current_category->parent ) 888 $class .= ' current-cat-parent'; 889 } 890 $output .= ' class="' . $class . '"'; 891 $output .= ">$link\n"; 892 } else { 893 $output .= "\t$link<br />\n"; 888 894 } 889 $output .= ' class="' . $class . '"';890 $output .= ">$link\n";891 } else {892 $output .= "\t$link<br />\n";893 895 } 894 896 } 895 897
