We know that display name and nickname are very useful option in wordpress. Some users want to show display name or nickname instead of username. But there is possibility to be the display name and username same for more than one users. It will create confusion in plugin like BuddyPress or Classifieds or so.
But, if you can protect your user and system to create duplicate display name and nickname, then itâ€™s achievable. Letâ€™s make the hands dirty
You can add these codes in your functions.php in the theme, if you think your theme wonâ€™t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name â€˜mu-pluginsâ€™. If there is no folder in that name, then create a folder, name it â€˜mu-pluginsâ€™, create a file inside that, give any name you like and paste the code in their. You donâ€™t need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always.
The above code speaks a lot!
Many thanks to my colleague Vaughan Montgomery.
Suggestions are welcome