Skip to content

Instantly share code, notes, and snippets.

@ingozoell
Created July 5, 2017 11:38
Show Gist options
  • Save ingozoell/911d7f14bf191f9df4bf9b4a050395fe to your computer and use it in GitHub Desktop.
Save ingozoell/911d7f14bf191f9df4bf9b4a050395fe to your computer and use it in GitHub Desktop.
$user = wp_get_current_user();
$allowed_roles = array('editor', 'administrator', 'author');
<?php if( array_intersect($allowed_roles, $user->roles ) ) { ?>
//stuff here for allowed roles
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment