Is it possible to set/override default the_author_posts_link to login name?

the_author_posts_link is so handy. But is there now way in WordPress to set/edit the default display name for all new authors? (I know you can manually edit per author). I’d like it to be user_login, and then I can just call the_author_posts_link accordingly.

Related posts

Leave a Reply

1 comment

  1. Try this, it will change display names to logins anywhere in the Loop:

    add_filter('the_author', 'return_login');
    
    function return_login($display_name) {
    
        if ( !in_the_loop() )
            return $display_name;
    
        return get_the_author_meta('login');
    }