From 16cce52b9f4888c88ed2583cbab97c5a046510b1 Mon Sep 17 00:00:00 2001 From: duck_ 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: http://svn.automattic.com/wordpress/trunk@19383 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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"; }