Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is it possible to reorder plugin menu items and custom admin items in the Admin menu without modifying the position in the plugin itself?

I've tried using the method described here "Changing the Menu Order", but when you add a page link like admin.php?page=pluginname, it doesn't do anything. Guessing because it can't overwrite the position defined within the plugin.

The Admin Menu Editor plugin works alright, but needing a plugin-less method to handle it to satisfy the higher-powers. :/

Anyone know of a way to get at this? Any help would be hugely appreciated!

share|improve this question
    
Post the code you've tried please, even if it doesn't work. –  s_ha_dum Jun 7 '13 at 21:57

1 Answer 1

up vote 1 down vote accepted

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');
share|improve this answer
    
Ha! It's always something simple, isn't it! Many thanks there @Syrehn! –  Ryan Palmer Jun 8 '13 at 4:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.