Make WordPress Core


Ignore:
Timestamp:
10/08/2020 09:13:57 PM (4 years ago)
Author:
SergeyBiryukov
Message:

General: Replace older-style PHP type conversion functions with type casts.

This improves performance, readability, and consistency throughout core.

  • intval()(int)
  • strval()(string)
  • floatval()(float)

Props ayeshrajans.
Fixes #42918.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/customize/class-wp-customize-date-time-control.php

    r48067 r49108  
    8282        $data = parent::json();
    8383
    84         $data['maxYear']          = intval( $this->max_year );
    85         $data['minYear']          = intval( $this->min_year );
     84        $data['maxYear']          = (int) $this->max_year;
     85        $data['minYear']          = (int) $this->min_year;
    8686        $data['allowPastDate']    = (bool) $this->allow_past_date;
    8787        $data['twelveHourFormat'] = (bool) $this->twelve_hour_format;
     
    246246            }
    247247        } else {
    248             $formatted_gmt_offset = $this->format_gmt_offset( intval( get_option( 'gmt_offset', 0 ) ) );
     248            $formatted_gmt_offset = $this->format_gmt_offset( (int) get_option( 'gmt_offset', 0 ) );
    249249
    250250            $timezone_info['description'] = sprintf(
Note: See TracChangeset for help on using the changeset viewer.