function filter_get_roles_by_format

Same name and namespace in other branches
  1. 10 core/modules/filter/filter.module \filter_get_roles_by_format()
  2. 9 core/modules/filter/filter.module \filter_get_roles_by_format()
  3. 8.9.x core/modules/filter/filter.module \filter_get_roles_by_format()
  4. 7.x modules/filter/filter.module \filter_get_roles_by_format()
  5. main core/modules/filter/filter.module \filter_get_roles_by_format()

Retrieves a list of roles that are allowed to use a given text format.

Parameters

\Drupal\filter\FilterFormatInterface $format: An object representing the text format.

Return value

array An array of role names, keyed by role ID.

Deprecated

in drupal:11.4.0 and is removed from drupal:13.0.0. Use the \Drupal\filter\FilterFormatInterface::getRoles() method instead.

See also

https://www.drupal.org/node/3035368

File

core/modules/filter/filter.module, line 74

Code

function filter_get_roles_by_format(FilterFormatInterface $format) : array {
  @trigger_error('filter_get_roles_by_format() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use the \\Drupal\\filter\\FilterFormatInterface::getRoles() method instead. See https://www.drupal.org/node/3035368', E_USER_DEPRECATED);
  return $format->getRoles();
}

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