Need tech help for shortcode conditionals
-
Hi,
This is in regards to wordpress shortcode conditionals, and content restriction, using the s2If function.
When restricting content to ONLY users who selected a specific custom menu option on the registration page, other than ONLY referencing the entire custom menu field ID (since ALL users are required to make a selection from this custom menu), I also need to reference the specific answer they selected. So that I can make different content show to them, depending on what selection they made. How do I do that?
For example, I created a custom registration field in s2member admin panel, that is a selection menu, where the user can select between TWO different selections (options). So I want to show certain content on their account login page, only to users who selected a SPECIFIC value on this custom menu field.
So I just need to know how to reference that specific selection/value in the “[s2If current_user_is ….” shortcode conditional for wordpress.
In addition to showing only to users who selected a specific option in the custom menu field, I ALSO need to only show this restricted content to level 0 members. Because eventually I will manually change their account to a higher level after approving them. So I don’t want to just show to all members who selected this at registration, but ONLY to members who are BOTH level 0 status, as well as to members who selected a specific menu option. Which means I would of course use the “AND” in the middle of the shortcode to reference BOTH conditions.
I would assume that maybe the “selection” is referenced as “value”, or something simple like that right? And the final shortcode that I need, would look like the following example:
[s2If current_user_is(s2member_level0) AND current_user_is(user_field_value=”the specific selection of the custom menu I’m trying to allow access”)] [/s2If]
Is that right? If not “value” then what would I use instead?
Thanks,
Lori
The topic ‘Need tech help for shortcode conditionals’ is closed to new replies.