1 | <?php |
||
11 | class Admin_Capability_Giver { |
||
12 | |||
13 | public function load() { |
||
16 | |||
17 | /** |
||
18 | * Add `manage_bulk_wp` capability to admin's list of capabilities during `user_has_cap` check. |
||
19 | * |
||
20 | * In new installs this capability will be added to admins on plugin install. |
||
21 | * But in old installs the admins will not have this capability and that's why we need to add it using the filter. |
||
22 | * |
||
23 | * @param array $allcaps An array of all the user's capabilities. |
||
24 | * @param array $caps Actual capabilities for meta capability. |
||
25 | * @param array $args Optional parameters passed to has_cap(), typically object ID. |
||
26 | * @param \WP_User $user The user object. |
||
27 | * |
||
28 | * @return array Modified list of user's capabilities. |
||
29 | */ |
||
30 | public function add_cap_to_admin_cap_list( $allcaps, $caps, $args, $user ) { |
||
45 | |||
46 | /** |
||
47 | * Add `manage_bulk_wp` capability to administrator role. |
||
48 | * This will be called on install. |
||
49 | */ |
||
50 | public function add_cap_to_admin() { |
||
60 | } |
||
61 |