\n"; } /** * @see Walker::start_el() * @since 3.0.0 * * @param string $output Passed by reference. Used to append additional content. * @param object $item Menu item data object. * @param int $depth Depth of menu item. Used for padding. * @param int $current_page Menu item ID. * @param object $args */ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; /** * Dividers, Headers or Disabled * ============================= * Determine whether the item is a Divider, Header, Disabled or regular * menu item. To prevent errors we use the strcasecmp() function to so a * comparison that is not case sensitive. The strcasecmp() function returns * a 0 if the strings are equal. */ if ( strcasecmp( $item->attr_title, 'divider' ) == 0 && $depth === 1 ) { $output .= $indent . ''; // If static front page, add a link to the blog /* $posts_page_id = get_option ( 'page_for_posts' ); if ( $posts_page_id ) { $posts_page = get_page( $posts_page_id ); $fb_output .= '
  • ' . $posts_page->post_title . '
  • '; } */ // Add the first 4 pages, based on menu order $pages = get_pages( array ( 'sort_column' => 'menu_order', 'parent' => 0, 'number' => 4 ) ); foreach ( $pages as $page ) { //$fb_output .= '
  • ' $fb_output .= '
  • ' . $page->post_title . '
  • '; } // If admin, show link to add a menu /* if ( current_user_can( 'manage_options' ) ) { $fb_output .= '
  • Add a menu
  • '; } */ // End the unordered list $fb_output .= ''; // End the container if ( $container ) $fb_output .= ''; // Return the menu return $fb_output; } //endif function } //end class