Reorder plugin items in the admin menu

Try taking just the name from the page admin link and see if it works. Something like this:

function custom_menu_order($menu_ord) {
    if (!$menu_ord) return true;

    return array(
        'index.php', // Dashboard
        'separator1', // First separator
        'edit.php', // Posts

        'pluginname2', // Take the name from the page menu admin.php?page=pluginname2

        'upload.php', // Media
        'edit.php?post_type=page', // Pages
        'edit-comments.php', // Comments

        'pluginname', // Take the name from the page menu admin.php?page=pluginname

    );
}
add_filter('custom_menu_order', 'custom_menu_order'); // Activate custom_menu_order
add_filter('menu_order', 'custom_menu_order');

Leave a Comment