Skip to content

Commit 8559f24

Browse files
Coding Standards: Pass true instead of 1 to current_time() for consistency.
This matches the documented type of `bool` for the `$gmt` parameter. Follow-up to [60119]. Props johnbillion, dilipbheda. Fixes #63207. git-svn-id: https://develop.svn.wordpress.org/trunk@60235 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 33e9b64 commit 8559f24

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

src/wp-admin/edit-comments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@
439439
<input type="hidden" name="p" value="<?php echo esc_attr( (int) $post_id ); ?>" />
440440
<?php endif; ?>
441441
<input type="hidden" name="comment_status" value="<?php echo esc_attr( $comment_status ); ?>" />
442-
<input type="hidden" name="pagegen_timestamp" value="<?php echo esc_attr( current_time( 'mysql', 1 ) ); ?>" />
442+
<input type="hidden" name="pagegen_timestamp" value="<?php echo esc_attr( current_time( 'mysql', true ) ); ?>" />
443443

444444
<input type="hidden" name="_total" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg( 'total_items' ) ); ?>" />
445445
<input type="hidden" name="_per_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg( 'per_page' ) ); ?>" />

src/wp-admin/includes/upgrade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ function wp_install_defaults( $user_id ) {
208208

209209
// First post.
210210
$now = current_time( 'mysql' );
211-
$now_gmt = current_time( 'mysql', 1 );
211+
$now_gmt = current_time( 'mysql', true );
212212
$first_post_guid = get_option( 'home' ) . '/?p=1';
213213

214214
if ( is_multisite() ) {

src/wp-includes/class-wp-xmlrpc-server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5152,7 +5152,7 @@ public function blogger_newPost( $args ) {
51525152
$post_content = xmlrpc_removepostdata( $content );
51535153

51545154
$post_date = current_time( 'mysql' );
5155-
$post_date_gmt = current_time( 'mysql', 1 );
5155+
$post_date_gmt = current_time( 'mysql', true );
51565156

51575157
$post_data = compact(
51585158
'post_author',

src/wp-includes/comment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2319,7 +2319,7 @@ function wp_new_comment( $commentdata, $wp_error = false ) {
23192319
}
23202320

23212321
if ( empty( $commentdata['comment_date_gmt'] ) ) {
2322-
$commentdata['comment_date_gmt'] = current_time( 'mysql', 1 );
2322+
$commentdata['comment_date_gmt'] = current_time( 'mysql', true );
23232323
}
23242324

23252325
if ( empty( $commentdata['comment_type'] ) ) {

src/wp-includes/post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4623,7 +4623,7 @@ function wp_insert_post( $postarr, $wp_error = false, $fire_after_hooks = true )
46234623

46244624
if ( $update || '0000-00-00 00:00:00' === $post_date ) {
46254625
$post_modified = current_time( 'mysql' );
4626-
$post_modified_gmt = current_time( 'mysql', 1 );
4626+
$post_modified_gmt = current_time( 'mysql', true );
46274627
} else {
46284628
$post_modified = $post_date;
46294629
$post_modified_gmt = $post_date_gmt;

tests/phpunit/tests/comment/query.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3001,7 +3001,7 @@ public function test_orderby_array_should_sort_by_comment_ID_DESC_as_fallback_wh
30013001
* @covers WP_Comment_Query::query
30023002
*/
30033003
public function test_orderby_date_modified_gmt_should_order_by_comment_ID_in_case_of_tie_ASC() {
3004-
$now = current_time( 'mysql', 1 );
3004+
$now = current_time( 'mysql', true );
30053005
$comments = self::factory()->comment->create_many(
30063006
5,
30073007
array(
@@ -3028,7 +3028,7 @@ public function test_orderby_date_modified_gmt_should_order_by_comment_ID_in_cas
30283028
* @covers WP_Comment_Query::query
30293029
*/
30303030
public function test_orderby_date_modified_gmt_should_order_by_comment_ID_in_case_of_tie_DESC() {
3031-
$now = current_time( 'mysql', 1 );
3031+
$now = current_time( 'mysql', true );
30323032
$comments = self::factory()->comment->create_many(
30333033
5,
30343034
array(

0 commit comments

Comments
 (0)