0

Im trying to reorder the Wordpress admin menu but im running into issues with WooCommerce and one other plugin. They are "admin.php?page=wc-admin" links and they do not seem to want to move.

I have tried both the direct links from wp-admin like "admin.php?page=wc-admin" and also just the name like "wc-admin" but none work?

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

    return array(
        'index.php', // Dashboard
        'separator1', // First separator
        'edit.php?post_type=page', // Pages 
        'edit.php', // Posts    
        'gf_edit_forms', // Gravity Forms
        'upload.php', // Media
        'separator2', // Second separator
        'edit.php?post_type=class', // Classes Post Type
        'admin.php?page=mec-intro', // ME Cal Plugin
        'edit.php?post_type=mec_rsvp', // M.E Cal Plugin
        'edit.php?post_type=mec-books', // M.E Cal Plugin
        'edit.php?post_type=instructor', // Instructors Post Type
        'separator3', // Third separator
        'wc-admin', //Woo Commerce 
        'edit.php?post_type=product', //Woo Commerce Products
        'admin.php?page=wc-admin&path=/fanalytic/foverview', //Woo Commerce Analytics
        'admin.php?page=wc-admin&path=/fmarketing', // Woo Commerce Marketing
        'separator-last', // Last separator
        'avia', // Theme Options
        'themes.php', // Appearance
        'plugins.php', // Plugins    
        'users.php', // Users
        'tools.php', // Tools
        'options-general.php', // Settings
    );
}
add_filter( 'custom_menu_order', 'wpse_custom_menu_order', 10, 1 );
add_filter( 'menu_order', 'wpse_custom_menu_order', 10, 1 );
New contributor
Dan Crowe is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
2
  • have you asked this in a WooCommerce community? You can't ask about or for help with 3rd party products/plugins/themes here, they're off topic and not in this stacks scope.
    – Tom J Nowell
    Mar 16 at 18:26
  • Case in point, answering this requires someone to open up the woocommerce source code and find where they added their menu item with add_menu_page so that they can tell you the ID/slug the menu was registered with. If it can be answered here without touching or knowing anything about WooCommerce then it can be reopened, but that sounds implausible
    – Tom J Nowell
    Mar 16 at 18:28

0