function user_filter_format_disable

Same name in other branches
  1. 10 core/modules/user/user.module \user_filter_format_disable()
  2. 11.x core/modules/user/user.module \user_filter_format_disable()

Implements hook_filter_format_disable().

File

core/modules/user/user.module, line 1319

Code

function user_filter_format_disable(FilterFormatInterface $filter_format) {
    // Remove the permission from any roles.
    $permission = $filter_format->getPermissionName();
    
    /** @var \Drupal\user\Entity\Role $role */
    foreach (Role::loadMultiple() as $role) {
        if ($role->hasPermission($permission)) {
            $role->revokePermission($permission)
                ->save();
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.