Make WordPress Core

Ticket #47842: #47842.2.patch

File #47842.2.patch, 1.7 KB (added by sharaz, 6 years ago)
  • class-wp-debug-data.php

     
    4141                $is_multisite           = is_multisite();
    4242                $core_version           = get_bloginfo( 'version' );
    4343                $core_updates           = get_core_updates();
     44                $core_gmt_offset        = get_option( 'gmt_offset' );
    4445                $core_update_needed     = '';
    4546
     47                $gmt_offset_string = '';
     48                if ( ! empty( $core_gmt_offset ) ) {
     49                        if ( 0 == $core_gmt_offset ) {
     50                                $gmt_offset_string = 'UTC+0';
     51                        } elseif ( $core_gmt_offset < 0 ) {
     52                                $gmt_offset_string = 'UTC' . $core_gmt_offset;
     53                        } else {
     54                                $gmt_offset_string = 'UTC+' . $core_gmt_offset;
     55                        }
     56                        $gmt_offset_string = str_replace( array( '.25', '.5', '.75' ), array( ':15', ':30', ':45' ), $gmt_offset_string );
     57                }
     58
    4659                foreach ( $core_updates as $core => $update ) {
    4760                        if ( 'upgrade' === $update->response ) {
    4861                                // translators: %s: Latest WordPress version number.
     
    106119                                        'value' => $is_multisite ? __( 'Yes' ) : __( 'No' ),
    107120                                        'debug' => $is_multisite,
    108121                                ),
     122                                'core_timezone'        => array(
     123                                        'label' => __( 'Site Timezone Offset' ),
     124                                        'value' => $core_gmt_offset ? $gmt_offset_string : __( 'Undefined' ),
     125                                        'debug' => $core_gmt_offset ? $gmt_offset_string : __( 'undefined' ),
     126                                ),
    109127                        ),
    110128                );
    111129
     
    10991117         *
    11001118         * @since 5.2.0
    11011119         *
    1102          * @param array $info_array Information gathered from the `WP_Debug_Data::debug_data` function.
     1120         * @param array  $info_array Information gathered from the `WP_Debug_Data::debug_data` function.
    11031121         * @param string $type      The data type to return, either 'info' or 'debug'.
    11041122         * @return string The formatted data.
    11051123         */