Community Support Forums — WordPress® ( Users Helping Users ) — 2011-09-08T02:01:19-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=14908 2011-09-08T02:01:19-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14908&p=34270#p34270 <![CDATA[Re: add administrative custom capability]]>
Your approach may work, I had not thought about it. You could also try giving those special members a higher level than the others and edit the capabilities that role has.

https://codex.wordpress.org/Roles_and_C ... pabilities
https://wordpress.org/extend/plugins/user-role-editor/

Statistics: Posted by Cristián Lávaque — September 8th, 2011, 2:01 am


]]>
2011-09-07T14:46:55-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14908&p=34239#p34239 <![CDATA[add administrative custom capability]]>
I've set up a site for our club. We're using s2member to collect club dues, so the fees are not specifically for website access though that is one of the benefits of club membership. What this means though, is that a few club members need to have limited administrative access to the website. For example our Membership Co-ordinator needs to have read/write access to the Users section.

I have s2member set to block access to wp-admin. I had thought to override that with custom capabilities. I tried:

Code:
add_action("template_redirect", "ASH_s2ccap",11);
function ASH_s2ccap() {
   if(is_admin() && !current_user_can("access_s2member_ccap_admin")){
      header("Location: ". S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
      exit();
   }
}


in my theme's functions.php file but it had no effect. I have a feeling I need to do something more like:

Code:
function ASH_s2ccap() {
   if(is_admin() && current_user_can("access_s2member_ccap_admin")){
      //prevent usual forward from happening
   }
}



How can I allow selective access to the Dashboard and make the Admin Bar visible for certain users while still leaving "Member Profile Modifications"=yes?

Thanks,
Jen

Statistics: Posted by halifaxious — September 7th, 2011, 2:46 pm


]]>