WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/05/2020 08:08:37 AM (21 months ago)
Author:
SergeyBiryukov
Message:

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

Props audrasjb, jeroenrotty.
Fixes #48120.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/post.php

    r47122 r47191  
    9696        $_POST['comment_status'] = get_default_comment_status( $post->post_type );
    9797        $_POST['ping_status']    = get_default_comment_status( $post->post_type, 'pingback' );
     98
     99        // Wrap Quick Draft content in the Paragraph block.
     100        if ( false === strpos( $_POST['content'], '<!-- wp:paragraph -->' ) ) {
     101            $_POST['content'] = sprintf(
     102                '<!-- wp:paragraph -->%s<!-- /wp:paragraph -->',
     103                str_replace( array( "\r\n", "\r", "\n" ), '<br />', $_POST['content'] )
     104            );
     105        }
    98106
    99107        edit_post();
Note: See TracChangeset for help on using the changeset viewer.