Default to 'post' in WP_Terms_List_Table. props filosofo, fixes #15351.

git-svn-id: https://develop.svn.wordpress.org/trunk@16254 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-11-09 06:38:53 +00:00
parent 4125fe393b
commit 3a360acc5a

View File

@ -90,7 +90,7 @@ class WP_Terms_List_Table extends WP_List_Table {
}
function get_columns() {
global $taxonomy;
global $taxonomy, $typenow;
$columns = array(
'cb' => '<input type="checkbox" />',
@ -102,7 +102,8 @@ class WP_Terms_List_Table extends WP_List_Table {
if ( 'link_category' == $taxonomy ) {
$columns['links'] = __( 'Links' );
} else {
$post_type_object = get_post_type_object( $GLOBALS['typenow'] );
$post_type = empty( $typenow ) ? 'post' : $typenow;
$post_type_object = get_post_type_object( $post_type );
$columns['posts'] = $post_type_object ? $post_type_object->labels->name : __( 'Posts' );
}