Roles & Capabilities in WordPress

Working with WordPress Roles & Capabilities for managing User Accounts and their access.

We don’t actually provide documentation for Roles & Capabilities and programming around Roles & Capabilities because that’s handled quite well by WordPress and their Codex article on Roles & Capabilities. We’d have to constantly be updating our documentation to handle changes from WP.

What we do provide is the ability to either set your Custom Post Type to use standard capabilities provided by posts or pages or to set a Custom Capability. You set these options under Advanced Options, User Capabilities. The options you can select from this option are Post, Page or Custom Capabilities. (Mirroring the post or page default capabilities or configuring Custom for your post type.

Edit User Capabilities

The Capabilities that you get by default are:

  • edit_{capability}
  • read_{capability}
  • delete_{capability}

If you also activate Additional Capabilities you get:

  • delete_{capability}s
  • delete_private_{capability}s
  • delete_published_{capability}s
  • delete_others_{capability}s
  • edit_private_{capability}s
  • edit_published_{capability}s

Configuring Custom Capabilities

You can also set Custom Capability which sets the ‘slug’ for the capability above to your post_type by default (and I really wouldn’t change it to anything else) in the Custom User Capability input.

Configuring Custom Capability

If you set for post or page, all of the edit_ delete_ etc. will be edit_post, delete_post or edit_page, delete_page and they’ll be set specifically for this post type to use *those* capabilities. If you set a Custom Capability, it will be:
edit_garage, delete_garage
or edit_car or delete_car

Note: If you set Custom Capabilities, you will need to explicitly set those capabilities to the Admin role or the admin won’t even have access to the post type; you have to perform this step in whatever you’re using to manage Roles & Capabilities for your WordPress installation.

We highly recommend the Members Plugin by Justin Tadlocke, along with the readme file included in the plugin for an extremely robust article on working with Roles & Capabilities in WordPress.

For more advanced testing (and also managing) Roles & Capabilities we recommend the View Admin As Plugin by Jory Hogeveen.

That’s pretty much all we provide within Pods. The ability to create automatic custom capabilities or make your post type mirror the capabilities of post or page. Anything else, it’s up to WordPress for management.

Skip to toolbar