_WP_Editors
- Since
- 3.3.0
- Source
wp-includes/class-wp-editor.php:11
Facilitates adding of the WordPress editor as used on the Write and Edit screens.
Compatibility
- WordPress
- since 3.3.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Hooks and filters fired · 28
Every hook that fires from inside _WP_Editors, in the order it appears in the class, grouped by the method that fires it.
_WP_Editors::editor()
- do_action( media_buttons )action line 240
- apply_filters( the_editor )filter line 267
- apply_filters( the_editor_content )filter line 289
- do_action( htmledit_pre )filter_deprecated line 299
- do_action( richedit_pre )filter_deprecated line 302
_WP_Editors::editor_settings()
- apply_filters( quicktags_settings )filter line 361
- apply_filters( teeny_mce_plugins )filter line 386
- apply_filters( mce_external_plugins )filter line 421
- apply_filters( tiny_mce_plugins )filter line 461
- apply_filters( mce_external_languages )filter line 489
- apply_filters( disable_captions )filter line 567
- apply_filters( mce_css )filter line 600
- apply_filters( teeny_mce_buttons )filter line 638
- apply_filters( mce_buttons )filter line 680
- apply_filters( mce_buttons_2 )filter line 709
- apply_filters( mce_buttons_3 )filter line 721
- apply_filters( mce_buttons_4 )filter line 733
- apply_filters( teeny_mce_before_init )filter line 804
- apply_filters( tiny_mce_before_init )filter line 817
_WP_Editors::enqueue_scripts()
- do_action( wp_enqueue_editor )action line 893
_WP_Editors::print_default_editor_scripts()
- do_action( print_default_editor_scripts )action line 1023
_WP_Editors::editor_js()
- do_action( before_wp_tiny_mce )action line 1620
- do_action( wp_tiny_mce_init )action line 1659
- do_action( after_wp_tiny_mce )action line 1745
_WP_Editors::wp_link_query()
- apply_filters( wp_link_query_args )filter line 1813
- apply_filters( wp_link_query )filter line 1858
Properties · 18
$mce_localepublic static$mce_settingsprivate static$qt_settingsprivate static$pluginsprivate static$qt_buttonsprivate static$ext_pluginsprivate static$baseurlprivate static$first_initprivate static$this_tinymceprivate static$this_quicktagsprivate static$has_tinymceprivate static$has_quicktagsprivate static$has_medialibprivate static$editor_buttons_cssprivate static$drag_drop_uploadprivate static$translationprivate static$tinymce_scripts_printedprivate static$link_dialog_printedprivate static
Methods · 19
- __construct()
- parse_settings()Parse default arguments for the editor instance.
- editor()Outputs the HTML for a single instance of the editor.
- editor_settings()
- _parse_init()
- enqueue_scripts()
- enqueue_default_editor()Enqueue all editor scripts.
- print_default_editor_scripts()Print (output) all editor scripts and default settings.
- get_mce_locale()Returns the TinyMCE locale.
- get_baseurl()Returns the TinyMCE base URL.
- default_settings()Returns the default TinyMCE settings.
- get_translation()
- wp_mce_translation()Translates the default TinyMCE strings and returns them as JSON encoded object ready to be loaded with tinymce.addI18n(), or as JS snippet that should run after tinymce.js is loaded.
- force_uncompressed_tinymce()Force uncompressed TinyMCE when a custom theme has been defined.
- print_tinymce_scripts()Print (output) the main TinyMCE scripts.
- editor_js()Print (output) the TinyMCE configuration and initialization scripts.
- wp_fullscreen_html()Outputs the HTML for distraction-free writing mode.
- wp_link_query()Performs post queries for internal linking.
- wp_link_dialog()Dialog for internal linking.
Source code
#[AllowDynamicProperties]final class _WP_Editors { public static $mce_locale; private static $mce_settings = array(); private static $qt_settings = array(); private static $plugins = array(); private static $qt_buttons = array(); private static $ext_plugins; private static $baseurl; private static $first_init; private static $this_tinymce = false; private static $this_quicktags = false; private static $has_tinymce = false; private static $has_quicktags = false; private static $has_medialib = false; private static $editor_buttons_css = true; private static $drag_drop_upload = false; private static $translation; private static $tinymce_scripts_printed = false; private static $link_dialog_printed = false; private function __construct() {} /** * Parse default arguments for the editor instance. * * @since 3.3.0 * * @param string $editor_id HTML ID for the textarea and TinyMCE and Quicktags instances. * Should not contain square brackets. * @param array $settings { * Array of editor arguments. * * @type bool $wpautop Whether to use wpautop(). Default true. * @type bool $media_buttons Whether to show the Add Media/other media buttons. * @type string $default_editor When both TinyMCE and Quicktags are used, set which * editor is shown on page load. Default empty. * @type bool $drag_drop_upload Whether to enable drag & drop on the editor uploading. Default false. * Requires the media modal. * @type string $textarea_name Give the textarea a unique name here. Square brackets * can be used here. Default $editor_id. * @type int $textarea_rows Number rows in the editor textarea. Default 20. * @type string|int $tabindex Tabindex value to use. Default empty. * @type string $tabfocus_elements The previous and next element ID to move the focus to * when pressing the Tab key in TinyMCE. Default ':prev,:next'. * @type string $editor_css Intended for extra styles for both Visual and Code editors. * Should include `<style>` tags, and can use "scoped". Default empty. * @type string $editor_class Extra classes to add to the editor textarea element. Default empty. * @type bool $teeny Whether to output the minimal editor config. Examples include * Press This and the Comment editor. Default false. * @type bool $dfw Deprecated in 4.1. Unused. * @type bool|array $tinymce Whether to load TinyMCE. Can be used to pass settings directly to * TinyMCE using an array. Default true. * @type bool|array $quicktags Whether to load Quicktags. Can be used to pass settings directly to * Quicktags using an array. Default true. * } * @return array Parsed arguments array. */ public static function parse_settings( $editor_id, $settings ) { /** * Filters the wp_editor() settings. * * @since 4.0.0 * * @see _WP_Editors::parse_settings() * * @param array $settings Array of editor arguments. * @param string $editor_id Unique editor identifier, e.g. 'content'. Accepts 'classic-block' * when called from block editor's Classic block. */ $settings = apply_filters( 'wp_editor_settings', $settings, $editor_id ); $set = wp_parse_args( $settings, array( // Disable autop if the current post has blocks in it. 'wpautop' => ! has_blocks(), 'media_buttons' => true,Changelog
Introduced in 3.3.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/class-wp-editor.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.