Make WordPress Core


Ignore:
Timestamp:
09/07/2016 04:14:49 PM (10 years ago)
Author:
johnbillion
Message:

Menus: Correct the docblocks for Walker_Nav_Menu, wp_nav_menu(), and walk_nav_menu_tree().

This corrects the parameter type for the $args and $item parameters passed throughout these functions, class methods, and hooks.

See #24587
See #35206
See #37770

File:
1 edited

Legend:

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

    r38523 r38559  
    4646         * @see Walker::start_lvl()
    4747         *
    48          * @param string $output Passed by reference. Used to append additional content.
    49          * @param int    $depth  Depth of menu item. Used for padding.
    50          * @param array  $args   An array of wp_nav_menu() arguments.
     48         * @param string   $output Passed by reference. Used to append additional content.
     49         * @param int      $depth  Depth of menu item. Used for padding.
     50         * @param stdClass $args   An object of wp_nav_menu() arguments.
    5151         */
    5252        public function start_lvl( &$output, $depth = 0, $args = array() ) {
     
    6969         * @see Walker::end_lvl()
    7070         *
    71          * @param string $output Passed by reference. Used to append additional content.
    72          * @param int    $depth  Depth of menu item. Used for padding.
    73          * @param array  $args   An array of wp_nav_menu() arguments.
     71         * @param string   $output Passed by reference. Used to append additional content.
     72         * @param int      $depth  Depth of menu item. Used for padding.
     73         * @param stdClass $args   An object of wp_nav_menu() arguments.
    7474         */
    7575        public function end_lvl( &$output, $depth = 0, $args = array() ) {
     
    9393         * @see Walker::start_el()
    9494         *
    95          * @param string $output Passed by reference. Used to append additional content.
    96          * @param object $item   Menu item data object.
    97          * @param int    $depth  Depth of menu item. Used for padding.
    98          * @param array  $args   An array of wp_nav_menu() arguments.
    99          * @param int    $id     Current item ID.
     95         * @param string   $output Passed by reference. Used to append additional content.
     96         * @param WP_Post $item   Menu item data object.
     97         * @param int      $depth  Depth of menu item. Used for padding.
     98         * @param stdClass $args   An object of wp_nav_menu() arguments.
     99         * @param int      $id     Current item ID.
    100100         */
    101101        public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
     
    117117                 * @since 4.4.0
    118118                 *
    119                  * @param array  $args  An array of arguments.
    120                  * @param object $item  Menu item data object.
    121                  * @param int    $depth Depth of menu item. Used for padding.
     119                 * @param stdClass $args  An object of wp_nav_menu() arguments.
     120                 * @param WP_Post $item  Menu item data object.
     121                 * @param int      $depth Depth of menu item. Used for padding.
    122122                 */
    123123                $args = apply_filters( 'nav_menu_item_args', $args, $item, $depth );
     
    129129                 * @since 4.1.0 The `$depth` parameter was added.
    130130                 *
    131                  * @param array  $classes The CSS classes that are applied to the menu item's `<li>` element.
    132                  * @param object $item    The current menu item.
    133                  * @param array  $args    An array of wp_nav_menu() arguments.
    134                  * @param int    $depth   Depth of menu item. Used for padding.
     131                 * @param array    $classes The CSS classes that are applied to the menu item's `<li>` element.
     132                 * @param WP_Post $item    The current menu item.
     133                 * @param stdClass $args    An object of wp_nav_menu() arguments.
     134                 * @param int      $depth   Depth of menu item. Used for padding.
    135135                 */
    136136                $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args, $depth ) );
     
    143143                 * @since 4.1.0 The `$depth` parameter was added.
    144144                 *
    145                  * @param string $menu_id The ID that is applied to the menu item's `<li>` element.
    146                  * @param object $item    The current menu item.
    147                  * @param array  $args    An array of wp_nav_menu() arguments.
    148                  * @param int    $depth   Depth of menu item. Used for padding.
     145                 * @param string   $menu_id The ID that is applied to the menu item's `<li>` element.
     146                 * @param WP_Post $item    The current menu item.
     147                 * @param stdClass $args    An object of wp_nav_menu() arguments.
     148                 * @param int      $depth   Depth of menu item. Used for padding.
    149149                 */
    150150                $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args, $depth );
     
    173173                 *     @type string $href   The href attribute.
    174174                 * }
    175                  * @param object $item  The current menu item.
    176                  * @param array  $args  An array of wp_nav_menu() arguments.
    177                  * @param int    $depth Depth of menu item. Used for padding.
     175                 * @param WP_Post $item  The current menu item.
     176                 * @param stdClass $args  An object of wp_nav_menu() arguments.
     177                 * @param int      $depth Depth of menu item. Used for padding.
    178178                 */
    179179                $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args, $depth );
     
    195195                 * @since 4.4.0
    196196                 *
    197                  * @param string $title The menu item's title.
    198                  * @param object $item  The current menu item.
    199                  * @param array  $args  An array of wp_nav_menu() arguments.
    200                  * @param int    $depth Depth of menu item. Used for padding.
     197                 * @param string   $title The menu item's title.
     198                 * @param WP_Post $item  The current menu item.
     199                 * @param stdClass $args  An object of wp_nav_menu() arguments.
     200                 * @param int      $depth Depth of menu item. Used for padding.
    201201                 */
    202202                $title = apply_filters( 'nav_menu_item_title', $title, $item, $args, $depth );
     
    217217                 * @since 3.0.0
    218218                 *
    219                  * @param string $item_output The menu item's starting HTML output.
    220                  * @param object $item        Menu item data object.
    221                  * @param int    $depth       Depth of menu item. Used for padding.
    222                  * @param array  $args        An array of wp_nav_menu() arguments.
     219                 * @param string   $item_output The menu item's starting HTML output.
     220                 * @param WP_Post $item        Menu item data object.
     221                 * @param int      $depth       Depth of menu item. Used for padding.
     222                 * @param stdClass $args        An object of wp_nav_menu() arguments.
    223223                 */
    224224                $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
     
    232232         * @see Walker::end_el()
    233233         *
    234          * @param string $output Passed by reference. Used to append additional content.
    235          * @param object $item   Page data object. Not used.
    236          * @param int    $depth  Depth of page. Not Used.
    237          * @param array  $args   An array of wp_nav_menu() arguments.
     234         * @param string   $output Passed by reference. Used to append additional content.
     235         * @param WP_Post $item   Page data object. Not used.
     236         * @param int      $depth  Depth of page. Not Used.
     237         * @param stdClass $args   An object of wp_nav_menu() arguments.
    238238         */
    239239        public function end_el( &$output, $item, $depth = 0, $args = array() ) {
Note: See TracChangeset for help on using the changeset viewer.