How can I reorder active menu items programmatically?
You need to use hook_menu_alter.

Make sure you declare the function with the &amp; in front of items argument, this is what allows the function to modify the $items array passed to the function:

function MYMODULE_menu_alter(&amp;$items)


In your function you can access every menu item in an array structure like so:

   $items['node/%/edit/schedulenew'] = array(
            'title' =&gt; 'Schedule1',
            'access callback'=&gt;'user_access',
            'access arguments'=&gt;array('view cssswitch'),
            'page callback' =&gt; 'cssswitch_schedule',
            'page arguments' =&gt; array(1),
            'type' =&gt; MENU_LOCAL_TASK,
            'weight'=&gt;4,
        );


If you just redefine the 'weight' property, it will allow you to re-order your menus.


Be sure to clear your cache after each menu changes, or go to the menu page, load the menu edit page and save it, this also rebuilds the menu.