mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Coding Standards: Remove some extra whitespace in _wp_translate_postdata().
See #52627. git-svn-id: https://develop.svn.wordpress.org/trunk@50618 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ac322e8d70
commit
4a8aefaf72
@ -169,24 +169,27 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
|
||||
}
|
||||
|
||||
if ( ! empty( $post_data['edit_date'] ) ) {
|
||||
$aa = $post_data['aa'];
|
||||
$mm = $post_data['mm'];
|
||||
$jj = $post_data['jj'];
|
||||
$hh = $post_data['hh'];
|
||||
$mn = $post_data['mn'];
|
||||
$ss = $post_data['ss'];
|
||||
$aa = ( $aa <= 0 ) ? gmdate( 'Y' ) : $aa;
|
||||
$mm = ( $mm <= 0 ) ? gmdate( 'n' ) : $mm;
|
||||
$jj = ( $jj > 31 ) ? 31 : $jj;
|
||||
$jj = ( $jj <= 0 ) ? gmdate( 'j' ) : $jj;
|
||||
$hh = ( $hh > 23 ) ? $hh - 24 : $hh;
|
||||
$mn = ( $mn > 59 ) ? $mn - 60 : $mn;
|
||||
$ss = ( $ss > 59 ) ? $ss - 60 : $ss;
|
||||
$aa = $post_data['aa'];
|
||||
$mm = $post_data['mm'];
|
||||
$jj = $post_data['jj'];
|
||||
$hh = $post_data['hh'];
|
||||
$mn = $post_data['mn'];
|
||||
$ss = $post_data['ss'];
|
||||
$aa = ( $aa <= 0 ) ? gmdate( 'Y' ) : $aa;
|
||||
$mm = ( $mm <= 0 ) ? gmdate( 'n' ) : $mm;
|
||||
$jj = ( $jj > 31 ) ? 31 : $jj;
|
||||
$jj = ( $jj <= 0 ) ? gmdate( 'j' ) : $jj;
|
||||
$hh = ( $hh > 23 ) ? $hh - 24 : $hh;
|
||||
$mn = ( $mn > 59 ) ? $mn - 60 : $mn;
|
||||
$ss = ( $ss > 59 ) ? $ss - 60 : $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 ) {
|
||||
return new WP_Error( 'invalid_date', __( 'Invalid 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.
|
||||
unset( $post_data['filter'] );
|
||||
|
||||
$post_ID = (int) $post_data['post_ID'];
|
||||
$post = get_post( $post_ID );
|
||||
$post_ID = (int) $post_data['post_ID'];
|
||||
$post = get_post( $post_ID );
|
||||
|
||||
$post_data['post_type'] = $post->post_type;
|
||||
$post_data['post_mime_type'] = $post->post_mime_type;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user