The custom user capabilities Coupon Creator registers for the coupon post type, and which roles receive them.
Coupons use a mapped capability type (cctor_coupon / cctor_coupons) rather than the generic edit_posts set, so you can grant coupon access independently of regular posts. Capabilities are added to the default roles once, on activation, and a flag option (cctor_coupon_capabilities_register) prevents them from being re-added.
Capabilities #
| Capability | Grants |
|---|---|
edit_cctor_coupon |
Edit a single coupon (meta box save is gated on this) |
edit_cctor_coupons |
Access the coupon editor / list |
edit_others_cctor_coupons |
Edit coupons authored by others |
edit_private_cctor_coupons |
Edit private coupons |
edit_published_cctor_coupons |
Edit published coupons |
publish_cctor_coupons |
Publish coupons |
read_cctor_coupon |
Read a single coupon |
read_private_cctor_coupons |
Read private coupons |
delete_cctor_coupon |
Delete a single coupon |
delete_cctor_coupons |
Delete coupons |
delete_others_cctor_coupons |
Delete others' coupons |
delete_private_cctor_coupons |
Delete private coupons |
delete_published_cctor_coupons |
Delete published coupons |
Roles that receive them on activation #
- Administrator / Editor — full set (all of the above).
- Author — create, edit, publish, and delete their own coupons.
- Contributor — create and edit their own coupons (no publish).
- Subscriber —
read_cctor_coupononly.
Related checks #
- The coupon meta box only saves for users with
edit_cctor_coupon. - Duplicating a coupon requires
edit_cctor_coupons. - The Options page requires
manage_options.
To grant a coupon capability to a custom role, use $role->add_cap( 'edit_cctor_coupons' ) (and the others you need) after the role exists.