Posts, Post Types: Wrap text submitted via Quick Draft dashboard widget in the Paragraph block.

Props audrasjb, jeroenrotty.
Fixes #48120.
Built from https://develop.svn.wordpress.org/trunk@47191


git-svn-id: http://core.svn.wordpress.org/trunk@46991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-02-05 08:10:05 +00:00
parent 44288356e2
commit 0544629460
2 changed files with 9 additions and 1 deletions

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;

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.4-alpha-47190';
$wp_version = '5.4-alpha-47191';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.