Skip to content

Instantly share code, notes, and snippets.

@jgalea
Created July 12, 2013 09:20
Show Gist options
  • Save jgalea/5983072 to your computer and use it in GitHub Desktop.
Save jgalea/5983072 to your computer and use it in GitHub Desktop.
Check if current user has a particular capability.
<?php
if ( current_user_can( 'moderate_comments' ) ) {
echo 'The current user can moderate comments';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment