* @since 3.0.0
* @var string
*/
- var $tree_type = array( 'post_type', 'taxonomy', 'custom' );
+ public $tree_type = array( 'post_type', 'taxonomy', 'custom' );
/**
* Database fields to use.
* @todo Decouple this.
* @var array
*/
- var $db_fields = array( 'parent' => 'menu_item_parent', 'id' => 'db_id' );
+ public $db_fields = array( 'parent' => 'menu_item_parent', 'id' => 'db_id' );
/**
* Starts the list before the elements are added.
* @param int $depth Depth of menu item. Used for padding.
* @param array $args An array of arguments. @see wp_nav_menu()
*/
- function start_lvl( &$output, $depth = 0, $args = array() ) {
+ public function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat("\t", $depth);
$output .= "\n$indent<ul class=\"sub-menu\">\n";
}
* @param int $depth Depth of menu item. Used for padding.
* @param array $args An array of arguments. @see wp_nav_menu()
*/
- function end_lvl( &$output, $depth = 0, $args = array() ) {
+ public function end_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat("\t", $depth);
$output .= "$indent</ul>\n";
}
* @param array $args An array of arguments. @see wp_nav_menu()
* @param int $id Current item ID.
*/
- function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
+ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
- $class_names = '';
-
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
$classes[] = 'menu-item-' . $item->ID;
* @param int $depth Depth of page. Not Used.
* @param array $args An array of arguments. @see wp_nav_menu()
*/
- function end_el( &$output, $item, $depth = 0, $args = array() ) {
+ public function end_el( &$output, $item, $depth = 0, $args = array() ) {
$output .= "</li>\n";
}
* @type string $link_after Text after the link. Default empty.
* @type bool $echo Whether to echo the menu or return it. Default true.
* @type int $depth How many levels of the hierarchy are to be included. 0 means all. Default 0.
- * @type string $walker Allows a custom walker class to be specified. Default empty.
+ * @type object $walker Instance of a custom walker class. Default empty.
* @type string $theme_location Theme location to be used. Must be registered with register_nav_menu()
* in order to be selectable by the user.
* @type string $items_wrap How the list items should be wrapped. Default is a ul with an id and class.
// get the first menu that has items if we still can't find a menu
if ( ! $menu && !$args->theme_location ) {
- $menus = wp_get_nav_menus();
+ $menus = wp_get_nav_menus( array( 'orderby' => 'name' ) );
foreach ( $menus as $menu_maybe ) {
if ( $menu_items = wp_get_nav_menu_items( $menu_maybe->term_id, array( 'update_post_term_cache' => false ) ) ) {
$menu = $menu_maybe;
*
* @since 3.1.0
*
- * @param array $sorted_menu_items The menu items, sorted by each menu item's menu order.
+ * @param array $sorted_menu_items The menu items, sorted by each menu item's menu order.
+ * @param object $args An object containing wp_nav_menu() arguments.
*/
$sorted_menu_items = apply_filters( 'wp_nav_menu_objects', $sorted_menu_items, $args );
* @see wp_nav_menu()
*
* @param string $items The HTML list content for the menu items.
- * @param array $args Array of wp_nav_menu() arguments.
+ * @param object $args An object containing wp_nav_menu() arguments.
*/
$items = apply_filters( 'wp_nav_menu_items', $items, $args );
/**
* @see wp_nav_menu()
*
* @param string $items The HTML list content for the menu items.
- * @param array $args Array of wp_nav_menu() arguments.
+ * @param object $args An object containing wp_nav_menu() arguments.
*/
$items = apply_filters( "wp_nav_menu_{$menu->slug}_items", $items, $args );
* @see wp_nav_menu()
*
* @param string $nav_menu The HTML content for the navigation menu.
- * @param array $args Array of wp_nav_menu() arguments.
+ * @param object $args An object containing wp_nav_menu() arguments.
*/
$nav_menu = apply_filters( 'wp_nav_menu', $nav_menu, $args );