Coding Standards: Remove some extra whitespace in `_wp_translate_postdata()`.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50618


git-svn-id: http://core.svn.wordpress.org/trunk@50231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-03-30 15:19:03 +00:00
parent 85c90c4e01
commit f701ad4999
2 changed files with 21 additions and 17 deletions

View File

@ -169,24 +169,27 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
} }
if ( ! empty( $post_data['edit_date'] ) ) { if ( ! empty( $post_data['edit_date'] ) ) {
$aa = $post_data['aa']; $aa = $post_data['aa'];
$mm = $post_data['mm']; $mm = $post_data['mm'];
$jj = $post_data['jj']; $jj = $post_data['jj'];
$hh = $post_data['hh']; $hh = $post_data['hh'];
$mn = $post_data['mn']; $mn = $post_data['mn'];
$ss = $post_data['ss']; $ss = $post_data['ss'];
$aa = ( $aa <= 0 ) ? gmdate( 'Y' ) : $aa; $aa = ( $aa <= 0 ) ? gmdate( 'Y' ) : $aa;
$mm = ( $mm <= 0 ) ? gmdate( 'n' ) : $mm; $mm = ( $mm <= 0 ) ? gmdate( 'n' ) : $mm;
$jj = ( $jj > 31 ) ? 31 : $jj; $jj = ( $jj > 31 ) ? 31 : $jj;
$jj = ( $jj <= 0 ) ? gmdate( 'j' ) : $jj; $jj = ( $jj <= 0 ) ? gmdate( 'j' ) : $jj;
$hh = ( $hh > 23 ) ? $hh - 24 : $hh; $hh = ( $hh > 23 ) ? $hh - 24 : $hh;
$mn = ( $mn > 59 ) ? $mn - 60 : $mn; $mn = ( $mn > 59 ) ? $mn - 60 : $mn;
$ss = ( $ss > 59 ) ? $ss - 60 : $ss; $ss = ( $ss > 59 ) ? $ss - 60 : $ss;
$post_data['post_date'] = sprintf( '%04d-%02d-%02d %02d:%02d:%02d', $aa, $mm, $jj, $hh, $mn, $ss ); $post_data['post_date'] = sprintf( '%04d-%02d-%02d %02d:%02d:%02d', $aa, $mm, $jj, $hh, $mn, $ss );
$valid_date = wp_checkdate( $mm, $jj, $aa, $post_data['post_date'] );
$valid_date = wp_checkdate( $mm, $jj, $aa, $post_data['post_date'] );
if ( ! $valid_date ) { if ( ! $valid_date ) {
return new WP_Error( 'invalid_date', __( 'Invalid date.' ) ); return new WP_Error( 'invalid_date', __( 'Invalid date.' ) );
} }
$post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] ); $post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] );
} }
@ -246,8 +249,9 @@ function edit_post( $post_data = null ) {
// Clear out any data in internal vars. // Clear out any data in internal vars.
unset( $post_data['filter'] ); unset( $post_data['filter'] );
$post_ID = (int) $post_data['post_ID']; $post_ID = (int) $post_data['post_ID'];
$post = get_post( $post_ID ); $post = get_post( $post_ID );
$post_data['post_type'] = $post->post_type; $post_data['post_type'] = $post->post_type;
$post_data['post_mime_type'] = $post->post_mime_type; $post_data['post_mime_type'] = $post->post_mime_type;

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.8-alpha-50617'; $wp_version = '5.8-alpha-50618';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.