weblizar_fallback_page_menu

The Enigma weblizar fallback page menu function.

Description

weblizar_fallback_page_menu( (array) $args = array() ); 

Parameters (1)

0. $args — Optional. (array) => array()
The args.

Usage

  1. if ( !function_exists( 'weblizar_fallback_page_menu' ) ) { 
  2. require_once '/core/menu/default_menu_walker.php'; 
  3.  
  4. // The args. 
  5. $args = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = weblizar_fallback_page_menu($args); 
  9.  

Defined (1)

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

/core/menu/default_menu_walker.php  
  1. function weblizar_fallback_page_menu( $args = array() ) { 
  2.  
  3. $defaults = array('sort_column' => 'menu_order, post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => ''); 
  4. $args = wp_parse_args( $args, $defaults ); 
  5. $args = apply_filters( 'wp_page_menu_args', $args ); 
  6.  
  7. $menu = ''; 
  8.  
  9. $list_args = $args; 
  10.  
  11. // Show Home in the menu 
  12. if ( ! empty($args['show_home']) ) { 
  13. if ( true === $args['show_home'] || '1' === $args['show_home'] || 1 === $args['show_home'] ) 
  14. $text = __('Home', 'enigma'); 
  15. else 
  16. $text = $args['show_home']; 
  17. $class = ''; 
  18. if ( is_front_page() && !is_paged() ) 
  19. $class = 'class="current_page_item"'; 
  20. $menu .= '<li ' . $class . '><a href="' . esc_url( home_url('/')) . '" title="' . esc_attr($text) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>'; 
  21. // If the front page is a page, add it to the exclude list 
  22. if (get_option('show_on_front') == 'page') { 
  23. if ( !empty( $list_args['exclude'] ) ) { 
  24. $list_args['exclude'] .= ', '; 
  25. } else { 
  26. $list_args['exclude'] = ''; 
  27. $list_args['exclude'] .= get_option('page_on_front'); 
  28.  
  29. $list_args['echo'] = false; 
  30. $list_args['title_li'] = ''; 
  31. $list_args[walker] = new weblizar_walker_page_menu; 
  32. $menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages($list_args) ); 
  33.  
  34. if ( $menu ) 
  35. $menu = '<ul class="'. esc_attr($args['menu_class']) .'">' . $menu . '</ul>'; 
  36.  
  37. $menu = '<div class="' . esc_attr($args['container_class']) . '">' . $menu . "</div>\n"; 
  38. $menu = apply_filters( 'wp_page_menu', $menu, $args ); 
  39. if ( $args['echo'] ) 
  40. echo $menu; 
  41. else 
  42. return $menu;