| @@ 787-792 (lines=6) @@ | ||
| 784 | if (! $this->setupCapabilitiesMap()) { |
|
| 785 | return false; |
|
| 786 | } |
|
| 787 | if (! $this->capHasBeenAddedToRole($role->name, $cap)) { |
|
| 788 | $role->add_cap($cap, $grant); |
|
| 789 | $this->capabilities_map[ $role->name ][] = $cap; |
|
| 790 | $this->updateCapabilitiesMap($update_capabilities_map); |
|
| 791 | return true; |
|
| 792 | } |
|
| 793 | } |
|
| 794 | return false; |
|
| 795 | } |
|
| @@ 818-823 (lines=6) @@ | ||
| 815 | return false; |
|
| 816 | } |
|
| 817 | $role = $role instanceof WP_Role ? $role :get_role($role); |
|
| 818 | if ($index = $this->capHasBeenAddedToRole($role->name, $cap, true)) { |
|
| 819 | $role->remove_cap($cap); |
|
| 820 | unset($this->capabilities_map[ $role->name ][ $index ]); |
|
| 821 | $this->updateCapabilitiesMap($update_capabilities_map); |
|
| 822 | return true; |
|
| 823 | } |
|
| 824 | return false; |
|
| 825 | } |
|
| 826 | ||