The [groups_logout]
shortcode renders a link for users to log out.
This shortcode allows the use of the following attribute:
redirect
defaults to the current URL and will redirect to the given page after logout.
Example A:
Here is an example that will remind members to log in before they can access the content, or offer others to create a new account.
- Create a page without restrictions as the main page for your members.
- Create another page without restrictions to redirect after logout, for example: http://www.example.com/here
- Place these shortcodes on a page:
[groups_non_member group="Registered"]
<h2>Please log in</h2>
Please log in to access the content.
[groups_login]
[/groups_non_member]
[groups_member group="Registered"]
<h2>Content:</h2>
You can read this content because you're logged in.
[groups_logout]
[/groups_member]
Example B:
Using the redirect
attribute to redirect to a specific page after logout:
[groups_logout redirect="http://www.example.com/here"]