does anyone know of way I can change the existing display name publicly as for all users. I want to have firstname lastname as the default because this will reflect in the forum
Quick and dirty hack would be to edit the file 'wp-includes/user.php' edit the folowing
if ( empty($display_name) )
$display_name = $user_login;
$display_name = apply_filters('pre_user_display_name', $display_name);
Edit this line
$display_name = $user_login;
Change to:
$display_name = $first_name . ' ' . $last_name;
The above solution should work, assuming that the user.php file isn't changed in a WordPress update or alternativly you could add something like this to your functions.php
//force display-name of users to Firstname Lastname
add_action('admin_head','force_pretty_displaynames');
function force_pretty_displaynames() {
$current_user = wp_get_current_user();
if ($current_user->display_name != $current_user->first_name." ".$current_user->last_name){
update_user_meta($current_user->ID, 'display_name', $current_user->first_name." ".$current_user->last_name);
}
}
but agian a few checks on this above could be added to see if the user is logged in, is an admin, contributor etc..etc..
but should do what your looking for..
Source: http://wordpress.org/support/topic/change-default-display-name-1
Marty