/Drupal 8

function editor_load


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


int $format_id: A text format ID.

Return value

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


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


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] : NULL;

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.