Page Shortcodes

The page shortcode is used to create some of the different special pages in WP-Members.  There are several attributes available to the shortcode:

  • register
  • user-profile (formerly: members-area)
  • user-edit
  • password
  • login
  • TOS
  • user-list (premium)

register

Note that as of version 3.0 this shortcode is replaced by [wpmem_form register]. While the shortcode described here will still work, the new shortcode has more available features and is preferred.

[wp-members page=register]

The register attribute creates a registration page.  This page is strictly optional, since the plugin can place registration in place of the blocked content.  But some people find that they want to direct users to a specific page for registration.  Also, if you have a registration page, you can have a registration link display in all of the login forms.

IMPORTANT: If you are blocking pages by default, this page must be set as unblocked! If the page is blocked, it will display a login form as well as the registration form.

user-profile

[wp-members page=user-profile]

While this page is considered optional in terms of the plugin’s operation of blocking content, it is a recommended page to set up.  This page allows logged in users to change their password (helpful for changing the random password sent by the default plugin setup) and also update their registration information.  Also on this page, a user that is not logged in can reset a forgotten password.  NOTE: in 2.8.1, this replaces the “members-area” parameter.  If you are using members-area, it will still work for now, but you should consider updating to the new parameter.  If you are using 2.8.0 or earlier, you will need to use the members-area parameter instead of user-profile.

IMPORTANT: If you are blocking pages by default, this page must be set as unblocked!  The reset password function will not work if this page is blocked.

user-edit

Note that as of version 3.0 this shortcode is replaced by [wpmem_form user_edit]. While the shortcode described here will still work, the new shortcode has more available features and is preferred.

[wp-members page=user-edit]

The user-edit parameter will establish the necessary forms for a user to edit their registration information, not including changing their password.  Since this is only relevant to users who are logged in, it is recommended that this be used in conjunction with the logged in status shortcode.

NOTE: This is a single component of the members-area page parameter, so if you have a members-area page already established, you do not need this page as well.  This shortcode is for site admins that might desire a more granular level of control over how these elements are used.

password

Note that as of version 3.0 this shortcode is replaced by [wpmem_form password]. While the shortcode described here will still work, the new shortcode has more available features and is preferred.

[wp-members page=password]

The password parameter will generate a password reset form for users who are not logged in and a change password form for logged in users.  It can be used in conjunction with the logged-in and/or logged-out status shortcodes as well.

NOTE: These functions are also a component of the members-area page parameter, so if you have a members-area page already established, you do not need this page as well.  This shortcode is for site admins that might desire a more granular level of control over how these elements are used.

login

Note that as of version 3.0 this shortcode is replaced by [wpmem_form login]. While the shortcode described here will still work, the new shortcode has more available features and is preferred.

[wp-members page=login]

This is another optional page. If you want to be able to direct users to a specific page for login, this shortcode allows you to establish a page strictly for that.

As of version 2.9.8, the login page shortcode can accept the parameter redirect_to which allows you to specify a redirect URL upon successful login:
[wp-members page=login redirect_to="http://yoursite.com/some-page/"]

TOS

[wp-members page=tos url="http://yoursite.com/your-tos-page"]

This is a special shortcode for the TOS (Terms of Service) dialog, located in the plugin settings under the dialogs tab.  It is only used within the TOS dialog and is not actually used on a page. This shortcode requires an additional parameter for the url of your Terms of Service.

user-list

[wp-members page=user-list]

NOTE: While this shortcode can be used to generate a User List page, any “page” shortcode cannot be blocked without the addition of the login status shortcodes. Use the [wpmem_ul] shortcode if you intend the user list content to be blocked.

The user-list page shortcode is an integration with the WP-Members User List premium add-on module.  When the module is installed, the shortcode allows you to create a page (or set of pages) containing user information, much like a member directory.  Options include navigation, search, and the number of users to display per page.  This shortcode can be used more than once in the site and with the various parameters available could be used to do things like create separate lists of users and authors, etc.

These parameters available to the shortcode are optional:

  • role: determine the fole of the user to list (such as subscriber, author, etc).  The default is to display all roles.
  • number: the number of users that will be displayed per page.  Must be a number.  The default is 10.
  • search: determines whether or not to display the search form.  The default is true.  Setting to “false” turns it off.
  • nav: determines whether or not to display the navigation links (prev/next).  The default is true.  Setting to “false” turns it off.

[wp-members page=user-list search=false nav=false number=5]

(Note: Any of the optional parameters that are included when the shortcode is used will override that particular setting as it is set in the User List options tab. This is intended for users who may have multiple kinds of lists on their sites with different settings.)