Make WordPress Core

Changeset 49614


Ignore:
Timestamp:
11/16/2020 07:42:32 PM (6 years ago)
Author:
helen
Message:

Posts, Post Types: Go back to "Auto Draft" for CPTs without title support.

Reverts [49288] due to late point in 5.6 cycle and lack of update in Gutenberg package to account for the string change.
See #45516.

File:
1 edited

Legend:

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

    r49544 r49614  
    681681
    682682        if ( $create_in_db ) {
    683                 if ( post_type_supports( $post_type, 'title' ) ) {
    684                         $default_title = __( 'Auto Draft' );
    685                 } else {
    686                         $default_title = __( '(no title supported)' );
    687                 }
    688 
    689683                $post_id = wp_insert_post(
    690684                        array(
    691                                 'post_title'  => $default_title,
     685                                'post_title'  => __( 'Auto Draft' ),
    692686                                'post_type'   => $post_type,
    693687                                'post_status' => 'auto-draft',
     
    697691                );
    698692                $post    = get_post( $post_id );
    699 
    700                 if ( current_theme_supports( 'post-formats' )
    701                         && post_type_supports( $post->post_type, 'post-formats' )
    702                         && get_option( 'default_post_format' )
    703                 ) {
     693                if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) && get_option( 'default_post_format' ) ) {
    704694                        set_post_format( $post, get_option( 'default_post_format' ) );
    705695                }
    706 
    707696                wp_after_insert_post( $post, false );
    708697
Note: See TracChangeset for help on using the changeset viewer.