Login Status Shortcodes

The status shortcode can be used to display content to users based on their login status.

Note that while the status shortcode can be be used to display different content to logged in or logged out users on pages and posts that are not blocked, it cannot be used on pages or posts that are blocked. For a version of this shortcode that can be used on blocked content, see [wpmem_logged_in] and [[wpmem_logged_out]].

Logged in content

The following shortcode shows an example of content that will display to a user that is not logged in.  This can be used on any page, including special pages created with other shortcodes, such as the members settings area or a registration page.

[wp-members status="in"]
this content can only be seen by logged in users.
[/wp-members]

Logged out content

The following shortcode shows an example of content that will display to a user that is not logged in.  This can be used on any page, including special pages created with other shortcodes, such as the members settings area or a registration page.

[wp-members status="out"]
this content displays when a user is not logged in.
[/wp-members]

Subscription content

When used with the premium add-on module WP-Members Subscription Module with PayPal Integration it should first be noted that the logged in/out parameters are unaffected.  For example, if content is wrapped with the status shortcode for logged in status, the content will be viewable to a logged in user regardless of whether their subscription has expired or not.  The reason for this behavior is that some content may be necessary for a user to see when they are logged in, even if they are expired.

For subscription content that should be shown only if a user is logged in AND a current subscription, the status shortcode will accept the “sub” attribute (for “subscription” or “subscribers only”).  This attribute can also accept a second optional parameter of “msg” to display a message that the content is based on subscription and the user is expired.  The “msg” attribute is a true/false boolean and defaults to false if not set.  A value of true will display the message, false will not.

[wp-members status="sub" msg="true"]This is content for current subscribers only.  If the "msg" parameter is false or omitted, it will simply not display.  If "msg" is true, an expiration message will display in place of the protected content[/wp-members]

Examples

Different contact forms based on login status (premium content)