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/meta.php

    r48778 r49108  
    723723    }
    724724
    725     $meta_id = intval( $meta_id );
     725    $meta_id = (int) $meta_id;
    726726    if ( $meta_id <= 0 ) {
    727727        return false;
     
    787787    }
    788788
    789     $meta_id = intval( $meta_id );
     789    $meta_id = (int) $meta_id;
    790790    if ( $meta_id <= 0 ) {
    791791        return false;
     
    902902    }
    903903
    904     $meta_id = intval( $meta_id );
     904    $meta_id = (int) $meta_id;
    905905    if ( $meta_id <= 0 ) {
    906906        return false;
     
    10631063    if ( ! empty( $meta_list ) ) {
    10641064        foreach ( $meta_list as $metarow ) {
    1065             $mpid = intval( $metarow[ $column ] );
     1065            $mpid = (int) $metarow[ $column ];
    10661066            $mkey = $metarow['meta_key'];
    10671067            $mval = $metarow['meta_value'];
Note: See TracChangeset for help on using the changeset viewer.