WordPress.org

Make WordPress Core

Ticket #27163: 27163.diff

File 27163.diff, 3.9 KB (added by DrewAPicture, 7 years ago)
  • src/wp-includes/nav-menu-template.php

     
    198198/**
    199199 * Displays a navigation menu.
    200200 *
    201  * Optional $args contents:
     201 * @since 3.0.0
    202202 *
    203  * menu - The menu that is desired. Accepts (matching in order) id, slug, name. Defaults to blank.
    204  * menu_class - CSS class to use for the ul element which forms the menu. Defaults to 'menu'.
    205  * menu_id - The ID that is applied to the ul element which forms the menu. Defaults to the menu slug, incremented.
    206  * container - Whether to wrap the ul, and what to wrap it with. Defaults to 'div'.
    207  * container_class - the class that is applied to the container. Defaults to 'menu-{menu slug}-container'.
    208  * container_id - The ID that is applied to the container. Defaults to blank.
    209  * fallback_cb - If the menu doesn't exists, a callback function will fire. Defaults to 'wp_page_menu'. Set to false for no fallback.
    210  * before - Text before the link text.
    211  * after - Text after the link text.
    212  * link_before - Text before the link.
    213  * link_after - Text after the link.
    214  * echo - Whether to echo the menu or return it. Defaults to echo.
    215  * depth - how many levels of the hierarchy are to be included. 0 means all. Defaults to 0.
    216  * walker - allows a custom walker to be specified.
    217  * theme_location - the location in the theme to be used. Must be registered with register_nav_menu() in order to be selectable by the user.
    218  * items_wrap - How the list items should be wrapped. Defaults to a ul with an id and class. Uses printf() format with numbered placeholders.
     203 * @param array $args {
     204 *     Optional. Array of nav menu arguments.
    219205 *
    220  * @since 3.0.0
    221  *
    222  * @param array $args Arguments
     206 *     @type string        $menu            Desired menu. Accepts (matching in order) id, slug, name. Default empty.
     207 *     @type string        $menu_class      CSS class to use for the ul element which forms the menu. Default 'menu'.
     208 *     @type string        $menu_id         The ID that is applied to the ul element which forms the menu.
     209 *                                          Default is the menu slug, incremented.
     210 *     @type string        $container       Whether to wrap the ul, and what to wrap it with. Default 'div'.
     211 *     @type string        $container_class Class that is applied to the container. Default 'menu-{menu slug}-container'.
     212 *     @type string        $container_id    The ID that is applied to the container. Default empty.
     213 *     @type callback|bool $fallback_cb     If the menu doesn't exists, a callback function will fire.
     214 *                                          Default is 'wp_page_menu'. Set to false for no fallback.
     215 *     @type string        $before          Text before the link text. Default empty.
     216 *     @type string        $after           Text after the link text. Default empty.
     217 *     @type string        $link_before     Text before the link. Default empty.
     218 *     @type string        $link_after      Text after the link. Default empty.
     219 *     @type bool          $echo            Whether to echo the menu or return it. Default true.
     220 *     @type int           $depth           How many levels of the hierarchy are to be included. 0 means all. Default 0.
     221 *     @type string        $walker          Allows a custom walker class to be specified. Default empty.
     222 *     @type string        $theme_location  Theme location to be used. Must be registered with register_nav_menu()
     223 *                                          in order to be selectable by the user.
     224 *     @type string        $items_wrap      How the list items should be wrapped. Default is a ul with an id and class.
     225 *                                          Uses printf() format with numbered placeholders.
     226 * }
    223227 */
    224228function wp_nav_menu( $args = array() ) {
    225229        static $menu_id_slugs = array();