WordPress function to get user first name

Below is a simple function to fetch the user’s data. If no user is provided then the current user is fetched.

Credits: https://kellenmace.com