WordPress.org

Make WordPress Core

Ticket #53537: 53537.diff

File 53537.diff, 780 bytes (added by Chouby, 4 months ago)
  • src/wp-admin/edit-form-blocks.php

    diff --git src/wp-admin/edit-form-blocks.php src/wp-admin/edit-form-blocks.php
    index 3a399c2fcd..c3afff810c 100644
    if ( ! empty( $post_type_object->template ) ) { 
    216216}
    217217
    218218// If there's no template set on a new post, use the post format, instead.
    219 if ( $is_new_post && ! isset( $editor_settings['template'] ) && 'post' === $post->post_type ) {
     219if ( $is_new_post && empty( $post->post_content ) && ! isset( $editor_settings['template'] ) && 'post' === $post->post_type ) {
    220220        $post_format = get_post_format( $post );
    221221        if ( in_array( $post_format, array( 'audio', 'gallery', 'image', 'quote', 'video' ), true ) ) {
    222222                $editor_settings['template'] = array( array( "core/$post_format" ) );