Skip to content

Instantly share code, notes, and snippets.

@thoronas
Created May 31, 2015 20:38
Show Gist options
  • Save thoronas/3dbeb74d64193e039eab to your computer and use it in GitHub Desktop.
Save thoronas/3dbeb74d64193e039eab to your computer and use it in GitHub Desktop.
WordPress: Run code only if user is logged in and an editor or admin
<?php
if( current_user_can('edit_others_pages') ) {
// do something
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment