I am attempting to orderby the author_name when you click on the Author arrow on a list of tickets. When you click the arrow, the names are ordering by something I cannot identify. I want them to order by the actual name and not the ID number for the user.
How do I get the orderby to query by the "nice name" of the user(author)?
public function add_support_ticket_author_query( $query )
{
if ( $query->is_main_query() && ( $orderby = $query->get( 'orderby' ) ) ) {
switch( $orderby ) {
case 'author':
$query->set( 'orderby', 'author' );
break;
}
}
}