Wordpress - Auto sort the wp-admin post list by a meta key
Something like this should work:
function wpa84258_admin_posts_sort_last_name( $query ){
global $pagenow;
if( is_admin()
&& 'edit.php' == $pagenow
&& !isset( $_GET['orderby'] )
&& !isset( $_GET['post_type'] ) ){
$query->set( 'meta_key', 'last_name' );
$query->set( 'orderby', 'meta_value' );
$query->set( 'order', 'ASC' );
}
}
add_action( 'pre_get_posts', 'wpa84258_admin_posts_sort_last_name' );