PHP API

Knowledgebase Docs » UberMenu 3
USEFUL? 2
UberMenu 3

The ubermenu() function

The ubermenu() function takes two parameters.

ubermenu( $config_id , $args );

$config_id (optional, defaults to ‘main’)

The first parameter $config_id, is the ID of the configuration you’re using for this UberMenu. The default configuration is 'main'. (You can add additional Configurations in the UberMenu Control Panel).

The Configuration determines the global properties of the menu, like the skin, transition, trigger, etc.

$args (optional)

The second parameter, $args, is an array of arguments that will be passed to wp_nav_menu().

While most of these settings will be controlled by UberMenu, this array allows you to specific a specific theme_location or menu when using the API, which will override settings from the Configuration.

Examples

Display an UberMenu with the main configuration using its default Menu
<?php ubermenu(); ?>

or

<?php ubermenu( 'main' ); ?>
Display an UberMenu with the main configuration for the menu with slug ‘secondary’
<?php ubermenu( 'main' , array( 
  'menu' => 'secondary'
) ); ?>
Display an UberMenu with the “custom_blue” configuration for the theme location ‘primary’
<?php ubermenu( 'custom_blue' , array(
  'theme_location' => 'primary'
) ); ?>

Generation

Note that you can generate basic API code in the UberMenu Control Panel > {Configuration} > Integration > Manual Integration