From 3504002abe388ff6c690bc9f9b56761fa0da7635 Mon Sep 17 00:00:00 2001 From: Jon Cave Date: Mon, 21 Nov 2011 20:44:48 +0000 Subject: [PATCH] Link the posts count on taxonomy list table for non-public taxonomies. Instead check if the post type has show_ui => true as we're linking to the post list table. Fixes #18722. git-svn-id: https://develop.svn.wordpress.org/trunk@19383 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/class-wp-terms-list-table.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/class-wp-terms-list-table.php b/wp-admin/includes/class-wp-terms-list-table.php index 126a7aa7f7..76b5756a75 100644 --- a/wp-admin/includes/class-wp-terms-list-table.php +++ b/wp-admin/includes/class-wp-terms-list-table.php @@ -283,13 +283,16 @@ class WP_Terms_List_Table extends WP_List_Table { } function column_posts( $tag ) { - global $taxonomy, $post_type; + global $taxonomy; $count = number_format_i18n( $tag->count ); $tax = get_taxonomy( $taxonomy ); - if ( ! $tax->public ) + $post_type = get_current_screen()->post_type; + $ptype_object = get_post_type_object( $post_type ); + + if ( ! $ptype_object->show_ui ) return $count; if ( $tax->query_var ) { @@ -298,7 +301,8 @@ class WP_Terms_List_Table extends WP_List_Table { $args = array( 'taxonomy' => $tax->name, 'term' => $tag->slug ); } - $args['post_type'] = $post_type; + if ( 'post' != $post_type ) + $args['post_type'] = $post_type; return "$count"; }