• Resolved SoMajor

    (@somajor)


    My first time working with a Membership Plugin and I came across the paid membership Pro. Works good for some pages but some pages, which are being created by plugins aren’t being restricted. Even though I chose the membership level on the “New Page” area. Is there any shortcode to restrict parts of the page that I want to restrict. Also on other pages, it blocks the content, but not the featured image. Any ideas how to fix this.

    https://www.ads-software.com/extend/plugins/paid-memberships-pro/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Jason Coleman

    (@strangerstudios)

    There is one shortcode for restricting access to content. Here is an example or three:

    [membership level=”1″]Will only show up for level 1 users[/membership]

    [membership level=”-1″]Will show up anyone not in level 1, including non-members[/membership]

    [membership level=”0″]Will show up for non-members.[/membership]

    In php, you can use the function pmpro_hasMembershipLevel() to check if someone is a member. Pass it a level id, name, or array of such.

    Thread Starter SoMajor

    (@somajor)

    The shortcodes work, with one difference. It does not display the text: “This content is for Test Level members only. Register here.” . And when I hide some content, it does not hide things like the featured images.

    So I went in and created an if statement using the function. Again, that works, so I’ll try that and just copy that text above about the restriction list, with link into the else statement.

    Plugin Author Jason Coleman

    (@strangerstudios)

    The plugin will only restrict things within the post body… so technically anything echo’d out through the the_content() or the_excerpt() functions.

    If your theme automatically shows a featured image or includes content in the header, sidebar, or whereever, you’ll have to tweak your theme to hide things via the pmpro_hasMembershipLevel() functions.

    Sounds like you’ve figured it out.

    Hey there,

    Ok expanding upon the question above if I can…

    I am trying to hide the prices and add to cart button in our store for non paid members. We have two stores one for members and one for non members. Using this plugin (Paid Membership Pro) for those who are not members. The three memberships are
    Affiliate Membership 1
    Affiliate Membership 2
    Affiliate Free Sign Up

    As long as they are a member of one of them I want the price to be displayed… is there a php code that can do this? I know in the past I have use this for if you are logged in but it doesn’t stop people who are logged in but their membership has expired…

    <?php if (is_user_logged_in() ) { //only logged in user can see this ?>

    CONTENT HERE

    <?php } ?>

    Is there something similar I can wrap around that information I want hidden so it hides it for non members or expired members?

    I really appreciate your input and expertise. Thanks, Chris

    Ok in playing around I have figured out the following…

    Affiliate Membership 1 = Membership level 1
    Affiliate Membership 2 = Membership level 2
    Affiliate Free Sign Up = Membership level 3

    I also have narrowed the php code down to this so far based on the previous posts…

    <?php if (pmpro_hasMembershipLevel(3) ) { //only members can see this ?>
    TEST
    <?php } ?>

    But that makes me set it to one membership or another. The goal is to see the price so if you have ANY MEMBERSHIP or at least one of those three I listed you can see it. Just need a little guidance on further tweaking this code. Please.

    Plugin Author Jason Coleman

    (@strangerstudios)

    If you don’t pass a parameter to that function, it will test for ANY membership level. So:

    <?php if (pmpro_hasMembershipLevel() ) { //only members can see this ?>
    TEST
    <?php } ?>
    Plugin Author Jason Coleman

    (@strangerstudios)

    resolving (If you have other issues, open a new thread. Thanks)

    Unless I’m missing something, these shortcodes are not mentioned anywhere in the documentation. (Actually, not much of anything is mentioned in the docs, to be frank.)

    We’ve paid for access to the documentation and the support forum, yet I only happened to stumble across this info here – in the public forum. Seems a little odd, given how basic – and essential – the shortcodes are.

    Plugin Author Jason Coleman

    (@strangerstudios)

    Glad you found them. Yes the documentation needs help. It takes time. We have limited resources and give away a really good plugin for free ??

    I’ll be switching my focus from new dev to documentation in the Fall which will help a lot.

    Plugin Author Jason Coleman

    (@strangerstudios)

    FYI, shortcodes info is in the documentation at https://www.paidmembershipspro.com/documentation/content-controls/with-shortcodes/

    Also, that documentation is available with a free account now.

    Closing this thread. Please open a new one if you have a new question.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: Paid Memberships Pro] Shortcode / Documentation to block Restricted content’ is closed to new replies.