Output the admin menu_position for each item

I’ve just finished a plugin that (amongst other things) allows the reordering of the admin menu. The way the admin menu is constructed is not the easiest thing to work with at all. That being said have a look at the admin_menu hook. You can access the global $menu array at that point – which is an array containing each menu item – each of which is an array containing all the details of that item. You can then do something like:

/**
 * Prints the global $menu array
 * The elements in each item array are :
 * 0: Menu title
 * 1: Minimum level or capability required.
 * 2: The URL of the item's file
 * 3: Page Title
 * 4: Classes
 * 5: ID
 * 6: Icon for top level menu
 *
 * @global array $menu
 */
add_action( 'admin_menu', 'wpse_217154_print_admin_menu', 10 );
function wpse_217154_print_admin_menu() {

    global $menu;

    echo '<pre>';
    print_r($menu);
    echo '</pre>';
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)