The page shortcode is used to create some of the different special pages in WP-Members.
- login
- register
- user profile
- user profile update
- password (change|reset)
- forgot_username
- TOS
- user list (premium)
login
[wpmem_form 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.
The login page shortcode can accept the parameter redirect_to which allows you to specify a redirect URL upon successful login:
[wpmem_form login redirect_to="http://yoursite.com/some-page/"]
This shortcode has a default logged in state that displays the user’s login status and a link to log out. While this can be filtered with wpmem_login_links and wpmem_login_links_args, you can also use nested content in the shortcode to create a custom logged in state for this page:
[wpmem_form login]Anything in here displays when the user is logged in[/wpmem_form]
register
[wpmem_form register]
The register attribute creates a registration form/page. This 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. If you have a registration page, you can have a registration link display in all of the login forms.
This shortcode has a default logged in state that displays when the user is logged in. While this can be filtered with wpmem_register_links and wpmem_register_links_args, you can also use nested content in the shortcode to create a custom logged in state for this page:
[wpmem_form register]Anything in here displays when the user is logged in[/wpmem_form]
While redirects are not recommended, the register form shortcode does accept a redirect_to attribute which allows you to specify a redirect URL upon successful registration:
[wpmem_form register redirect_to="http://yoursite.com/some-page/"]
user profile
[wpmem_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.
This shortcode has an additional parameter to hide the registration form if desired:
[wpmem_profile register=hide]
Note: If individual components of this page’s processes are desired, you can use [wpmem_form user_edit] and [wpmem_form password] coupled with the [wpmem_logged_in] and [wpmem_logged_out] shortcodes.
user_edit
[wpmem_form user_edit]
The user_edit parameter will establish the necessary form for a user to edit their registration information, not including changing their password. Since this is only relevant to users who are logged in, this shortcode should only be used in conjunction with the logged in status shortcode so that it is only displayed to a logged in user.
NOTE: This is a single component of the user profile page, so if you have a user profile 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
[wpmem_form 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 [wpmem_profile] shortcode, so if you have a user profile 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.
forgot username
[wpmem_form forgot_username]
Displays the forgot username form. Best used in conjunction with the logged-out status shortcode.
NOTE: This is a single component of the user profile page, so if you have a user profile 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.
TOS
[wpmem_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 in the TOS dialog in the plugin’s Dialogs tab and is not actually used on a page. This shortcode requires an additional parameter indicating the url of your Terms of Service.
Note that when using this shortcode, there should be no other text entered into the dialog box other than the shortcode.
user list
[wpmem_ul]
The user-list 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.
[wpmem_ul 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.)