minileven_get_menu_location

This function grabs the location of the custom menus from the current theme.

Description

minileven_get_menu_location(); 

If no menu is set in a location it will return a boolean false.. This function helps Minileven know which custom menu to display.


Usage

  1. if ( !function_exists( 'minileven_get_menu_location' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/minileven/theme/pub/minileven/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = minileven_get_menu_location(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/modules/minileven/theme/pub/minileven/functions.php  
  1. function minileven_get_menu_location() { 
  2. $theme_slug = minileven_actual_current_theme(); 
  3. $mods = get_option( "theme_mods_{$theme_slug}" ); 
  4.  
  5. if ( has_filter( 'jetpack_mobile_theme_menu' ) ) { 
  6.  
  7. /** 
  8. * Filter the menu displayed in the Mobile Theme. 
  9. * @module minileven 
  10. * @since 3.4.0 
  11. * @param int $menu_id ID of the menu to display. 
  12. */ 
  13. return array( 'primary' => apply_filters( 'jetpack_mobile_theme_menu', $menu_id ) ); 
  14.  
  15. if ( isset( $mods['nav_menu_locations'] ) && ! empty( $mods['nav_menu_locations'] ) ) 
  16. return $mods['nav_menu_locations']; 
  17.  
  18. return false;