editor_load($format_id)
Loads an individual configured text editor based on text format ID.
int $format_id: A text format ID.
\Drupal\editor\Entity\Editor|null A text editor object, or NULL.
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.
https://api.drupal.org/api/drupal/core!modules!editor!editor.module/function/editor_load/8.1.x