Maps capabilities via the map_meta_cap
filter.
Description
See also
Parameters
- $caps
-
(array) (Required) Required capabilities.
- $cap
-
(string) (Required) Capability name.
- $user_id
-
(int) (Required) User ID.
- $args
-
(array) (Required) Additional arguments.
Return
(array) Required mapped capabilities.
Source
File: src/db-objects/submissions/submission-capabilities.php
protected function map_meta_cap( $caps, $cap, $user_id, $args ) { $mapped_caps = parent::map_meta_cap( $caps, $cap, $user_id, $args ); // In addition to the regular post capabilities, require 'edit_users' to deal with someone else's submissions. if ( in_array( $cap, array( $this->base_capabilities['read_others_items'], $this->base_capabilities['edit_others_items'], $this->base_capabilities['delete_others_items'] ), true ) ) { $mapped_caps[] = 'edit_users'; } return $mapped_caps; }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |