WordPress.org

Make WordPress Core

Ticket #16856: 16856.diff

File 16856.diff, 795 bytes (added by kawauso, 4 years ago)

is_numeric() check

  • wp-admin/menu.php

     
    112112        // Check if it should be a submenu. 
    113113        if ( $ptype_obj->show_in_menu !== true ) 
    114114                continue; 
    115         $ptype_menu_position = is_int( $ptype_obj->menu_position ) ? $ptype_obj->menu_position : ++$_wp_last_object_menu; // If we're to use $_wp_last_object_menu, increment it first. 
     115        $ptype_menu_position = is_numeric( $ptype_obj->menu_position ) ? $ptype_obj->menu_position : ++$_wp_last_object_menu; // If we're to use $_wp_last_object_menu, increment it first. 
    116116        $ptype_for_id = sanitize_html_class( $ptype ); 
    117117        if ( is_string( $ptype_obj->menu_icon ) ) { 
    118118                $menu_icon   = esc_url( $ptype_obj->menu_icon );