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
This commit is contained in:
Sergey Biryukov 2020-02-05 08:08:37 +00:00
parent 5a5c1924fd
commit 616e4ffb4e

View File

@ -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'], '<!-- wp:paragraph -->' ) ) {
$_POST['content'] = sprintf(
'<!-- wp:paragraph -->%s<!-- /wp:paragraph -->',
str_replace( array( "\r\n", "\r", "\n" ), '<br />', $_POST['content'] )
);
}
edit_post();
wp_dashboard_quick_press();
exit;