diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-admin/includes/class-wp-media-list-table.php --- a/wp/wp-admin/includes/class-wp-media-list-table.php Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-admin/includes/class-wp-media-list-table.php Fri Sep 05 18:40:08 2025 +0200 @@ -11,7 +11,6 @@ * Core class used to implement displaying media items in a list table. * * @since 3.1.0 - * @access private * * @see WP_List_Table */ @@ -111,6 +110,10 @@ 'per_page' => $wp_query->query_vars['posts_per_page'], ) ); + if ( $wp_query->posts ) { + update_post_thumbnail_cache( $wp_query ); + update_post_parent_caches( $wp_query->posts ); + } } /** @@ -137,7 +140,7 @@ } $selected = selected( - $filter && 0 === strpos( $filter, 'post_mime_type:' ) && + $filter && str_starts_with( $filter, 'post_mime_type:' ) && wp_match_mime_types( $mime_type, str_replace( 'post_mime_type:', '', $filter ) ), true, false @@ -260,7 +263,7 @@ } /** - * Override parent views so we can use the filter bar display. + * Overrides parent views to use the filter bar display. * * @global string $mode List table view mode. */ @@ -275,7 +278,12 @@
view_switcher( $mode ); ?> - + +
detached ) { $posts_columns['parent'] = _x( 'Uploaded to', 'column name' ); + if ( post_type_supports( 'attachment', 'comments' ) ) { - $posts_columns['comments'] = '' . __( 'Comments' ) . ''; + $posts_columns['comments'] = sprintf( + '%2$s', + esc_attr__( 'Comments' ), + /* translators: Hidden accessibility text. */ + __( 'Comments' ) + ); } } @@ -375,11 +397,11 @@ */ protected function get_sortable_columns() { return array( - 'title' => 'title', - 'author' => 'author', - 'parent' => 'parent', - 'comments' => 'comment_count', - 'date' => array( 'date', true ), + 'title' => array( 'title', false, _x( 'File', 'column name' ), __( 'Table ordered by File Name.' ) ), + 'author' => array( 'author', false, __( 'Author' ), __( 'Table ordered by Author.' ) ), + 'parent' => array( 'parent', false, _x( 'Uploaded to', 'column name' ), __( 'Table ordered by Uploaded To.' ) ), + 'comments' => array( 'comment_count', __( 'Comments' ), false, __( 'Table ordered by Comments.' ) ), + 'date' => array( 'date', true, __( 'Date' ), __( 'Table ordered by Date.' ), 'desc' ), ); } @@ -397,13 +419,15 @@ if ( current_user_can( 'edit_post', $post->ID ) ) { ?> -