If the current user is an administrator or editor

Question

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?

0
, andy 3 years 2020-06-03T15:10:38-05:00 0 Answers 85 views 0

Leave an answer

Browse
Browse