From 14bd8cc469e60e4a9632e964caf6c83d0b6dc7ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helen=20Hou-Sand=C3=AD?= Date: Mon, 16 Nov 2020 19:44:07 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@49614 git-svn-id: http://core.svn.wordpress.org/trunk@49352 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 15 ++------------- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 96b71d0703..cb2cd060dd 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -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. diff --git a/wp-includes/version.php b/wp-includes/version.php index 344a968f57..2e09bb3370 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-beta4-49613'; +$wp_version = '5.6-beta4-49614'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.