Setting default values to the logged-in user

Setting default values to the logged-in user

You may need to create a contact form targeted at users with accounts on your WordPress site. You already have basic information about the user (name, e-mail, etc.) so asking users for this would be redundant.

You can set the logged-in user』s information as the default value by adding several options to a text field.

OptionDescriptiondefault:user_loginUser』s login namedefault:user_emailUser』s email addressdefault:user_urlUser』s site URLdefault:user_first_nameUser』s first namedefault:user_last_nameUser』s last namedefault:user_nicknameUser』s nicknamedefault:user_display_nameUser』s display name

Example:

Your Name: [text* your-name default:user_display_name]
Your E-mail: [email* your-email default:user_email]

Users who are logged in will notice that the basic information is already completed.
Share this:FacebookTwitterLike this:Like Loading...

發表回覆

您的電子郵箱地址不會被公開。 必填項已用 * 標註