WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/08/2020 09:13:57 PM (13 months 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-admin/includes/plugin.php

    r49096 r49108  
    13481348    if ( null === $position ) {
    13491349        $menu[] = $new_menu;
    1350     } elseif ( isset( $menu[ "$position" ] ) ) {
    1351         $position            = $position + substr( base_convert( md5( $menu_slug . $menu_title ), 16, 10 ), -5 ) * 0.00001;
    1352         $menu[ "$position" ] = $new_menu;
    13531350    } else {
     1351        if ( isset( $menu[ $position ] ) ) {
     1352            $position = $position + substr( base_convert( md5( $menu_slug . $menu_title ), 16, 10 ), -5 ) * 0.00001;
     1353        }
     1354
    13541355        $menu[ $position ] = $new_menu;
    13551356    }
Note: See TracChangeset for help on using the changeset viewer.