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/class-wp-network-query.php

    r48986 r49108  
    261261        if ( $this->query_vars['count'] ) {
    262262            // $network_ids is actually a count in this case.
    263             return intval( $network_ids );
     263            return (int) $network_ids;
    264264        }
    265265
     
    470470
    471471        if ( $this->query_vars['count'] ) {
    472             return intval( $wpdb->get_var( $this->request ) );
     472            return (int) $wpdb->get_var( $this->request );
    473473        }
    474474
Note: See TracChangeset for help on using the changeset viewer.