In WP_Media_List_Table, remove dead code:

* In `->prepare_items()`, importing `$wpdb` is unnecessary.
* In `->get_columns()`, `$taxonomies` is set twice before it is used.
* In `->display_rows()`, `$taxonomy_object` is set and never used.

See #27882.



git-svn-id: https://develop.svn.wordpress.org/trunk@28293 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-05-06 15:26:32 +00:00
parent 41d1eb8f56
commit 36abe7909c

View File

@ -23,7 +23,7 @@ class WP_Media_List_Table extends WP_List_Table {
}
function prepare_items() {
global $lost, $wpdb, $wp_query, $post_mime_types, $avail_post_mime_types;
global $lost, $wp_query, $post_mime_types, $avail_post_mime_types;
$q = $_REQUEST;
@ -133,8 +133,6 @@ class WP_Media_List_Table extends WP_List_Table {
$posts_columns['title'] = _x( 'File', 'column name' );
$posts_columns['author'] = __( 'Author' );
$taxonomies = array();
$taxonomies = get_taxonomies_for_attachments( 'objects' );
$taxonomies = wp_filter_object_list( $taxonomies, array( 'show_admin_column' => true ), 'and', 'name' );
@ -377,7 +375,6 @@ foreach ( $columns as $column_name => $column_display_name ) {
$taxonomy = false;
if ( $taxonomy ) {
$taxonomy_object = get_taxonomy( $taxonomy );
echo '<td ' . $attributes . '>';
if ( $terms = get_the_terms( $post->ID, $taxonomy ) ) {
$out = array();