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/tests/phpunit/tests/customize/partial.php

    r48939 r49108  
    6767    function render_post_content_partial( $partial ) {
    6868        $id_data = $partial->id_data();
    69         $post_id = intval( $id_data['keys'][0] );
     69        $post_id = (int) $id_data['keys'][0];
    7070        if ( empty( $post_id ) ) {
    7171            return false;
Note: See TracChangeset for help on using the changeset viewer.