skip to Main Content

mywp_user

Mywp_user

Description

mywp_user shortcode can be get the user data.

 

Usage

Default user data is current user and "field" attribute is must have a value.

[mywp_user field="****"]

 

Attributes

field="id"

Get the user id.

[mywp_user field="id"]
1

 

field="name"

Get the user display name.

[mywp_user field="name"]
Admin

 

field="fname"

Get the user first name.

[mywp_user field="fname"]
Firstname

 

field="lname"

Get the user last name.

[mywp_user field="lname"]
Lastname

 

field="displayname"

Get the user display name.

[mywp_user field="displayname"]
Displayname

 

field="user_login"

Get the user login name.

[mywp_user field="user_login"]
admin

 

field="user_role"

Get the user role name.

[mywp_user field="user_role"]
administrator

 

field="avatar"

Get the avatar html tag. And this code can be change the avatar size with size="***" (default size: 96).

[mywp_user field="avatar" size="100"]

Avatar IMG:

<img class="avatar avatar-100 photo" src="###avatar_url###" srcset="###avatar_url###" alt="" width="100" height="100" />

 

user_id="***"

This shortcode can be get the other user information with user_id="***".

[mywp_user user_id="1" field="id"]
1

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top