php – How to create a new message when registering with the name and the name of the user as title

I have been working in this field for some time and I can not understand this during my life. Here is my code from now on.

add_action (& # 39; user_register & # 39 ;, create_new_user_profile & # 39 ;, 999);

function create_new_user_profile ($ user_id) {
if (! $ user_id> 0)
return;

$ user_info = get_user_meta ($ user_id);
$ profile_first = $ user_info-> first_name;

$ profile_post = array (
& # 39; post_title & # 39; => $ profile_first,
& # 39; post_content & # 39; => & # 39; This is the profile post.
& # 39; post_status & # 39; => & Quot; publish & quot;
& # 39; post_type & # 39; => "Team",
& # 39; post_author & # 39; => $ user_id
)

$ profile = wp_insert_post ($ profile_post);

}

I've tried several things and searched for a while, the current code returns an empty string, but thanks to other alternatives, I was able to post the user name or userid in as long as title, but I can not get the display name or a combination of first name and last name that is what I need.