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/comment-template.php

    r48929 r49108  
    605605
    606606    /* translators: Maximum number of words used in a comment excerpt. */
    607     $comment_excerpt_length = intval( _x( '20', 'comment_excerpt_length' ) );
     607    $comment_excerpt_length = (int) _x( '20', 'comment_excerpt_length' );
    608608
    609609    /**
     
    22062206    }
    22072207    // Validation check.
    2208     $parsed_args['page'] = intval( $parsed_args['page'] );
     2208    $parsed_args['page'] = (int) $parsed_args['page'];
    22092209    if ( 0 == $parsed_args['page'] && 0 != $parsed_args['per_page'] ) {
    22102210        $parsed_args['page'] = 1;
Note: See TracChangeset for help on using the changeset viewer.