From 6f88378c1f3e892a8521b8ab082d9d9e040f2411 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Thu, 13 Dec 2018 19:28:26 +0000 Subject: [PATCH] Classic Editor: Disable the wpautop TinyMCE plugin on block posts. As the block editor adds its own `

` tags, disabling the wpautop stops the classic editor from removing them. Props pento. Merges [43758] to trunk. See #45113. git-svn-id: https://develop.svn.wordpress.org/trunk@44120 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-editor.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-editor.php b/src/wp-includes/class-wp-editor.php index c96eb7c09f..a9e5e04f2e 100644 --- a/src/wp-includes/class-wp-editor.php +++ b/src/wp-includes/class-wp-editor.php @@ -82,7 +82,8 @@ final class _WP_Editors { $set = wp_parse_args( $settings, array( - 'wpautop' => true, + // Disable autop if the current post has blocks in it. + 'wpautop' => ! has_blocks(), 'media_buttons' => true, 'default_editor' => '', 'drag_drop_upload' => false,