Order by the author's display name:
This is most likely by design, because the only information about the author in the wp_posts
table is the author ID.
We can join it with the wp_users
table to get more information about the user and then modify the order accordingly.
Here's an example how we can order by the display name:
/**
* Modify the author sorting of the media library uploads (mode=list),
* use 'display_name' instead of 'post_author'.
*
* @see http://wordpress.stackexchange.com/a/184501/26350
*/
add_action( 'load-upload.php', function()
{
add_filter( 'posts_clauses', function( $clauses, $q )
{
if( $q->is_main_query()
&& 'list' === filter_input( INPUT_GET, 'mode' )
&& 'author' === filter_input( INPUT_GET, 'orderby' )
) {
global $wpdb;
// Join part:
$clauses['join'] .= " LEFT JOIN {$wpdb->users} u
ON u.ID = {$wpdb->posts}.post_author ";
// Orderby part:
$clauses['orderby'] = str_replace(
"{$wpdb->posts}.post_author",
" u.display_name",
$clauses['orderby']
);
}
return $clauses;
}, 10, 2 );
});
The first- and last names are stored in the wp_usermeta
table, so you would need to adjust the SQL query for that, but note that these fields could both be empty. The display name, on the other hand, is always set, afaik.