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-site-query.php

    r48986 r49108  
    352352        if ( $this->query_vars['count'] ) {
    353353            // $site_ids is actually a count in this case.
    354             return intval( $site_ids );
     354            return (int) $site_ids;
    355355        }
    356356
     
    661661
    662662        if ( $this->query_vars['count'] ) {
    663             return intval( $wpdb->get_var( $this->request ) );
     663            return (int) $wpdb->get_var( $this->request );
    664664        }
    665665
Note: See TracChangeset for help on using the changeset viewer.