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