Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author gVectors Team

    (@gvectors-team)

    wpDiscuz shows users display names. I should update wp_users table and set all display names as Firstname + Lastnam. Make sure those exist. If those don’t exist you should use simple username.

    Thread Starter SFMichael

    (@sfmichael)

    Unfortunately the website the plugin is installed on uses email addresses as usernames (For some unknown reason) so displaying the username is undesirable. The user base is also quite high so simply forcing first and last name won’t work for existing users.

    Is there anyway at all I can override this?

    Thread Starter SFMichael

    (@sfmichael)

    Sorry for reiterating, but is there anything I can use to change the author name if first and last name doesn’t exist without hacking your plugin?

    I like this plugin and would prefer not to have to change.

    Plugin Author gVectors Team

    (@gvectors-team)

    Hi SFMichael,
    Please wait for wpDiscuz 3.0.8 , we’re releasing it within next 24 hours.
    We add some good hook to allow hack user display names.
    You will just put this code in functions.php file. Hope you know what to change here:

    add_filter('wpdiscuz_comment_author', 'wpdiscuz_custom_author', 10, 2);
    function wpdiscuz_custom_author($author_name, $comment) {
        if ($comment->user_id) {
            $column = 'display_name'; // Other options: 'user_login', 'user_nicename', 'nickname', 'first_name', 'last_name'
            $author_name = get_the_author_meta($column, $comment->user_id);
        }
        return $author_name;
    }

    This is only for 3.0.8 and higher versions.

    Thread Starter SFMichael

    (@sfmichael)

    Worked a treat. Many thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Change Comment Authors Name’ is closed to new replies.