function editor_load

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

Return value

\Drupal\editor\Plugin\Core\Entity\Editor|FALSE A text editor object, or FALSE.

7 calls to editor_load()
Editor::getAttachments in drupal/core/modules/editor/lib/Drupal/editor/Plugin/InPlaceEditor/Editor.php
Implements \Drupal\edit\EditPluginInterface::getAttachments().
Editor::isCompatible in drupal/core/modules/editor/lib/Drupal/editor/Plugin/InPlaceEditor/Editor.php
Implements \Drupal\edit\Plugin\EditPluginInterface::isCompatible().
EditorAdminTest::verifyUnicornEditorConfiguration in drupal/core/modules/editor/lib/Drupal/editor/Tests/EditorAdminTest.php
Verifies unicorn editor configuration.
EditorManager::getAttachments in drupal/core/modules/editor/lib/Drupal/editor/Plugin/EditorManager.php
Retrieves text editor libraries and JavaScript settings.
editor_form_filter_admin_format_form_alter in drupal/core/modules/editor/editor.module
Implements hook_form_FORM_ID_alter().

... See full list

File

drupal/core/modules/editor/editor.module, line 291
Adds bindings for client-side "text editors" to text formats.

Code

function editor_load($format_id) {

  // Load all the editors at once here, assuming that either no editors or more
  // than one editor will be needed on a page (such as having multiple text
  // formats for administrators). Loading a small number of editors all at once
  // is more efficient than loading multiple editors individually.
  $editors = entity_load_multiple('editor');
  return isset($editors[$format_id]) ? $editors[$format_id] : FALSE;
}