Shortcodes are available directly in the post editor window from the item in the toolbar menu indicated by two shortcode brackets: [ ]
This shortcode can display various WP-Members forms by adding the following tags:
- login – the main body login form
- register – the registration form
- password – forgot password and password reset (dependent upon user login state)
- user_edit – user profile edit
For example, to display a login form, the shortcode would be as follows:
[wpmem_form login /]
The login and register forms both have a default logged in state that displays some bullet links just like their [ wp-members page=] counterparts. These links can be edited with the wpmem_login_links and wpmem_register_links filters, but in the [wpmem_form /] shortcode, you can completely override the default logged in state with your own content by nesting it in the shortcode as follows:
This only displays to a logged in user.
You are logged in as: [wpmem_field field=username]
Anything nested in between the [wpmem_form] tags will be what shows to the logged in user.
Both the login and register forms also accept a redirect_to parameter. This allows you to manually set a page that the form will redirect to upon successful submission. (Note that this can also be done with the wpmem_login_redirect and wpmem_register_redirect filters.) Here is an example of a login form that will redirect the user to a specific page after successfully logging in:
[wpmem_form login redirect_to="http://mysite.com/my-special-page" /]
Note that the user profile edit parameter, just like the [wp-members page="user-edit"] shortcode, should only be displayed to users who are logged in. You can do this by nesting it in the logged in shortcode. Here is an example:
Log in to edit your profile[wpmem_form login]