WordPress.org

Make WordPress Core

Changeset 16578


Ignore:
Timestamp:
11/24/2010 11:29:13 PM (8 years ago)
Author:
scribu
Message:

Don't link post counts if taxonomy isn't queryable. Fixes #15573

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-terms-list-table.php

    r16368 r16578  
    275275        $count = number_format_i18n( $tag->count );
    276276
    277         if ( 'post_tag' == $taxonomy ) {
    278             $tagsel = 'tag';
    279         } elseif ( 'category' == $taxonomy ) {
    280             $tagsel = 'category_name';
    281         } elseif ( ! empty( $tax->query_var ) ) {
    282             $tagsel = $tax->query_var;
    283         } else {
    284             $tagsel = $taxonomy;
    285         }
    286 
    287         return "<a href='edit.php?$tagsel=$tag->slug&amp;post_type=$post_type'>$count</a>";
     277        $tax = get_taxonomy( $taxonomy );
     278        if ( $tax->query_var ) {
     279            return "<a href='" . add_query_arg( array( $tax->query_var => $tag->slug, 'post_type' => $post_type ), 'edit.php' ) . "'>$count</a>";       
     280        }
     281
     282        return $count;
    288283    }
    289284
Note: See TracChangeset for help on using the changeset viewer.