[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/ -> nav-menu-template.php (summary)

Nav Menu API: Template functions

File Size: 696 lines (26 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 wp-includes/class-walker-nav-menu.php

Defines 5 functions

  wp_nav_menu()
  _wp_menu_item_classes_by_context()
  walk_nav_menu_tree()
  _nav_menu_item_id_use_once()
  wp_nav_menu_remove_menu_item_has_children_class()

Functions
Functions that are not part of a class:

wp_nav_menu( $args = array()   X-Ref
Displays a navigation menu.

return: void|string|false Void if 'echo' argument is true, menu output if 'echo' is false.
param: array $args {

_wp_menu_item_classes_by_context( &$menu_items )   X-Ref
Adds the class property classes for the current context, if applicable.

param: array $menu_items The current menu item objects to which to add the class property information.

walk_nav_menu_tree( $items, $depth, $args )   X-Ref
Retrieves the HTML list content for nav menu items.

return: string The HTML list content for the menu items.
param: array    $items The menu items, sorted by each menu item's menu order.
param: int      $depth Depth of the item in reference to parents.
param: stdClass $args  An object containing wp_nav_menu() arguments.

_nav_menu_item_id_use_once( $id, $item )   X-Ref
Prevents a menu item ID from being used more than once.

return: string
param: string $id
param: object $item

wp_nav_menu_remove_menu_item_has_children_class( $classes, $menu_item, $args = false, $depth = false )   X-Ref
Remove the `menu-item-has-children` class from bottom level menu items.

This runs on the {@see 'nav_menu_css_class'} filter. The $args and $depth
parameters were added after the filter was originally introduced in
WordPress 3.0.0 so this needs to allow for cases in which the filter is
called without them.

return: string[] Modified nav menu classes.
param: string[]       $classes   Array of the CSS classes that are applied to the menu item's `<li>` element.
param: WP_Post        $menu_item The current menu item object.
param: stdClass|false $args      An object of wp_nav_menu() arguments. Default false ($args unspecified when filter is called).
param: int|false      $depth     Depth of menu item. Default false ($depth unspecified when filter is called).



Generated : Sat Apr 27 08:20:02 2024 Cross-referenced by PHPXref