mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 06:29:30 +00:00
XMLRPC: Restore support in wp.newPost for dates to be supplied in the structured dateTime.iso8601 format as well as still supporting dates specified as strings.
Fixes #28601. Built from https://develop.svn.wordpress.org/trunk@29063 git-svn-id: http://core.svn.wordpress.org/trunk@28849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bf36cbeb18
commit
105d9ce9cc
@ -1103,13 +1103,13 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
return $this->error;
|
||||
|
||||
// convert the date field back to IXR form
|
||||
if ( isset( $content_struct['post_date'] ) ) {
|
||||
if ( isset( $content_struct['post_date'] ) && ! is_a( $content_struct['post_date'], 'IXR_Date' ) ) {
|
||||
$content_struct['post_date'] = $this->_convert_date( $content_struct['post_date'] );
|
||||
}
|
||||
|
||||
// ignore the existing GMT date if it is empty or a non-GMT date was supplied in $content_struct,
|
||||
// since _insert_post will ignore the non-GMT date if the GMT date is set
|
||||
if ( isset( $content_struct['post_date_gmt'] ) ) {
|
||||
if ( isset( $content_struct['post_date_gmt'] ) && ! is_a( $content_struct['post_date_gmt'], 'IXR_Date' ) ) {
|
||||
if ( $content_struct['post_date_gmt'] == '0000-00-00 00:00:00' || isset( $content_struct['post_date'] ) ) {
|
||||
unset( $content_struct['post_date_gmt'] );
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user