Skip to content

Instantly share code, notes, and snippets.

@petenelson
Last active July 14, 2016 23:21
Show Gist options
  • Save petenelson/4244af7d2bcf752f3a4802aca1f88425 to your computer and use it in GitHub Desktop.
Save petenelson/4244af7d2bcf752f3a4802aca1f88425 to your computer and use it in GitHub Desktop.
WordPress: notes on custom capabilities
  • Use $role->add_cap() to give a cap to a role, or use add_role() to create a new role with capabilities (ex: delete_specific_page).
  • Use the map_meta_cap filter to update the $caps array passed with the custom capability if the user is allowed to do the requested action.
  • Access can be revoked by using the do_not_allow capabilitiy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment