Make WordPress Core


Ignore:
Timestamp:
10/08/2020 09:13:57 PM (5 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-admin/includes/class-wp-ms-sites-list-table.php

    r48782 r49108  
    104104
    105105        $args = array(
    106             'number'     => intval( $per_page ),
    107             'offset'     => intval( ( $pagenum - 1 ) * $per_page ),
     106            'number'     => (int) $per_page,
     107            'offset'     => (int) ( ( $pagenum - 1 ) * $per_page ),
    108108            'network_id' => get_current_network_id(),
    109109        );
     
    621621        $site_status = isset( $_REQUEST['status'] ) ? wp_unslash( trim( $_REQUEST['status'] ) ) : '';
    622622        foreach ( $this->status_list as $status => $col ) {
    623             if ( ( 1 === intval( $_site->{$status} ) ) && ( $site_status !== $status ) ) {
     623            if ( ( 1 === (int) $_site->{$status} ) && ( $site_status !== $status ) ) {
    624624                $site_states[ $col[0] ] = $col[1];
    625625            }
Note: See TracChangeset for help on using the changeset viewer.