Make WordPress Core

Changeset 60235


Ignore:
Timestamp:
05/14/2025 11:57:21 AM (7 months ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-comments.php

    r56600 r60235  
    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' ) ); ?>" />
  • trunk/src/wp-admin/includes/upgrade.php

    r60111 r60235  
    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
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r60175 r60235  
    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(
  • trunk/src/wp-includes/comment.php

    r59975 r60235  
    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
  • trunk/src/wp-includes/post.php

    r60102 r60235  
    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;
  • trunk/tests/phpunit/tests/comment/query.php

    r57750 r60235  
    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,
     
    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,
Note: See TracChangeset for help on using the changeset viewer.