0

This is my first plugin using roles and capabilities. How can I give the "subscriber" users access to my plugin in the WP admin, or make a menu for just subscribers?

0

You can wrap the parts you want a subscriber to see by wrapping the code with:

if ( current_user_can( 'read' ) ){
    // the code you want the subscriber to see
}

You can checkout the role and capabilities here https://codex.wordpress.org/Roles_and_Capabilities#Subscriber

1
  • Super, but i fixed changing the manage_options to "read", and after that some logic to show/hide things. Thanks! – Asinox Oct 2 '15 at 3:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.