Reorder Menus in the Side Menu Panel

By default, SuperSide Me adds menus to the menu panel in the order in which they are registered. A typical order might be:

  1. SuperSide Me Navigation Menu (registered by the plugin for use only in the panel)
  2. Primary Navigation Menu
  3. Secondary Navigation Menu
  4. Footer Navigation Menu

It’s absolutely possible to change this order using a filter. Here’s an example, which changes the order to Footer (4), Primary (2), SuperSide Me (1), Secondary (3):

<?php
add_filter( 'supersideme_get_menus', 'prefix_get_supersideme_menus' );
/**
* Replace and reorder the array of navigational menus in the SuperSide Me menu panel.
* @param $menus
*
* @return array
*/
function prefix_get_supersideme_menus( $menus ) {
return array(
'footer' => 'Footer Navigation Menu',
'primary' => 'Primary Navigation Menu',
'supersideme' => 'SuperSide Me Navigation Menu',
'secondary' => 'Secondary Navigation Menu',
);
}
view raw functions.php hosted with ❤ by GitHub

Note: this only changes the order in which the menus are added to the panel. If a menu location does not have a menu assigned to it, nothing will be added to the panel. So, it’s possible to set your custom order and include a navigation menu location which does not currently have a menu assigned, but which someday may.

Return to SuperSide Me
Bars Code Check chevron-down chevron-left chevron-right chevron-up Envelope Laptop Search Times Facebook GitHub Google Plus Instagram LinkedIn Pinterest Twitter WordPress Logo Wordpress Simple