diff --git a/wp-admin/admin.php b/wp-admin/admin.php index 1932caf888..a759d452b0 100644 --- a/wp-admin/admin.php +++ b/wp-admin/admin.php @@ -81,10 +81,15 @@ if ( isset($_GET['page']) ) { } if ( isset($_GET['post_type']) ) - $typenow = sanitize_user($_GET['post_type'], true); + $typenow = sanitize_key($_GET['post_type']); else $typenow = ''; +if ( isset($_GET['taxonomy']) ) + $taxnow = sanitize_key($_GET['taxonomy']); +else + $taxnow = ''; + require(ABSPATH . 'wp-admin/menu.php'); if ( current_user_can( 'manage_options' ) ) diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php index 898afc34c9..a4b48bc809 100644 --- a/wp-admin/edit-tags.php +++ b/wp-admin/edit-tags.php @@ -296,17 +296,16 @@ if ( $page_links )
- - + - + diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index dc8fc15f49..2212493304 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -396,7 +396,7 @@ function wp_link_category_checklist( $link_id = 0 ) { * @return unknown */ function _tag_row( $tag, $level, $taxonomy = 'post_tag' ) { - global $post_type; + global $post_type, $current_screen; static $row_class = ''; $row_class = ($row_class == '' ? ' class="alternate"' : ''); @@ -422,8 +422,8 @@ function _tag_row( $tag, $level, $taxonomy = 'post_tag' ) { $out .= ''; - $columns = get_column_headers('edit-tags'); - $hidden = get_hidden_columns('edit-tags'); + $columns = get_column_headers($current_screen); + $hidden = get_hidden_columns($current_screen); $default_term = get_option('default_' . $taxonomy); foreach ( $columns as $column_name => $column_display_name ) { $class = "class=\"$column_name column-$column_name\""; @@ -3900,7 +3900,7 @@ function compression_test() { * @param string $id Screen id, optional. */ function set_current_screen( $id = '' ) { - global $current_screen, $hook_suffix, $typenow; + global $current_screen, $hook_suffix, $typenow, $taxnow; if ( empty($id) ) { $current_screen = $hook_suffix; @@ -3932,6 +3932,11 @@ function set_current_screen( $id = '' ) { $typenow = 'post'; $current_screen->id = $typenow; $current_screen->post_type = $typenow; + } elseif ( 'edit-tags' == $current_screen->id ) { + if ( empty($taxnow) ) + $taxnow = 'post_tag'; + $current_screen->id = 'edit-' . $taxnow; + $current_screen->taxonomy = $taxnow; } $current_screen = apply_filters('current_screen', $current_screen);