Make WordPress Core


Ignore:
Timestamp:
09/28/2013 09:01:54 PM (12 years ago)
Author:
DrewAPicture
Message:

Improve inline documentation for Walker_Nav_Menu, Walker_Nav_Menu_Edit, Walker_Nav_Menu_Checklist.

Includes previously undocumented parameters.

See #23406.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/nav-menu-template.php

    r25602 r25643  
    1717class Walker_Nav_Menu extends Walker {
    1818    /**
     19     * What the class handles.
     20     *
    1921     * @see Walker::$tree_type
    2022     * @since 3.0.0
     
    2426
    2527    /**
     28     * Database fields to use.
     29     *
    2630     * @see Walker::$db_fields
    2731     * @since 3.0.0
     
    3236
    3337    /**
     38     * Starts the list before the elements are added.
     39     *
    3440     * @see Walker::start_lvl()
     41     *
    3542     * @since 3.0.0
    3643     *
    3744     * @param string $output Passed by reference. Used to append additional content.
    38      * @param int $depth Depth of page. Used for padding.
     45     * @param int    $depth  Depth of menu item. Used for padding.
     46     * @param array  $args   An array of arguments. @see wp_nav_menu()
    3947     */
    4048    function start_lvl( &$output, $depth = 0, $args = array() ) {
     
    4452
    4553    /**
     54     * Ends the list of after the elements are added.
     55     *
    4656     * @see Walker::end_lvl()
     57     *
    4758     * @since 3.0.0
    4859     *
    4960     * @param string $output Passed by reference. Used to append additional content.
    50      * @param int $depth Depth of page. Used for padding.
     61     * @param int    $depth  Depth of menu item. Used for padding.
     62     * @param array  $args   An array of arguments. @see wp_nav_menu()
    5163     */
    5264    function end_lvl( &$output, $depth = 0, $args = array() ) {
     
    5668
    5769    /**
     70     * Start the element output.
     71     *
    5872     * @see Walker::start_el()
     73     *
    5974     * @since 3.0.0
    6075     *
    6176     * @param string $output Passed by reference. Used to append additional content.
    62      * @param object $item Menu item data object.
    63      * @param int $depth Depth of menu item. Used for padding.
    64      * @param int $current_page Menu item ID.
    65      * @param object $args
     77     * @param object $item   Menu item data object.
     78     * @param int    $depth Depth of menu item. Used for padding.
     79     * @param array  $args   An array of arguments. @see wp_nav_menu()
     80     * @param int    $id     Current item ID.
    6681     */
    6782    function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
     
    7893         * @since 3.0.0
    7994         *
    80          * @param array $classes The CSS classes that are applied to the menu item's <li>.
    81          * @param object $item The current menu item.
    82          * @param array $args Arguments from {@see wp_nav_menu()}.
     95         * @param array  $classes The CSS classes that are applied to the menu item's <li>.
     96         * @param object $item    The current menu item.
     97         * @param array  $args    An array of arguments. @see wp_nav_menu()
    8398         */
    8499        $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
     
    92107         * @param string The ID that is applied to the menu item's <li>.
    93108         * @param object $item The current menu item.
    94          * @param array $args Arguments from {@see wp_nav_menu()}.
     109         * @param array $args An array of arguments. @see wp_nav_menu()
    95110         */
    96111        $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
     
    113128         *     The HTML attributes applied to the menu item's <a>, empty strings are ignored.
    114129         *
    115          *     @type string $title The title attribute.
     130         *     @type string $title  The title attribute.
    116131         *     @type string $target The target attribute.
    117          *     @type string $rel The rel attribute.
    118          *     @type string $href The href attribute.
     132         *     @type string $rel    The rel attribute.
     133         *     @type string $href   The href attribute.
    119134         * }
    120135         * @param object $item The current menu item.
    121          * @param array $args Arguments from {@see wp_nav_menu()}.
     136         * @param array  $args An array of arguments. @see wp_nav_menu()
    122137         */
    123138        $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args );
     
    147162         * @since 3.0.0
    148163         *
    149          * @param string The menu item's starting HTML output.
    150          * @param object $item The current menu item.
    151          * @param int $depth From {@see Walker_Nav_Menu::start_el}.
    152          * @param array $args Arguments from {@see wp_nav_menu()}.
     164         * @param string $item_output The menu item's starting HTML output.
     165         * @param object $item        Menu item data object.
     166         * @param int    $depth       Depth of menu item. Used for padding.
     167         * @param array  $args        An array of arguments. @see wp_nav_menu()
    153168         */
    154169        $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
     
    156171
    157172    /**
     173     * Ends the element output, if needed.
     174     *
    158175     * @see Walker::end_el()
     176     *
    159177     * @since 3.0.0
    160178     *
    161179     * @param string $output Passed by reference. Used to append additional content.
    162      * @param object $item Page data object. Not used.
    163      * @param int $depth Depth of page. Not Used.
     180     * @param object $item   Page data object. Not used.
     181     * @param int    $depth  Depth of page. Not Used.
     182     * @param array  $args   An array of arguments. @see wp_nav_menu()
    164183     */
    165184    function end_el( &$output, $item, $depth = 0, $args = array() ) {
    166185        $output .= "</li>\n";
    167186    }
    168 }
     187
     188} // Walker_Nav_Menu
    169189
    170190/**
Note: See TracChangeset for help on using the changeset viewer.