function filter_get_formats_by_role
Same name and namespace in other branches
- 11.x core/modules/filter/filter.module \filter_get_formats_by_role()
- 10 core/modules/filter/filter.module \filter_get_formats_by_role()
- 9 core/modules/filter/filter.module \filter_get_formats_by_role()
- 8.9.x core/modules/filter/filter.module \filter_get_formats_by_role()
- 7.x modules/filter/filter.module \filter_get_formats_by_role()
Retrieves a list of text formats that are allowed for a given role.
Parameters
string $rid: The user role ID to retrieve text formats for.
Return value
\Drupal\filter\FilterFormatInterface[] An array of text format objects that are allowed for the role, keyed by the text format ID and ordered by weight.
Deprecated
in drupal:11.4.0 and is removed from drupal:13.0.0. Use the \Drupal\filter\FilterFormatRepositoryInterface service with the ::getFormatsByRole() method instead.
See also
https://www.drupal.org/node/3035368
File
-
core/
modules/ filter/ filter.module, line 94
Code
function filter_get_formats_by_role($rid) : array {
@trigger_error('filter_get_formats_by_role() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use the Drupal\\filter\\FilterFormatRepositoryInterface service with the ::getFormatsByRole() method instead. See https://www.drupal.org/node/3035368', E_USER_DEPRECATED);
return \Drupal::service(FilterFormatRepositoryInterface::class)->getFormatsByRole($rid);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.