menu_order not working with slugs that start with admin.php

Remove ‘admin.php?page=” from those values.

“admin.php?page=custom_settings_page’ should be ‘custom_settings_page’

‘admin.php?page=gf_edit_forms’ should be ‘gf_edit_forms’

Values that start with admin.php only have their parameter set in the global default menu order array (global $default_menu_order).

So when the sort occurs between your custom menu order array and the global default menu menu order array, it won’t correctly match the entries that start with admin.php.

The default behavior is for anything that’s not in your custom array to be added to the bottom.

Corrected code:

//change admin menu order
add_filter('custom_menu_order', 'my_custom_menu_order'); // Activate custom_menu_order
add_filter('menu_order', 'my_custom_menu_order');

function my_custom_menu_order($menu_ord){

    if(!$menu_ord) return true;
    return array(
        'index.php', //dashboard
        'separator1', //first separator
        'edit.php', //posts
        'edit.php?post_type=custom_post_type1', //custom post type 1
        'edit.php?post_type=custom_post_type2', //custom post type 2
        'edit.php?post_type=custom_post_type3', //custom post type 3
        'upload.php', //media
        'separator2', //second separator
        'gf_edit_forms', //fixed
        'edit.php?post_type=page', //pages
        'edit-comments.php', //comments
        'separator-last', //last separator
        'themes.php', //appearance
        'custom_settings_page', //fixed
        'plugins.php', //plugins
        'users.php', //users
        'tools.php', //tools
        'options-general.php' //WordPress options
    );

}