Shortcodes

Below is list of shortcodes in WP User:

  • [wp_user]
  • [wp_user_member]
  • [wp_user_restrict] …….[/wp_user_restrict]
  • [wp_user_search]
  • [wp_user_counter]
[wp_user] shortcode for display login, registration, forgot password form.
 You Can use following attributes for custom form
 [wp_user id='1234' width='360px' popup='1' active='register' role='subscriber' login_redirect='http://localhost/niyuj' layout='default' skin='blue']
 id : If Multiple Form Add-on activated then create form and set id='form_id'. You can use diffrent registration form for diffrent page.
 Ex. [wp_user id='1234']
 width : set custom width to login, registration, forgot password form.
 [wp_user width='360px']
 popup : set popup='1' shortcode for popuup model login, registration, forgot password form.
 Ex. [wp_user popup='1']
 active : For activate default form. By default login.
 [wp_user active='register' popup='1'] shortcode for popuup model login, registration, forgot password form. default active registration form
 [wp_user active='register'] for display default active registration form.(sign up page)
 [wp_user active='forgot'] shortcode for display login, registration, forgot password form. default active forgot form
 role : Set role for new register user via register form. You can set diffrent role for diffrent form. By default subscriber role
 Ex. [wp_user role='subscriber']
 login_redirect : Custom login redirection url for each login form.
 Ex. [wp_user login_redirect='http://localhost/niyuj']
 layout : Set diffrent layout to diffrent form Ex. [wp_user layout='default']
 skin : Set diffrent skin color to diffrent form Ex. [wp_user skin='blue']

  • Use login_redirect attribute in  wp_user shortcode for redirection after successful login user
    Use shortcode like [wp_user login_redirect=’www.yoursite.com']

     

  • Use register_redirect attribute in  wp_user shortcode for redirection after successful register user
    Use shortcode like [wp_user register_redirect=’www.yoursite.com']

     

  • Support Multi step form and validation – ( Need to install Form builder Addon )Create multiple form using Form builder addonAdd multi_steps attribute in  wp_user shortcode add pass form ids which you want to show in multi steps
    Ex :[wp_user multi_steps =’22,25,27,29’]

    If you want to show form horizontal in sten 1-2-3-4—-N then use step=’horizontal’ attribute in  wp_user shortcode

    Ex :[wp_user multi_steps =’22,25,27,29’ step=’horizontal’]

[wp_user_member] shortcode for display member list/directory
You can use following attributes for filter/show member list
[wp_user_member role_in=’subscriber’ role_not_in=’author’ include=’1,2,5,7′ exclude=’55,44,78,87′ approve=’1′ size=’small’]
role_in : If you want to show only selected member role in list then set this attribute by comma seprated
Ex. [wp_user_member role_in=’subscriber,author’]
role_not_in : If you want exclude to show some user roles in member list then set this attribute by comma seprated
Ex. [wp_user_member role_not_in=’subscriber,author’]
include : If you want only show selected user ids then set this attribute by comma seprated
Ex. [wp_user_member include=’1,2,5,7′ ]
exclude : If you don’t want show selected user ids then set this attribute by comma seprated
Ex. [wp_user_member exclude=’55,44,78,87′ ]
approve : If you want show only approve user then set approve=’1′
Ex. [wp_user_member approve=’1′ ]
size : If you want change default display member list template to small one then set size=’small’
Ex. [wp_user_member size=’small’ ]


[wp_user_list] shortcode for display member list/directory

You can use following attributes for filter/show member list

[wp_user_list role_in=’subscriber’ role_not_in=’author’ include=’1,2,5,7′ exclude=’55,44,78,87′ approve=’1′ size=’small’]

role_in : If you want to show only selected member role in list then set this attribute by comma separated

Ex. [wp_user_list role_in=’subscriber,author’]

role_not_in : If you want exclude to show some user roles in member list then set this attribute by comma separated

Ex. [wp_user_list role_not_in=’subscriber,author’]

include : If you want only show selected user ids then set this attribute by comma separated

Ex. [wp_user_list include=’1,2,5,7′ ]

exclude : If you don’t want show selected user ids then set this attribute by comma separated

Ex. [wp_user_list exclude=’55,44,78,87′ ]

approve : If you want show only approve user then set approve=’1′

Ex. [wp_user_list approve=’1′ ]

template : If you want change default display member list with different layout then set template=

Template : Currently we 2 template available for show user list

Rounded (template=rounded ): set template parameter as rounded.

Ex: [wp_user_list template=’rounded’]

Default :

Ex: [wp_user_list]


Key,Value : if you want user list display user list on particular page based on user_meta key and value then set Key and Value attribute.

If you have pages like Bride, Groom so based on user meta_key you can display or category user using this attribute

Ex:

Bride : [wp_user_list key='gender' value='Female']

Groom : [wp_user_list key='gender' value='Male']


Use above shortcode respective pages and set meta key as gender and it value male or female.

This meta key add using form builder addon and add filed for gender in register/profile form.


You can add multiple key and values in this shortcode.

Ex: If you want to add Bride page on site and only for Unmarried' then add multiple keys and values using comma separated


[wp_user_list key='gender,maritial_status' value='Female,Unmarried']


This meta key add using form builder addon and add filed for gender and maritial_status  in register/profile form.


id : If Form builder addon is Activated then filter result based on custom fields.

Create new form using form builder

Add field into form which you want to add in custom filter

Get form id from list

Set id attribute in form and set value as form id

Ex:

[wp_user_list id='474']

[wp_user_list id='474' key='gender,maritial_status' value='Female,Unmarried']


So based on this filter it will filter the result.


[wp_user_restrict] your restricted content goes here [/wp_user_restrict] shortcode for Restrict Content to registered users only. logged in users only access content
To restrict just a section of content within a post or page, you may use above shortcodes
You can also set user role for access content.
You can use role attribute for only access content to selected user role:
Ex. [wp_user_restrict role=’author,editor’] your restricted content goes here [/wp_user_restrict]
Ex. [wp_user_restrict role=’author’] your restricted content goes here [/wp_user_restrict]
Ex. [wp_user_restrict role=’logged_in’] your restricted content goes here [/wp_user_restrict] : logged in users only access content
To restrict an entire post or page, simply select the user role you’d like to restrict the post or page to from the drop down menu added just below the post/page editor. .

Search Form

Demo

[wp_user_search] shortcode for display search form .

Ex: [wp_user_search id=’1234′]

id : If Multiple Form Add-on activated then create form and set id=’form_id’. You can use diffrent form for diffrent page. Ex. [wp_user id=’1234′]

Popup Search Form

[wp_user_search id=’1234′ type=’popup’ ]

type :type=’popup’  shortcode for popuup model search form

Header  Search Form

[wp_user_search id=’1234′ type=’header’ ]

type :type=’header’  shortcode for  show search form in header section or top of page.

You can also add in home page slider using do_shortcode function

echo do_shortcode(“[wp_user_search id=’1234′ type=’header’ ]”);

Widget  Search Form

Go to Apperance -> Widget and add WP User Search widget in widget area where you want to show search widged.

Add Widget title and set form id.(If Multiple Form Add-on activated then create form and set id) other wise leave blank. it will show defualt search field.

Using form id you can add custom field in search form

 Display Counter / Number of user



Demo
[wp_user_counter] wp_user_counter Shortcode show user counter(number of user)

You can use following attributes for filter/show counter result  

[wp_user_counter title='title' skin='blue' icon='fa fa user']
title : set title for count Ex: title ='groom'
skin : set color for counter background usin skin ex skin='blue' (blue,red,green,yellow)
icon : set ion for perticular client
[wp_user_counter role_in=’subscriber’ role_not_in=’author’ include=’1,2,5,7′ exclude=’55,44,78,87′ approve=’1′ size=’small’]

role_in : If you want to show only selected member role count then set this attribute by comma separated

Ex. [wp_user_counter role_in=’subscriber,author’]

role_not_in : If you want exclude to show some user roles in member list then set this attribute by comma separated

Ex. [wp_user_counter role_not_in=’subscriber,author’]

include : If you want only show selected user count then set this attribute by comma separated

Ex. [wp_user_counter include=’1,2,5,7′ ]

exclude : If you don’t want show selected user in count then set this attribute by comma separated

Ex. [wp_user_counter exclude=’55,44,78,87′ ]

approve : If you want show only approve user count then set approve=’1′

Ex. [wp_user_counter approve=’1′ ]


Key,Value : if you want user list display user count on particular user based on user_meta key and value then set Key and Value attribute.

If you have pages like Bride, Groom so based on user meta_key you can display count
Ex:

Bride : [wp_user_counter key='gender' value='Female']

Groom : [wp_user_counter key='gender' value='Male']


Use above shortcode respective pages and set metakey as gender and it value male or female.

This meta key add using form builder addon and add filed for gender in register/profile form.


You can add multiple key and values in this shortcode.

Ex: If you want to show Bride count on site and only for Unmarried' then add multiple keys and values using comma separated


[wp_user_counter key='gender,maritial_status' value='Female,Unmarried']


This meta key add using form builder addon and add filed for gender and maritial_status  in register/profile form.


id : If Form builder addon is Activated then filter result based on custom fields.

Create new form using form builder

So based on this filter it will filter the result and show member count.

admin

Comments are closed.

Help-Desk