function filter_fallback_format
Same name and namespace in other branches
- 10 core/modules/filter/filter.module \filter_fallback_format()
- 9 core/modules/filter/filter.module \filter_fallback_format()
- 8.9.x core/modules/filter/filter.module \filter_fallback_format()
- 7.x modules/filter/filter.module \filter_fallback_format()
- main core/modules/filter/filter.module \filter_fallback_format()
Returns the ID of the fallback text format that all users have access to.
The fallback text format is a regular text format in every respect, except it does not participate in the filter permission system and cannot be disabled. It needs to exist because any user who has permission to create formatted content must always have at least one text format they can use.
Because the fallback format is available to all users, it should always be configured securely. For example, when the Filter module is installed, this format is initialized to output plain text. Installation profiles and site administrators have the freedom to configure it further.
Note that the fallback format is completely distinct from the default format, which differs per user and is simply the first format which that user has access to. The default and fallback formats are only guaranteed to be the same for users who do not have access to any other format; otherwise, the fallback format's weight determines its placement with respect to the user's other formats.
Any modules implementing a format deletion functionality must not delete this format.
Return value
string|null The ID of the fallback text format.
Deprecated
in drupal:11.4.0 and is removed from drupal:13.0.0. Use the \Drupal\filter\FilterFormatRepositoryInterface service with the ::getFallbackFormatId() method instead.
See also
https://www.drupal.org/node/3035368
1 call to filter_fallback_format()
- FilterFormatAccessTest::testFilterTips in core/
modules/ filter/ tests/ src/ Functional/ FilterFormatAccessTest.php - Tests the filter tips functionality.
1 string reference to 'filter_fallback_format'
- d7_filter_settings.yml in core/
modules/ filter/ migrations/ d7_filter_settings.yml - core/modules/filter/migrations/d7_filter_settings.yml
File
-
core/
modules/ filter/ filter.module, line 167
Code
function filter_fallback_format() {
@trigger_error('filter_fallback_format() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use the Drupal\\filter\\FilterFormatRepositoryInterface service with the ::getFallbackFormatId() method instead. See https://www.drupal.org/node/3035368', E_USER_DEPRECATED);
return \Drupal::service(FilterFormatRepositoryInterface::class)->getFallbackFormatId();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.