Hi,
So with the below code I can get the other users nicename depending on their role and then show their name and a link:
add_action( ‘fep_display_after_reply_message’, function(){
$authordata = get_userdata( fep_get_message_field( ‘mgs_author’ ) );
if( in_array( ’employer’, $authordata->roles )){
echo ‘‘ . $name . ‘‘;
}
});
I’m wondering it it could be possible to get the ID of that user as I need to add it to a shortcode.
I have tried a few different ways but none seem to be working. This is the shortcode I’m trying to get to work:
echo do_shortcode(‘[uwp_add_friend user_id =”%”]’);
the “%” should be the user ID but I don’t know how to get the ID from $authordata = get_userdata( fep_get_message_field( ‘mgs_author’ ) );
Could you help me?
Thanks