The issue here is that both the functions have the same name – colaborator_avatar().
Make sure that $new_user contains the current user. Else use get_current_user_id() like this:
get_user_meta( get_current_user_id(), 'first_name', true );
Show avatar and first name:
// show user avatar if logged in
function colaborator_avatar($atts)
{
if (is_user_logged_in() && !is_feed()) {
return get_avatar(get_the_author_meta( 'user_email' ));
}
}
add_shortcode('colaborator_avatar', 'colaborator_avatar');
// show username if logged in
function colaborator_nome($atts)
{
if (is_user_logged_in() && !is_feed()) {
return get_user_meta( $new_user->ID, 'first_name', true );
}
}
add_shortcode('colaborator_nome', 'colaborator_nome');
Or show Username:
function colaborator_nome($atts) {
if (is_user_logged_in() && !is_feed()) {
$current_user = wp_get_current_user();
echo $current_user->user_login;
}
}
add_shortcode('colaborator_nome', 'colaborator_nome');