Title: wp_enqueue_editor
Published: June 15, 2017
Last modified: August 20, 2026

---

# wp_enqueue_editor()

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/wp_enqueue_editor/?output_format=md#description)
 * [Source](https://developer.wordpress.org/reference/functions/wp_enqueue_editor/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_enqueue_editor/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_enqueue_editor/?output_format=md#changelog)

Outputs the editor scripts, stylesheets, and default settings.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/wp_enqueue_editor/?output_format=md#description)󠁿

The editor can be initialized when needed after page load.
See wp.editor.initialize()
in wp-admin/js/editor.js for initialization options.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_enqueue_editor/?output_format=md#source)󠁿

    ```php
    function wp_enqueue_editor() {
    	if ( ! class_exists( '_WP_Editors', false ) ) {
    		require ABSPATH . WPINC . '/class-wp-editor.php';
    	}

    	_WP_Editors::enqueue_default_editor();
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/general-template.php#L4213)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/general-template.php#L4213-L4219)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_enqueue_editor/?output_format=md#related)󠁿

| Uses | Description | 
| [_WP_Editors::enqueue_default_editor()](https://developer.wordpress.org/reference/classes/_wp_editors/enqueue_default_editor/)`wp-includes/class-wp-editor.php` |

Enqueue all editor scripts.

  |

| Used by | Description | 
| [WP_Widget_Text::enqueue_admin_scripts()](https://developer.wordpress.org/reference/classes/wp_widget_text/enqueue_admin_scripts/)`wp-includes/widgets/class-wp-widget-text.php` |

Loads the required scripts and styles for the widget control.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_enqueue_editor/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_enqueue_editor%2F)
before being able to contribute a note or feedback.