latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Content Hidden to Admin w/ Conditionals

Home Forums Community Forum Content Hidden to Admin w/ Conditionals

Tagged: 

This topic contains 4 replies, has 3 voices. Last updated by  Jason (Lead Developer) 3 years, 12 months ago.

Topic Author Topic
Posted: Friday Jan 4th, 2013 at 6:22 pm #36190

Hi All!

When an admin is logged in, should they be able to see all the restricted content on the welcome page?

On our site, the admin can not see the content on the welcome page. Is this right? It seems liket hat is not the expected behavior but I could be wrong/

Screen of settings: http://cloud.tunas.co/image/0K0E3A052F0d

Mike

List Of Topic Replies

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Saturday Jan 5th, 2013 at 2:38 pm #36308
Eduan
Username: Eduan
Moderator

Hello Halle,

Yes they should be able to see all the content in all the pages, no matter what they’re restricted to/for.

Although, I’m not sure, but I think that if you restrict a content specifically for a certain level () it will not show up for the admin user.

Does removing that shortcode from that page solve the problem?

– Eduan

Posted: Saturday Jan 5th, 2013 at 2:49 pm #36310

Hi Eduan!

You inspired me. So when writing the welcome page you need to include an OR in your conditional for the admin to see it.

Example: [s2If current_user_is(s2member_level0) OR current_user_is(administrator)]

lets close this ticket out! :)

Posted: Monday Jan 7th, 2013 at 7:40 pm #36501
Eduan
Username: Eduan
Moderator

Excellent! Glad you found the solution. :)

I will now close this topic. :)

Posted: Saturday Jan 12th, 2013 at 3:26 am #37089
Staff Member

Thanks for the heads up on this thread :-)

I just wanted to clarify something here…

You inspired me. So when writing the welcome page you need to include an OR in your conditional for the admin to see it.

Example: [s2If current_user_is(s2member_level0) OR current_user_is(administrator)]

This is correct, and it IS required in this case. Simply because the conditional that you’re using is NOT testing for Capabilities, it’s testing for a specific Role. In a case such as this, you WILL (as you’ve already done) need your conditional to consider an Administrator role as well. Or, perhaps better, would be to test for Administrative-like Capabilities so you’re covering Editors, Authors, Contributors as well.

[s2If current_user_is(s2member_level0) OR current_user_can(edit_posts)]

Again, this additional consideration for Administrative Users is only necessary when you’re testing for a specific Role using current_user_is(). If you’re testing with current_user_can(), it’s NOT necessary, because an Administrator CAN do anything a User/Member can, and then some, of course.

Viewing 4 replies - 1 through 4 (of 4 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.