Skip to main content

If the current user is adminan administrator or editor

How can I check to see if the current logged in-in user is an adminadministrator or an editor?

I know how to do each singularlyindividually:

<?php if( current_user_can('editor')) {  ?> <!--stuff Stuff here for editors --> <?php } ?>   <?php if( current_user_can('administrator')) { ?> <!--stuff Stuff here for adminsadministrators --> <?php } ?> 

But how do I work those in together? IeI.e., the user is adminan administrator or editor?

If current user is admin or editor

How can I check to see if the current logged in user is an admin or an editor?

I know how to do each singularly:

<?php if( current_user_can('editor')) {  ?> <!--stuff here for editors--> <?php } ?> <?php if( current_user_can('administrator')) { ?> <!--stuff here for admins--> <?php } ?> 

But how do I work those in together? Ie. user is admin or editor?

If the current user is an administrator or editor

How can I check to see if the current logged-in user is an administrator or an editor?

I know how to do each individually:

<?php if(current_user_can('editor')) { ?> <!-- Stuff here for editors --> <?php } ?>   <?php if(current_user_can('administrator')) { ?> <!-- Stuff here for administrators --> <?php } ?> 

But how do I work those in together? I.e., the user is an administrator or editor?

How can I check to see if the current logged in user is an admin or an editor?

I know how to do each singularly:

 <?php if( current_user_can('editor')) { ?> <!--stuff here for editors--> <?php } ?>  <?php if( current_user_can('administrator')) { ?> <!--stuff here for admins--> <?php } ?> 

But how do I work those in together? Ie. user is admin or editor?

How can I check to see if the current logged in user is an admin or an editor?

I know how to do each singularly

 <?php if( current_user_can('editor')) { ?> stuff here for editors <?php } ?>  <?php if( current_user_can('administrator') { ?> stuff here for admins <?php } ?> 

But how do I work those in together? Ie. user is admin or editor?

How can I check to see if the current logged in user is an admin or an editor?

I know how to do each singularly:

<?php if( current_user_can('editor')) { ?> <!--stuff here for editors--> <?php } ?> <?php if( current_user_can('administrator')) { ?> <!--stuff here for admins--> <?php } ?> 

But how do I work those in together? Ie. user is admin or editor?

Tweeted twitter.com/#!/StackWordPress/status/428928687170666497
Source Link
andy
  • 2.4k
  • 8
  • 25
  • 34

If current user is admin or editor

How can I check to see if the current logged in user is an admin or an editor?

I know how to do each singularly

 <?php if( current_user_can('editor')) { ?> stuff here for editors <?php } ?> <?php if( current_user_can('administrator') { ?> stuff here for admins <?php } ?> 

But how do I work those in together? Ie. user is admin or editor?