Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: URGENT – Nickname displays in address bar

@robin-w

Moderator

ok, that is buddypress adding the profile fields, so you may need to take it up with them if the next bit doesn’t work !

However whilst doing something for someone else today, I found a function on the net, which I have amended (but not tested) below

function change_display_name( $user_id ) {
    $info = get_userdata( $user_id );
	$args = array(
		'ID' => $user_id,
		'display_name' => $info->user_login 	);
    wp_update_user( $args );
}
add_action('user_register','change_display_name');

then on registration it should set the display_name to the username

put this in your functions file

Functions files and child themes – explained !

Skip to toolbar