Forum breadcrumbs – You are here:Asgaros Support ForumSupportUser/Display Names
Please or Register to create posts and topics.

User/Display Names

Hello,

We have a website for our Home Owner’s Association and have been using Asgaros for quite some time.

The one issue that I am having is that when posting on our forum, the Member’s name and address (in our case Division and Lot #; i.e.: 8-68) must be displayed so that owners posting on the forum will not be anonymous.

Some Members have realized that they can change their Nicknames and Display Names to hide their address. Is it possible to display only the proper version of their name which shows address and remove the ability for the user to change it from the front end?

Thanks!

Derek

Hey @derekn,

do you use the WordPress Profile? If so you can just don’t allow them to change the display name by using the following code:

add_filter('pre_user_display_name', 'protect_display_name');

function protect_display_name($name)
{
    if (!current_user_can('manage_options')) {
        $name = wp_get_current_user()->display_name;
    }

    return $name;
}

If you are using this code only admins will be able to change the display name.

Asgaros has reacted to this post.
Asgaros
Need professional help with Asgaros Forum? Book an appointment with us at domra Web Solutions for setup and customization services. Learn more about our Toolbox for Asgaros Forum plugin to enhance your forum experience.

I appreciate the reply. I’m quite sure that we are using WP profiles but I’ve never added code to WP before though we do have people we can ask to add it.

I was told that every time we update to the newest version of WP, we’ll need to re-add the code. Is that correct? If so, I’d better learn how to add it myself! 🙂

Thanks again!

Hey @derekn,

that’s not correct. There are different ways to add this code to your website and the two that I always advice will keep the changes also when getting an update:

  1. Create a small Plugin
  2. Create a child theme

It’s better not to edit any Core, Plugin or Theme code to make some changes.

Asgaros has reacted to this post.
Asgaros
Need professional help with Asgaros Forum? Book an appointment with us at domra Web Solutions for setup and customization services. Learn more about our Toolbox for Asgaros Forum plugin to enhance your forum experience.

I’ll look into what it takes to make a plugin.

Much appreciated!