adding user shortcode to display any user data
// Add Shortcode
function user_shortcode( $atts ) {
$a = shortcode_atts(
array(
'user_id' => get_current_user_id(),
'field' => '',
), $atts );
$user = get_user_by( 'id', $a['user_id'] );
$output = !empty($user->$a['field']) ? $user->$a['field'] : '';
return $output;
}
add_shortcode( 'user', 'user_shortcode' );