From 616e4ffb4e321cde04fa1398be247a5539f22bb2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 5 Feb 2020 08:08:37 +0000 Subject: [PATCH] Posts, Post Types: Wrap text submitted via Quick Draft dashboard widget in the Paragraph block. Props audrasjb, jeroenrotty. Fixes #48120. git-svn-id: https://develop.svn.wordpress.org/trunk@47191 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/post.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/wp-admin/post.php b/src/wp-admin/post.php index 291a1a6ac0..3422e1886a 100644 --- a/src/wp-admin/post.php +++ b/src/wp-admin/post.php @@ -96,6 +96,14 @@ switch ( $action ) { $_POST['comment_status'] = get_default_comment_status( $post->post_type ); $_POST['ping_status'] = get_default_comment_status( $post->post_type, 'pingback' ); + // Wrap Quick Draft content in the Paragraph block. + if ( false === strpos( $_POST['content'], '' ) ) { + $_POST['content'] = sprintf( + '%s', + str_replace( array( "\r\n", "\r", "\n" ), '
', $_POST['content'] ) + ); + } + edit_post(); wp_dashboard_quick_press(); exit;