Make WordPress Core


Ignore:
Timestamp:
10/08/2020 09:13:57 PM (6 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-term-query.php

    r48985 r49108  
    259259
    260260                // 'parent' overrides 'child_of'.
    261                 if ( 0 < intval( $query['parent'] ) ) {
     261                if ( 0 < (int) $query['parent'] ) {
    262262                        $query['child_of'] = false;
    263263                }
    … …  
    347347
    348348                // 'parent' overrides 'child_of'.
    349                 if ( 0 < intval( $args['parent'] ) ) {
     349                if ( 0 < (int) $args['parent'] ) {
    350350                        $args['child_of'] = false;
    351351                }
    … …  
    444444                                                array(
    445445                                                        'taxonomy'   => reset( $taxonomies ),
    446                                                         'child_of'   => intval( $extrunk ),
     446                                                        'child_of'   => (int) $extrunk,
    447447                                                        'fields'     => 'ids',
    448448                                                        'hide_empty' => 0,
Note: See TracChangeset for help on using the changeset viewer.