'Menu', 'icon_class' => 'bars', 'tag' => 'a', 'skin' => '', 'toggle_id' => '', 'content_align' => 'left', 'align' => 'full', 'classes' => '', ))); //responsive_toggle_text if( !$skin && $config_id ){ $skin = ubermenu_op( 'skin' , $config_id ); } $class = 'ubermenu-responsive-toggle'; if( $config_id ) $class.= ' ubermenu-responsive-toggle-'.$config_id; if( $skin ) $class.= ' ubermenu-skin-'.$skin; if( isset( $args['theme_location'] ) )$class.= ' ubermenu-loc-'.sanitize_title( $args['theme_location'] ); $class.= ' ubermenu-responsive-toggle-content-align-'.$content_align; $class.= ' ubermenu-responsive-toggle-align-'.$align; if( !$toggle_content ) $class.= ' ubermenu-responsive-toggle-icon-only'; $id = ''; if( $toggle_id ) $id = ' id="'.$toggle_id.'" '; $class.= ' '.$classes; $class = apply_filters( 'ubermenu_toggle_class' , $class , $config_id ); $toggle = '<'.$tag . $id.' class="'.$class.'" data-ubermenu-target="'. $target.'">'; if( $icon_class ) $toggle.= ''; if( $toggle_content ) $toggle.= $toggle_content; $toggle.= ''; if( $echo ) echo $toggle; return $toggle; } function ubermenu_toggle_shortcode( $atts, $content ){ extract( shortcode_atts( array( 'instance_id' => '', 'config_id' => 'main', 'target' => '_any_', 'toggle_id' => '', 'tag' => 'a', 'icon_class' => 'bars', 'skin' => '', ), $atts, 'ubermenu_toggle' ) ); //If an instance_id (deprecated) was passed, use it as the config_id if( $instance_id != '' ) $config_id = $instance_id; $args = array(); if( $content ) $args['toggle_content'] = $content; $args['icon_class'] = $icon_class; $args['tag'] = $tag; $args['skin'] = $skin; $toggle = ubermenu_toggle( $target , $config_id , false , $args ); return $toggle; } add_shortcode( 'ubermenu_toggle' , 'ubermenu_toggle_shortcode' ); function uberMenu_direct( $theme_location = 'ubermenu' , $filter = true , $echo = true , $args = array() , $config_id = 'main' ){ $args['theme_location'] = $theme_location; $args['filter'] = $filter; $args['echo'] = $echo; return ubermenu( $config_id , $args ); } function uberMenu_easyIntegrate( $config_id = 'main' , $args = array() ){ //Check that Easy Integration is enabled if( ubermenu_op( 'ubermenu_theme_location' , 'general' ) != 'on' ){ $msg = 'To use Easy Integration, please enable the Register Easy Integration UberMenu Theme Location setting in the UberMenu Control Panel > General Settings > Advanced and assign a menu to the UberMenu [Easy Integration] theme locaiton'; ubermenu_admin_notice( $msg ); return; } //Check that the theme location has been assigned else if( !has_nav_menu( 'ubermenu' ) ){ $msg = 'To use Easy Integration, please assign a menu to the UberMenu [Easy Integration] theme location'; ubermenu_admin_notice( $msg ); return; } //$args = array(); $args['theme_location'] = 'ubermenu'; return ubermenu( $config_id , $args ); }