From 81ed396972999e2dafbc014f7032da2cd72100e4 Mon Sep 17 00:00:00 2001 From: "K. Adam White" Date: Mon, 23 Sep 2019 21:02:56 +0000 Subject: [PATCH] Posts, Post Types: Build list of "date floating" post stati dynamically when inserting post. Completes work begun in #39953 to expose "date floating" status information to frontend clients via the REST API. Props TimothyBlynJacobs. Fixes #48113. Built from https://develop.svn.wordpress.org/trunk@46279 git-svn-id: http://core.svn.wordpress.org/trunk@46091 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index fce021ffba..63a71d9a1e 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -3727,7 +3727,7 @@ function wp_insert_post( $postarr, $wp_error = false ) { } if ( empty( $postarr['post_date_gmt'] ) || '0000-00-00 00:00:00' == $postarr['post_date_gmt'] ) { - if ( ! in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) ) { + if ( ! in_array( $post_status, get_post_stati( array( 'date_floating' => true ) ), true ) ) { $post_date_gmt = get_gmt_from_date( $post_date ); } else { $post_date_gmt = '0000-00-00 00:00:00'; diff --git a/wp-includes/version.php b/wp-includes/version.php index 14b669182e..c1472109c0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-46278'; +$wp_version = '5.3-alpha-46279'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.