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/class-wp-customize-manager.php

    r49076 r49108  
    14641464                );
    14651465                if ( $can_reuse ) {
    1466                     $nav_menu_term_id              = intval( $matches['nav_menu_id'] );
     1466                    $nav_menu_term_id              = (int) $matches['nav_menu_id'];
    14671467                    $nav_menu_setting_id           = $setting_id;
    14681468                    $reused_nav_menu_setting_ids[] = $setting_id;
     
    32693269
    32703270        if ( $lock && ! empty( $lock[1] ) ) {
    3271             $user_id         = intval( $lock[1] );
     3271            $user_id         = (int) $lock[1];
    32723272            $current_user_id = get_current_user_id();
    32733273            if ( $user_id === $current_user_id ) {
Note: See TracChangeset for help on using the changeset viewer.