Mike Waller
asked on
changing role using s2member conditional shortcode
I'm trying to use the following conditional inside a page but it seems the php code is still being executed inside the shortcode when admin hits the page:
[s2If current_user_is_not(admini strator)]
[s2If current_user_is(s2member_l evel0)]
<?php $user = new WP_User(wp_get_current_use r()->ID);
$user->set_role("s2member_ level1"); ?>
[/s2If]
[/s2If]
does it look correct? I do have php execution plugin installed on the server.
If admin hits the page and that code executes, then admin role gets downgraded to level 1 which is not what I want.
Any suggestions?
[s2If current_user_is_not(admini
[s2If current_user_is(s2member_l
<?php $user = new WP_User(wp_get_current_use
$user->set_role("s2member_
[/s2If]
[/s2If]
does it look correct? I do have php execution plugin installed on the server.
If admin hits the page and that code executes, then admin role gets downgraded to level 1 which is not what I want.
Any suggestions?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
ASKER