Skip to content

Commit

Permalink
Merge branch 'trunk' of git://core.git.wordpress.org into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
gilzow committed Jan 19, 2025
2 parents 799cfbd + aaa03f6 commit 78ee687
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
37 changes: 19 additions & 18 deletions wp-includes/class-wp-xmlrpc-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -1513,17 +1513,17 @@ protected function _insert_post( $user, $content_struct ) {
// Do some timestamp voodoo.
if ( ! empty( $post_data['post_date_gmt'] ) ) {
// We know this is supposed to be GMT, so we're going to slap that Z on there by force.
$dateCreated = rtrim( $post_data['post_date_gmt']->getIso(), 'Z' ) . 'Z';
$date_created = rtrim( $post_data['post_date_gmt']->getIso(), 'Z' ) . 'Z';
} elseif ( ! empty( $post_data['post_date'] ) ) {
$dateCreated = $post_data['post_date']->getIso();
$date_created = $post_data['post_date']->getIso();
}

// Default to not flagging the post date to be edited unless it's intentional.
$post_data['edit_date'] = false;

if ( ! empty( $dateCreated ) ) {
$post_data['post_date'] = iso8601_to_datetime( $dateCreated );
$post_data['post_date_gmt'] = iso8601_to_datetime( $dateCreated, 'gmt' );
if ( ! empty( $date_created ) ) {
$post_data['post_date'] = iso8601_to_datetime( $date_created );
$post_data['post_date_gmt'] = iso8601_to_datetime( $date_created, 'gmt' );

// Flag the post date to be edited.
$post_data['edit_date'] = true;
Expand Down Expand Up @@ -3837,9 +3837,10 @@ public function wp_editComment( $args ) {
// Do some timestamp voodoo.
if ( ! empty( $content_struct['date_created_gmt'] ) ) {
// We know this is supposed to be GMT, so we're going to slap that Z on there by force.
$dateCreated = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z';
$comment['comment_date'] = get_date_from_gmt( $dateCreated );
$comment['comment_date_gmt'] = iso8601_to_datetime( $dateCreated, 'gmt' );
$date_created = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z';

$comment['comment_date'] = get_date_from_gmt( $date_created );
$comment['comment_date_gmt'] = iso8601_to_datetime( $date_created, 'gmt' );
}

if ( isset( $content_struct['content'] ) ) {
Expand Down Expand Up @@ -5571,16 +5572,16 @@ public function mw_newPost( $args ) {
// Do some timestamp voodoo.
if ( ! empty( $content_struct['date_created_gmt'] ) ) {
// We know this is supposed to be GMT, so we're going to slap that Z on there by force.
$dateCreated = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z';
$date_created = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z';
} elseif ( ! empty( $content_struct['dateCreated'] ) ) {
$dateCreated = $content_struct['dateCreated']->getIso();
$date_created = $content_struct['dateCreated']->getIso();
}

$post_date = '';
$post_date_gmt = '';
if ( ! empty( $dateCreated ) ) {
$post_date = iso8601_to_datetime( $dateCreated );
$post_date_gmt = iso8601_to_datetime( $dateCreated, 'gmt' );
if ( ! empty( $date_created ) ) {
$post_date = iso8601_to_datetime( $date_created );
$post_date_gmt = iso8601_to_datetime( $date_created, 'gmt' );
}

$post_category = array();
Expand Down Expand Up @@ -5958,17 +5959,17 @@ public function mw_editPost( $args ) {
// Do some timestamp voodoo.
if ( ! empty( $content_struct['date_created_gmt'] ) ) {
// We know this is supposed to be GMT, so we're going to slap that Z on there by force.
$dateCreated = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z';
$date_created = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z';
} elseif ( ! empty( $content_struct['dateCreated'] ) ) {
$dateCreated = $content_struct['dateCreated']->getIso();
$date_created = $content_struct['dateCreated']->getIso();
}

// Default to not flagging the post date to be edited unless it's intentional.
$edit_date = false;

if ( ! empty( $dateCreated ) ) {
$post_date = iso8601_to_datetime( $dateCreated );
$post_date_gmt = iso8601_to_datetime( $dateCreated, 'gmt' );
if ( ! empty( $date_created ) ) {
$post_date = iso8601_to_datetime( $date_created );
$post_date_gmt = iso8601_to_datetime( $date_created, 'gmt' );

// Flag the post date to be edited.
$edit_date = true;
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.8-alpha-59663';
$wp_version = '6.8-alpha-59664';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit 78ee687

Please sign in to comment.