Hot answers tagged

1

Your problem is that current_user_can() takes a capability not a user role. So, to check for an administrator, for example, you might use: if ( current_user_can( 'manage_options' ) ) { ... } because ordinarily only admins can manage options. You'd have to tie your custom user roles to capabilities that correspond to their roles, which are defined for ...



Only top voted, non community-wiki answers of a minimum length are eligible