ubermenu_configuration_id

Knowledgebase Docs » UberMenu 3
USEFUL? 2
UberMenu 3

The ubermenu_configuration_id filter allows you to filter which Configuration is used to display a menu.

Example

Let’s say you have a menu integrated with the main configuration, but want to change the configuration used for the menu used on a specific page.

Example code:

In this example, we’ll change the configuration on the front page to the configuration with the ID “homepage”. Note that if you have multiple menus, you’ll want to check which menu you’re targeting conditionally

add_filter( 'ubermenu_configuration_id' , 'um_filter_config' , 10 , 5 );
function um_filter_config( $config_id, $args ){

   // Change the configuration on the front page
   if( is_front_page() ){
      $config_id = 'homepage';
   }
   return $config_id;
}

ubermenu_configuration_id

Your registered callback will be called once for each instance of UberMenu.

$config_id
The ID of the UberMenu Configuration currently in use for this menu
$args
The arguments passed to the menu – see wp_nav_menu()