Shortcodes

Shortcodes List

Paid Member Subscriptions comes with a list of shortcodes that you can use right away:

  • [pms-register] – generates a form for users to subscribe to your membership plans
  • [pms-account] – generates a form for users to manage their information and plans
  • [pms-login] – generates a login form
  • [pms-restrict] – restricts content inside a post or page so you can have content that’s protected and content that’s not protected in the same page
  • [pms-recover-password] – generates a form for password reset
  • [pms-subscriptions] – generates a form which lists the subscription plans
  • [pms-payment-history] – adds a front-end table with the member’s payment history

Member Registration form

1
[pms-register]

Parameters

  • subscription_plans – a comma separated list plan ID’s to list only certain subscription plans, or “none” to allow users to register without becoming members (not list any subscriptions).
    If this attribute is not set, all active subscription plans will be returned
  • plans_position – where to display the subscription plans in relation to the register fields needed. Can have the values “bottom” or “top”. Defaults to bottom.
  • selected – the id of the subscription plan that should be selected by default when we show the form. Defaults to no plan being selected by default.

Usage

1
[pms-register subscription_plans="17,18,19" plans_position="top" selected="17"]

The above shortcode, will create a register form that will list the membership plans gold, silver and bronze and position them above the rest of the information in the form like username, email, etc. By default the gold plan (with the ID 17) is selected.

pms_register

Member Account form

1
[pms-account]

Parameters

  • login_url – adds a link to the login page to the message displayed when member is not logged in and can’t access his account information.
  • show_edit_profile=”no” – shows only the subscriptions and removes the fields from the form.

account_login

Usage

The account shortcode, will allow your members to view, upgrade and renew their subscription, as well as modify their information like email, first name, last name and password on the site.

pms_account

Login Form

1
[pms-login]

Parameters

  • redirect_url – will redirect the user to a url of your choosing after a successful login
  • register_url – adds a link to the register page of your site
  • lostpassword_url – adds a link to the lost password page of your site

Usage

1
[pms-login register_url="http://testserver29.com/paidmembersubscriptions/register/" lostpassword_url="http://testserver29.com/paidmembersubscriptions/lost-password/" redirect_url="http://testserver29.com/paidmembersubscriptions/account/"]

The login form allows your users to login from the front-end of WordPress, instead of the default WordPress login form.

Restrict Content

1
[pms-restrict] Protect this content [/pms-restrict]

Parameters

  • subscription_plans – list of subscription plan ID’s separated by comma. If it is not present, we only check if the user is logged in or not.
  • display_to – can take the value of “not_logged_in” to display the content only to logged out users
  • message – adds a custom message to users who don’t have access to this content

Usage

1
2
3
[pms-restrict message="Please login to view the rest of the content." subscription_plans="17"]
Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my blog. I live in Los Angeles, have a great dog named Jack, and I like piña coladas. (And gettin' caught in the rain.)
[/pms-restrict]

Note: A user with administrator privileges will override all content restrictions.

Recover Password

1
[pms-recover-password]

A simple password recover form for your users that can be used in the front-end of the site so you don’t have to use the default WordPress recover password page.

Parameters

  • redirect_url – will redirect the user to a url of your choosing (e.g. Login page) after a successful password recovery

List of Subscription Plans

1
[pms-subscriptions]

Parameters

  • subscription_plans – a comma separated list plan ID’s to list only certain subscription plans. If this attribute is not set, all active subscription plans will be returned.

Usage

1
[pms-subscriptions subscription_plans="17,18,19"]

The above shortcode, will create a form which lists the subscription plans for registered users that didn’t apply to any of the plans when they registered.

pms_list_of_subscription_plans

Payment History

1
[pms-payment-history]

Parameters

  • number_per_page – set the number of payments that will be displayed inside the table.

Usage

1
[pms-payment-history number_per_page="5"]

The above shortcode, will create a Payment History table that will list all the Payments done by the user including the ID, Amount, Date/Time and Status. If no payments were made by the user then the “No payments found” notification will be displayed.

Paid Member Subscriptions - Payment History

Logout Link

1
[pms-logout]

Parameters

  • text – modify the message that is shown to the logged in user.
  • link_text – modify the text that the link is displayed on.
  • redirect_url – an url where the user should be redirected after the logout has happened. If this is not set, the user will be redirected to the current page.

Usage

1
[pms-logout text="Click the following link to logout !" link_text="This one !" redirect_url="http://example.com/logout_redirect_page"]