function editor_load

Same name and namespace in other branches
  1. 9 core/modules/editor/editor.module \editor_load()
  2. 8.9.x core/modules/editor/editor.module \editor_load()
  3. 10 core/modules/editor/editor.module \editor_load()

Loads an individual configured text editor based on text format ID.

Parameters

string $format_id: A text format ID.

Return value

\Drupal\editor\Entity\Editor|null A text editor object, or NULL.

Deprecated

in drupal:11.2.0 and is removed from drupal:12.0.0. Use \Drupal::entityTypeManager()->getStorage('editor')->load($format_id) instead.

See also

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

File

core/modules/editor/editor.module, line 130

Code

function editor_load($format_id) {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use \\Drupal::entityTypeManager()->getStorage(\'editor\')->load($format_id) instead. See https://www.drupal.org/node/3509245', E_USER_DEPRECATED);
  // While loading multiple editors at once is a more efficient query, on warm
  // caches, loading editor configuration from APCu is fast and avoids a call to
  // ConfigFactory::listAll() in a loadMultiple() call with no IDs passed.
  // @see Drupal\Core\Config\Entity\ConfigEntityStorage::doLoadMultiple()
  return $format_id ? Editor::load($format_id) : NULL;
}

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