Shortcode to embed Edit Account form not working
I'm creating a short code that shows both first and last name of the user if he's logged in, or, if he's logged in, but hasn't configured any name, it will return a random name with a message telling him to edit his profile. I'm succeeding into getting the names, but not into showing the text that should appear in case the user has no name. The code:
// Show name if logged in - PT e ENG
function colaborador_nome($atts)
{
if (is_user_logged_in() !is_feed()) {
return 'nbsp;' . $username = 'a href=' . ( admin_url('profile.php') .'' . get_user_meta(get_current_user_id(), 'first_name' , true) . 'nbsp;' .
(($username = get_user_meta(get_current_user_id(), 'last_name', true) . '/a') ? $username : 'nbsp;a href=' . admin_url('profile.php') . 'Noe Name [edit profile]/a'));
}
}
add_shortcode('colaborador_nome', 'colaborador_nome');
The part that's not working:
? $username : 'nbsp;a href=' . admin_url('profile.php') . 'Noe Name [edit profile]/a'