{user} Merge Tag

Summary

Displays the value of the user meta field for the logged in user, based on the modifier used.

Usage

{user:[meta_key]}

Meta Field Name Examples

Use the {user} merge tag with these modifiers to obtain meta values for the logged-in user. The merge tag can be used in the field default value settings to populate a field with information from the logged-in user’s profile. The {user} merge tag will yield unpredictable results if used in the form notification or confirmation, and should not be used there.

Below are a few examples of how this merge tag can be used. Please note: The user must be logged in when the entry is submitted.

:first_name

Displays the first name of the currently logged in user. {user:first_name}

:last_name

Displays the last name of the currently logged in user. {user:last_name}

:display_name

Displays the Display Name of the currently logged in user. {user:display_name}

:user_email

Displays the email of the currently logged in user. {user:user_email}

:user_login

Displays the user login of the currently logged in user. {user:user_login}

:ID

Displays the ID of the currently logged in user. {user:ID}

Custom User Meta Fields

The {user} merge tag is not limited to default WordPress user meta keys. If your user records use a meta key such as “preferred_contact_method”, you can access that information with the following merge tag modifier:

:preferred_contact_method

Displays the value of user meta with custom meta_key. {user:preferred_contact_method}

This method can be extended for any user meta key you need to access.