Login Form shortcode

The shortcode Login Form allows you to add WooCommerce login form into the page, which will be visible to all unlogged users.

Just type this in any page where you want it to appear:

[loginform]

Protect Media shortcode

The shortcode “Protected media” prints protected media link. Please note: media should be set as protected before printing the link.
Shortcode attributes are:

  • “id”: ID of the protected media
  • “content”: Linked text

Example: [protected_media id=123]content[/protected_media]

Membership Items shortcode

The shortcode “Membership Level Items” allows you to show a complete list of all elements associated to a specific membership plan. This list is visible only to users who have subscribed that plan. Go to “Membership > Membership Plans” to copy the shortcode related to the plan you want to show.

You can use the attribute “plan” to set the ID of the membership plan.

“Example:” [membership_items plan=237]

membership items shortcode

Product Download Links shortcode

The shortcode Product Download Links prints product download links.
Shortcode attributes are:

  • id: product ID. If not specified, it prints current product download links
  • class: the css class of download links
  • content: linked text. If it is not set, the linked text will be the name of the file set in product

Example: [membership_download_product_links id=111 class=”button button-test”]DOWNLOAD[/membership_download_product_links]

Membership History shortcode

The “Membership history” shortcode lets you show users the list of all memberships they are following.
The attributes of the shortcode are:

  • title: title you want to show ahead of the content of the shortcode
  • type: this attribute lets you filter the list of the membership displayed when you are also using the YITH WooCommerce Subscription plugin.
    type = “membership” this lets you show all memberships with no subscription plan of the users.
    type = “subscription” this lets you show all memberships with a subscription plan of the users.

An example of a shortcode: [membership_history id=”123″ title=”Shortcode Title” type=”membership”]

Please, note, to make sure all contents are visible here, you must have enabled it from Membership plans > [Your plan] > Show contents in membership details:

Show contents in membership details

Membership Protected Files shortcode

This shortcode allows you to handle displaying links within a specific page, post or product in your website.
Its goal is to display the files only to users who own a specific membership plan.
Enable the Membership Protected Files from the Membership options metabox in the edit page of any post, page or product of your website.
Paste a link or load a file right from this page and choose the membership plan it will be visible to.

Protected files

Now you can enter the[membership_protected_links] shortcode within the content and users will be automatically displayed the links related to the membership plan they own.

Protected files

 

Shortcode attributes

  • post_id: the ID of the post, the page or the product that contains the protected links. If not set, it uses global post ID
  • link_class: The CSS class of download links

Membership Protected Content shortcode

The “Membership Protected Content” shortcode can be selected from within posts, pages and products.
It allows you to set up different content for the same “post” (page or product)of each different membership plan: the system will automatically select the content to display to each customer, according to the type of membership they own.

Every content added within the shortcode will only be displayd to customers who own a membership plan.
Example: [membership_protected_content]

Setting the ID of the membership plan as a shortcode attribute, the content within the shortcode will be visible only by the users associated with relative plan.

To find the plan ID, go to “Memberships”.

The attribute “user” defines the type of user that can view the content. Possible values are: member, non-member, guest, logged.
Default: member.

Examples

Selective content - examples

Example 1:

[membership_protected_content plan_id="123"] This content is only visible to members of plan 123 [/membership_protected_content]

Selective content

Example 2

Suppose you want to show the content to all non-members except for those who have the plan with id=”123″, you may want to compose the shortcode as follows:

[membership_protected_content plan_id="123" user="non-member"] All users except for those with the 123 plan will see this content. [/membership_protected_content]

Selective content - example 2

Members-only content starts here

The plugin gives you the possibility to insert a divider line in your posts so you can hide the content of the post partially, namely everything that is AFTER the divider.

This way members will see the whole content, whereas non-members will only see the first part.

You can find it both as a Gutenberg and Elementor widget and as a simple shortcode.

Gutenberg and Elementor widget

Just type Members-only content start to make it show up in Gutenberg or Elementor editor.

After the divider the plugin will automatically show the default alternative content (if set).

Continue reading?

Please, note that this widget and the related shortcode only works if you have chosen to show an alternative content for non-members from the General options, as explained here.

Yet if you want to hide the alternative content, you can enable the “Hide alternative content” option (if necessary) from the page builder editor:

Add the divider from from Gutenberg widgets
Gutenberg
Add the divider from ElementorGutenberg widgets
Elementor

Shortcode

You can also use it as a simple shortcode:

[yith_wcmbs_members_only_content_start]

Members-only-content shortcode classic

And if you want to hide the alternative content, you can use the attribute hide-alternative-content and set it to ‘yes’, like this:

[yith_wcmbs_members_only_content_start hide-alternative-content='yes']