Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

[Resolved] How to combine more than two shortcode commands?

Simple Membership Plugin › Forums › Simple Membership Plugin › How to combine more than two shortcode commands?

  • This topic has 4 replies, 2 voices, and was last updated 1 year, 10 months ago by moyer.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • October 1, 2024 at 7:07 am #28876
    moyer
    Participant

    I want to restrict content to users who are not logged in and to users who are logged in but have a few specific membership levels. How can I do this?
    Here is what I set:

    “[swpm_protected for=“2-12” visible_to=“not_logged_in_users_only” custom_msg=’abc’]
    test content
    [/swpm_protected]”

    Result:
    1. ‘test content’ was visible to not logged in users, but custom_msg did not work.
    2. level-2 (logged in user) and level-12 users should have seen ‘test-content’ but did not when they loggin.

    What is the solution?

    Thanks.

    October 6, 2024 at 11:34 pm #28896
    The Assurer
    Moderator

    You are trying to do this?
    Using a Custom Message for the Non Members
    https://simple-membership-plugin.com/apply-partial-section-protection/#using-a-custom-message-for-the-non-members

    October 11, 2024 at 10:43 am #28913
    moyer
    Participant

    Thank you for kind reply. Unfortunately, it is not. I wrote what i want to combine two or more than two conditions again:

    Currently, i set like these:

    1.
    [swpm_protected for=“2” custom_msg=’this is custom msg’]
    content message
    [adinserter block=”1″]
    [/swpm_protected]

    2.
    [swpm_protected visible_to=“not_logged_in_users_only” custom_msg=’this is custom msg’]
    content message
    [adinserter block=”1″]
    [/swpm_protected]

    However, I hope to combine two into one short codes like this:

    [swpm_protected for=“2” & visible_to=“not_logged_in_users_only” custom_msg=’this is custom msg’]
    content message
    [adinserter block=”1″]
    [/swpm_protected]

    Unfortunately, the combined order what i tried does not work. Could you give me an solution?
    Thanks.

    October 12, 2024 at 2:59 am #28914
    The Assurer
    Moderator

    You cannot combine more than one condition is the same shortcode. SWPM (and WordPress) only allows single condition IF/THEN blocks. This is a hard restriction.

    October 12, 2024 at 10:41 am #28916
    moyer
    Participant

    I see. Thanks!

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Log In

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy