From e75be7a35e5a9643438f135fb266fd2688b711ea Mon Sep 17 00:00:00 2001 From: Miguel Fonseca Date: Fri, 16 Mar 2018 19:12:03 +0000 Subject: [PATCH] Ignore "Disable visual editor" setting Fixes #5667 See wp-includes/class-wp-editor's behavior around self::$this_tinymce: https://github.com/WordPress/WordPress/blob/176a28905041fd79c439946a4ba290a87db5991f/wp-includes/class-wp-editor.php#L360 --- lib/client-assets.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/client-assets.php b/lib/client-assets.php index f3f688a3fae2f2..3808b96e5c5341 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -788,6 +788,12 @@ function gutenberg_editor_scripts_and_styles( $hook ) { // to disable it outright. wp_enqueue_script( 'heartbeat' ); + // Ignore Classic Editor's `rich_editing` user option, aka "Disable visual + // editor". Forcing this to be true guarantees that TinyMCE and its plugins + // are available in Gutenberg. Fixes + // https://github.com/WordPress/gutenberg/issues/5667. + add_filter( 'user_can_richedit', '__return_true' ); + wp_enqueue_script( 'wp-edit-post' ); // Register `wp-utils` as a dependency of `word-count` to ensure that