Make WordPress Core

Ticket #48249: 48249.2.diff

File 48249.2.diff, 845 bytes (added by desrosj, 5 years ago)
  • src/wp-admin/includes/plugin.php

     
    13731373        }
    13741374
    13751375        $new_sub_menu = array( $menu_title, $capability, $menu_slug, $page_title );
    1376         if ( null === $position ) {
     1376        if ( ! is_int( $position ) ) {
     1377                if ( null !== $position ) {
     1378                        _doing_it_wrong(
     1379                                __FUNCTION__,
     1380                                sprintf(
     1381                                        /* translators: %s: add_submenu_page() */
     1382                                        __( 'The seventh parameter passed to %s should be an integer representing menu position.' ),
     1383                                        '<code>add_submenu_page()</code>'
     1384                                ),
     1385                                '5.3.0'
     1386                        );
     1387                }
     1388
    13771389                $submenu[ $parent_slug ][] = $new_sub_menu;
    13781390        } else {
    13791391                // If position is equal or higher than the number of items in the array, append the submenu.