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.

Other Helpful Documentation on Advanced Topics

Compare Functionality in Pods 1.x to Pods 2.x

In Pods 2.0, we’ve simplified and cleaned up confusing names of functions and methods. Below is a comparison in case you’re familiar with Pods 1.x functionality. This will help you quickly migrate from any Pods 1.x site to Pods 2.x. Note: Pods 2.x is backwards compatible with Pods 1.x code in most cases, but we still …

Read more

REST API

ContentsOverviewQuick StartWordPress REST APICustom Fields, The REST API, Pods & YouExtending WordPress Default ObjectsHow It WorksPods Advanced Content Types, Custom Queries & More Overview Pods can be used to extend default WordPress REST API endpoints for any post types and taxonomies as well as the user routes. This functionality, which is managed from the Pods editor can be …

Read more

URL Rewrites & Custom Rewrites

When you need to change the URL structure or Rewrite Rules beyond what is provided in the Advanced Options Tab for the Custom Post or Custom Taxonomy.

Using Link Tables for multi-field relationships

We get a lot of questions about relationships with multiple fields. These extra fields give the relationship more context, like a date for example. In such a case you’ll need a so-called “Link Table” to combine this into one relationship. This can be an extra Pod, table based or meta based. ContentsSetup:Use cases:1: Recipe ingredients …

Read more