name; } /** * @inheritDoc * * @version 7.0.11 */ private function _get_resource_identifier($id) { return wp_roles()->get_role($id); } /** * @inheritDoc */ private function _apply_policy() { $result = []; foreach($this->policies()->statements('Role:*') as $stm) { $bits = explode(':', $stm['Resource']); $id = $bits[1]; if (count($bits) === 2) { // Role: $result[$id] = array_replace( isset($result[$id]) ? $result[$id] : [], $this->policy->statement_to_permission($stm, $this->type) ); } elseif (count($bits) === 3 && $bits[2] === 'users') { $result[$id] = array_replace( isset($result[$id]) ? $result[$id] : [], $this->policy->statement_to_permission($stm, 'user') ); } } return apply_filters('aam_apply_policy_filter', $result, $this); } }