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.


git-svn-id: https://develop.svn.wordpress.org/trunk@49614 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi
2020-11-16 19:42:32 +00:00
parent 271702cd27
commit 117de3b2cd

View File

@@ -680,15 +680,9 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false )
}
if ( $create_in_db ) {
if ( post_type_supports( $post_type, 'title' ) ) {
$default_title = __( 'Auto Draft' );
} else {
$default_title = __( '(no title supported)' );
}
$post_id = wp_insert_post(
array(
'post_title' => $default_title,
'post_title' => __( 'Auto Draft' ),
'post_type' => $post_type,
'post_status' => 'auto-draft',
),
@@ -696,14 +690,9 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false )
true
);
$post = get_post( $post_id );
if ( current_theme_supports( 'post-formats' )
&& post_type_supports( $post->post_type, 'post-formats' )
&& get_option( 'default_post_format' )
) {
if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) && get_option( 'default_post_format' ) ) {
set_post_format( $post, get_option( 'default_post_format' ) );
}
wp_after_insert_post( $post, false );
// Schedule auto-draft cleanup.