Source
File: wp-includes/class-wp-editor.php
public static function enqueue_scripts( $default_scripts = false ) {
if ( $default_scripts || self::$has_tinymce ) {
wp_enqueue_script( 'editor' );
}
if ( $default_scripts || self::$has_quicktags ) {
wp_enqueue_script( 'quicktags' );
wp_enqueue_style( 'buttons' );
}
if ( $default_scripts || in_array( 'wplink', self::$plugins, true ) || in_array( 'link', self::$qt_buttons, true ) ) {
wp_enqueue_script( 'wplink' );
wp_enqueue_script( 'jquery-ui-autocomplete' );
}
if ( self::$has_medialib ) {
add_thickbox();
wp_enqueue_script( 'media-upload' );
wp_enqueue_script( 'wp-embed' );
} elseif ( $default_scripts ) {
wp_enqueue_script( 'media-upload' );
}
/**
* Fires when scripts and styles are enqueued for the editor.
*
* @since 3.9.0
*
* @param array $to_load An array containing boolean values whether TinyMCE
* and Quicktags are being loaded.
*/
do_action(
'wp_enqueue_editor',
array(
'tinymce' => ( $default_scripts || self::$has_tinymce ),
'quicktags' => ( $default_scripts || self::$has_quicktags ),
)
);
}