Shortcode

Hello,

In the membership options it has a box to list desired shortcodes (one on each line). You are then able to, through the "Edit Levels" to put "Shortcodes" in the Negative Rules section and check the shortcodes you don't want to appear.

I have, for the life of me, tried to figure out how to get this to work but I can't. Both the Shortcode I created by using the options mentioned above and the shortcode I create by adding to the bp-function.php file show up in the list of shortcodes to check in the Edit Level Negative Rule area.

However, when I sign in as the test account which has the level in question assigned to it, I still see the content of the Shortcode.

I also don't know how to use the Shortcodes you create in the membership options. They just come up as [Shortcode]content[/Shortcode] on the page. I also tried [Shortcode="content"] but that also displays as is.

What I'm trying to do is show ads on the default "Free" membership level throughout the site by way of a Shortcode. But if the person upgrades to the "Paid" membership the Shortcode that I use to display the ads would be hidden using the Negative Shortcode rule in the membership options. Maybe I'm doing everything wrong?

Thank you in advance for any help!

  • DavidM

    Hello IAmDarthMole,

    I just want to make sure I understand this one properly. When you say you're using [Shortcode][/Shortcode] you do mean you are actually specifying your create shortcode within the brackets, correct?

    So that if your shortcode is BLOCKED, your shortcoded text in the post/page reads [BLOCKED][/BLOCKED]?

    If you could let me know this, I'll take a look into a couple other possibilities from there.

    Cheers,
    David

  • IAmDarthMole

    Thanks for your help Dave!

    To answer your question (i hope I understand correctly) I put the word "Members" (minus the quotes) on the first line in the Shortcode box under the Membership Settings options page.

    On the page I put [Members]example text[/Members] in the HTML mode. If I look at the page it displays [Members]example text[/Members] on the page. I'm not sure if i'm doing it wrong.

    I also created a Shortcode by pasting the needed code into the bp-functions.php called "biotext" (again minus the quotes). That shortcode displays the value that I've written in the function. However, the value still shows even though I've checked that particular Shortcode in the negative rules section of the membership level.

    Hope this helps. Thanks!

  • DavidM

    Hello again IAmDarthMole,

    I thought maybe you did have the shortcodes named a particular way and in the posts used [shortcode][/shorcode] to try and protect the content but you definitely have it setup properly.

    Having just tried it on a test setup, I'm having the same result where the bare [member] text is being rendered rather than being parsed as a shortcode. I'm going to alert Barry on this one and see if he can take a look into it.

    And for sake of ease, could you let us know what version of Membership you're currently using?

    Cheers,
    David

  • DavidM

    Hello IAmDarthMole,

    After testing more thoroughly I realize it's actually working but for some reason during my testing it was also displaying the shortcode tags. I'll sort that out later. I was wondering if you've tried setting the shortcodes as a Positive rule rather than a Negative rule? Or more clearly, have you tried the following configuration?

    I'm guessing you probably have the following setup:
    Membership > Edit Options
    Shortcode visibility default: No - Shortcodes are protected by default

    Then in your member settings, set your shortcodes that you want to be visible as a Positive rule.

    I'm guessing you may have already tried that but I just wanted to be a bit more thorough. In any case, as Barry said, screenshots would be great.

    Cheers,
    David

  • IAmDarthMole

    Thank you Barry and DavidM for your help thus far!

    Barry: I tried making the shortcode in all lowercase but it still renders as [members]Test[/members] on the page.

    DavidM: I switched the settings around above as you suggested and it still rendered as [members]Test[/members] and also it didn't hide the [biotext] shortcode in the functions file by default. I switched it back to my previous setup.

    I'll upload the screenshots tonight (I don't have the ability to do so at the moment). Until then though here is a break down of the settings:

    Membership Level:
    Level Title: Free
    Positive Rules: Comments, More Tag, Private Message
    Negative Rules: Shortcode with [biotext] and [member] checked

    Membership Options:
    Stranger Settings: None - No access to content
    User Registration: None on Use Subscription and Enable Incomplete signup accounts is unchecked
    Registration page: None
    Shortcodes: biotext and members on their own line
    *biotext was also manually added to the bp-functions.php

    Shortcode visibility default: Yes - shortcodes are visible by default
    No access message is blank

    Everything else is default and/or blank

    Hope this all helps! Thank you!

  • IAmDarthMole

    Thank you very much once again for your help. Is there somewhere else that I need to adjust the settings for shortcodes to work on my wordpress installation in general?

    I mean I'm not sure if I need to adjust rights or anything... I had to add the biotext shortcode function script to the bp-functions.php but I didn't notice the members one anywhere in the same file. Does it create/write it somewhere else? Is the fact I didn't see it the problem? I'm not sure if the problem that it wouldn't hide the biotext shortcode is related or a different problem.

    If you need anything else from me please let me know!

  • DavidM

    My apologies everyone! I'm working through some possible configurations to see why that might be occurring but it does take time to setup such scenarios. I'll see if I can alert Barry once again to see if he's made any progress as well.

    @idevguy, are you having exactly the same trouble? Where the negative rules are not working in some instances? Or are the rules not working at all for you?

    Cheers,
    David

  • IAmDarthMole

    Hello!

    I'm not sure if you mean the WP roles or the Membership roles.

    http://www.ciwe.net/test3 is the link to my test site/installation.

    For my testing I had the shortcode appear for non-members but then they should disappear for the first membership level I created.

    In addition to the shortcodes not disappearing or appearing as intended they also aren't rendering. Per my screen shots above I add a [members] shortcode.

    But on the "Full Width" page when I put [members]Test[/members] it renders as [members]Test[/members].

    Thank you!

  • IAmDarthMole

    Hello everyone! :slight_smile:

    I just wanted to check in to see if the below bug had been beaten into submission yet? I was really excited about the membership plugin and the social theme for my site (hence why I was convinced to buy the membership :smiley:) but I can't roll out the updated version until this shortcode issue is put into it's place. Thanks again for all of your help thus far and please let me know if you need anything additional from me. Thanks!

  • eRev

    I'm having the "same" problem[s]. I will describe one problem in this comment.

    My main user, "admin" (with a Role of Administrator of course) shows the shortcode tags.

    For example: [shortcode]content[/shortcode]

    This is confusing, however, perhaps as designed, because if you...

    Be sure to test your Membership Level conditional content with any user(s) other than the default admin user, it should show content without shortcode tags. My test user does NOT show shortcode tags with the Role of Subsciber or Administrator (this is a good thing).

    I hope these details help track down the problem, and perhaps help users create a working solution.

  • eRev

    My test user was not working properly with shortcodes in Negative Rules either. However, after many tests it's working, and I'll have to figure out how to break it again. :p

    (For my following description, navigate to "Membership -> Edit Levels" and edit a membership level. Then drag Shortcodes to the "Negative rules" box.)

    I've targeted the [select all] checkbox next to "Shortcode tag" as a possible suspect, since I think things started functioning properly AFTER I selected all Shortcode tags (via the single select all checkbox) and saved (clicked Update button).

    I then deselected all Shortcodes and selected only one shortcode (guestcontent) and clicked save. To my surprise, everything still worked properly!

    I will outline my close-to-exact scenario in a separate comment.

    :smiley:

  • IAmDarthMole

    Hello erevinc!

    Thanks for the information! Unfortunately I can't replicate what you are experiencing.

    Whether I am logged in as the test account that has the role to remove the shortcode, logged in as the test account that has the role to display the shortcode still renders as [shortcode]content[/shortcode].

    The same results occur when I set the "stranger" setting to either Membership Level used for testing. It simply renders [shortcode]content[/shortcode]

    I did the test on both the previous installation of Membership as well as the beta.

    Erevinc, what wordpress/membership/theme are you using if you don't mind me asking?

    Also, as a general question, do I need to be using Subscriptions or setting something else up in addition to the Membership levels for the shortcodes to activate?

    Thanks!

  • eRev

    Please forgive me for not posting my close-to-exact scenario. For simplicity, I'll come back to that if needed.

    I've found more good information on this issue...

    This is BAD, and causes to break.

    "Break" means it outputs [membercontent]content[/membercontent] when it should not have.

    [guestcontent]content[/guestcontent][membercontent]content[/membercontent]

    This will fix the issue.

    You have to have a space or newline between the square brackets like this.

    [guestcontent]content[/guestcontent]ANY_CHARACTER[membercontent]content[/membercontent]

  • eRev

    @DavidM, I think my failed scenario was only that I was testing using my admin user (user ID: 1, and Administrator Role). I've tested this and confirmed that all content, including [shortcode] tags appear for my admin user.

    My close-to-exact success scenario may be of help.

    Objective: As part of a WordPress Membership site, I want to show content to Strangers that I don't want to show to my Free Members, and vise-versa. I have accomplished this through the following settings.

    (For the following settings, navigate to "Membership -> Edit Levels")

    I have two Membership Levels: Guest & Free Member, and confirmed both are "Active"

    (For the following settings, navigate to "Membership -> Edit Options")

    Under "Stranger settings" I've set "Use membership level" to use "Guest"

    Under "Shortcode protected content" I have two shortcodes assigned as follows:

    guestcontent
    membercontent

    ...and I've set "Shortcode visibility default:" to "Yes - Shortcodes are visible by default"

    (For the following settings, navigate to "Membership -> Edit Levels")

    Edit your Stranger ("Guest", in my case) membership level. Add "Shortcodes" to the "Negative rules" box, and select [membercontent]. - Click Update.

    Edit your membership level (in my case "Free Member"). Add "Shortcodes" to the "Negative rules" box, and select [guestcontent]. - Click Update.

    (For the following settings, navigate to "Pages" and edit a most basic page.)

    I suggest removing all other shortcodes from this page for now, after a couple paragraphs, add the following:

    [guestcontent]Welcome guest.[/guestcontent] [membercontent]Welcome member.[/membercontent]

    IMPORTANT! make sure there is a space (or any character) between your shortcodes like this [shortcode]ANY_CHARACTER[shortcode]

    Click "Update" to save the page.

    Other Notes:

    I have one subscription named "Free Membership", which is active, and uses the "Free Member" membership level.

    I have 5 users, including "admin" (who's user ID is 1) all of which are active and have the "Free Membership" subscription, and "Free Member" membership level.

    Verify that all test users are subscribed to the correct Subscription and Membership Level by viewing those details on "Membership -> Edit Members" and that they do not have both subscriptions, or both membership levels. In my sign-up process, for some reason many users got assigned multiple subscriptions/levels. (This may be another probable suspect.)

    Versions: WordPress 3.1, Membership Premium version 1.0.5, and BuddyPress 1.2.8

    Hope this helps.

    :smiley:

  • eRev

    I've confirmed that reversing the logic for the setting "Shortcode visibility default: No - Shortcodes are protected by default" does work, however, ALL shortcodes will be protected by default. So I imagine in most cases one would want to use "Yes - Shortcodes are visible by default".

    But just in case you need to try it out, be sure to reverse the logic in both places as follows:

    First, set "Shortcode visibility default" to "Yes - Shortcodes are visible by default"

    Second, for your Guest membership level, remove shortcodes from "Negative rules" and then drag shortcodes to positive rules. Select [guestcontent] and be sure all others are unchecked.

    Note: Again, be sure the "Guest" level is selected under "Membership -> Edit Options", "Stranger settings"

    Third, edit your Member membership level, remove shortcodes from "Negative rules" and then drag shortcodes to positive rules. Select [membercontent] and be sure all others are unchecked.

    These notes assume you're modifying the scenario from my last comment.

  • IAmDarthMole

    I have deactivated all add-ons save for buddypress and membership. I'm still running everything (theme versions, etc) the same as before. I followed all of the above steps suggested by eRev (thank you again btw for all of your feedback!), even went back and did them in the same order and still it is not responding. I don't know if I'm missing something simple (eRev I'm assuming your site is working as intended?) such as a setting or if this is a global issue?

    ciwe.net/test3 is the address (there is also ciwe.net/test4 which is running the beta Membership plug in).

    What is confusing me is if this is an isolated issue to just me or if it is a bug. Thanks!

  • eRev

    RE: @DavidM

    Have you found that doing these things in that particular order has that particular effect? I mean, has it actually worked out that the ordering of those events work out consistently in that way?

    I've found this to be consistent. I'll be running more real-project scenarios soon (possibly today, but probably going into next week) and will provide more feedback on what I find.

    RE: @IAmDarthMole

    ciwe.net/test3 is the address (there is also ciwe.net/test4 which is running the beta Membership plug in).

    What is confusing me is if this is an isolated issue to just me or if it is a bug.

    Can you provide a test login? And can you provide a screenshot of the WordPress Users page and "Membership -> Edit Members" page? The Edit Levels and Edit Options pages may also be useful here.

    I'd be happy to help track down your unique issue if you want to contact me using the Google Voice "Call Me" widget at imdoer.com

  • IAmDarthMole

    It is just a test site so here is the log in information.

    I hope I'm not breaking any posting rules by doing so. If I do please let me know and I apologize in advance.

    admin
    admin2011

    test1
    test1

    test2
    test2

    That's for test3 - We'll see how that goes.

    I thank everyone once again for their help. I feel rather ridiculous if this is a situation unique to me and I have a feeling this is going to be a id10t error on my part when this is all said and done lol.

  • eRev

    @IAmDarthMole,

    Please see the Membership dashboard.

    "The membership plugin version 1.0.5 is Disabled"

    Click "Disabled" and it will change to "Enabled"

    I thank everyone once again for their help. I feel rather ridiculous if this is a situation unique to me and I have a feeling this is going to be a id10t error on my part when this is all said and done lol.

    I only logged in and when I saw this assume that's your problem. Don't feel ridiculous. Hopefully this is something we can learn from. Please let us know if this solves your problem.

    @DavidM,
    Highlighting "Disabled" in red will help avoid this error. I've seen this on other plugins and think it's important since it's reverse logic (clicking disabled to enable), and we're dealing with a multiplicity of settings here.

    :smiley:

  • IAmDarthMole

    Ok, still in astonished shock but I just wanted to add a quick suggestion:

    This is honestly the first plug-in that I have had to turn on twice. Generally once you activate the plugin to see the options it is "on" - I can understand and certainly appreciate the idea of activating the plugin to be able to do the settings without actually having it present to the members. With that said perhaps a sentence can be added to the description along the lines of "To activate the plugin when settings have been configured go to the Membership Dashboard." Or something to that effect.

    Again, thank you to everyone who helped and definitely to eRev for finding the solution! I threw some rep your way, hope I did it right. Thanks for your non-stop support DavidM! Sorry it turned out to be a user issue rather than an actual bug.

  • DavidM

    Hello IAmDarthMole,

    It really had to be the most simple thing! Don't think I won't remember this one! :slight_smile:

    I thought for sure we had that one covered. But I should say, it's actually a great feature because you can potentially disable the plugin for testing purposes without actually deactivating it. While I can't recall right now why that is so tremendously useful, I do recall that it is!

    @eRev Many thanks for your continued prying on the matter. I did think we had everything covered but you got the one hidden item we needed. I added some rep points to your profile as well. They'll be quite handy soon enough, so rumor tells! :slight_smile:

    Cheers,
    David

  • eRev

    This refers to the Disable / Enable setting. @DavidM says,

    ...it's actually a great feature because you can potentially disable the plugin for testing purposes without actually deactivating it. While I can't recall right now why that is so tremendously useful, I do recall that it is!

    This is currently a very important feature because if it was to be "Enabled" upon "Activation" it would block all content from Strangers, and allow all content to the logged in user (I think). At a minimum, the "Stranger settings" have to be setup before enabling.

    This is all outlined here...

    Installation Documentation: https://premium.wpmudev.org/project/membership/installation/

    I thought this was already mentioned here, but it must have been in another thread. Sorry. :slight_frown: Following it is a bit difficult the first two times, so it would be VERY helpful to new users if someone would take on rewriting this documentation. Or better, consider how to minimize the need for documentation.

  • DavidM

    Hey eRev,

    Thanks for pointing out the "Enabled" setting concern as I couldn't recall why I thought it was such a great feature. But you brought that right to memory!

    Regarding the documentation, I rather thought it was clear and concise, myself. My thought is that the real difficulty is that there's just a lot of it, because this is a big plugin! I'll take a look into that matter though.

    Cheers,
    David

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.