Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

When text formats were converted to configurable entities and filters were converted to plugins, many procedural wrappers were left in place.

The following functions have been removed:

filter_format_load()
filter_format_exists()
filter_permission_name()
filter_list_format()
filter_access()

Loading a text format

Drupal 7

<?php
$restricted_html_format
= filter_format_load('restricted_html');
?>

Drupal 8

<?php
$restricted_html_format
= entity_load('filter_format', 'restricted_html');
?>

Checking for an existing text format

Drupal 7

<?php
if (filter_format_exists('restricted_html')) {
}
?>

Drupal 8

<?php
// Most efficient (does not load the format):
if (\Drupal::entityQuery('filter_format')->condition('format', 'restricted_html')->execute()) {
}
// Also valid (identical to the D7 code):
if (entity_load('filter_format', 'restricted_html')) {
}
?>

Finding the permission name for a text format

Drupal 7

<?php
$permission_name
= filter_permission_name($restricted_html_format);
?>

Drupal 8

<?php
$permission_name
= $restricted_html_format->getPermissionName();
?>

Retrieve the filters for a text format

Drupal 7

<?php
$filters
= filter_list_format($restricted_html_format->format);
?>

Drupal 8

<?php
$filters
= $restricted_html_format->filters();
?>

Checking access for a text format

Drupal 7

<?php
if (filter_access($restricted_html_format)) {
}
if (
filter_access($restricted_html_format, $account)) {
}
?>

Drupal 8

<?php
if ($restricted_html_format->access('view')) {
}
if (
$restricted_html_format->access('view', $account)) {
}
?>
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done