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/rest-api/endpoints/class-wp-rest-block-renderer-controller.php

    r48982 r49108  
    110110        global $post;
    111111
    112         $post_id = isset( $request['post_id'] ) ? intval( $request['post_id'] ) : 0;
     112        $post_id = isset( $request['post_id'] ) ? (int) $request['post_id'] : 0;
    113113
    114114        if ( 0 < $post_id ) {
     
    150150        global $post;
    151151
    152         $post_id = isset( $request['post_id'] ) ? intval( $request['post_id'] ) : 0;
     152        $post_id = isset( $request['post_id'] ) ? (int) $request['post_id'] : 0;
    153153
    154154        if ( 0 < $post_id ) {
Note: See TracChangeset for help on using the changeset viewer.