Make WordPress Core

Changeset 45537


Ignore:
Timestamp:
06/14/2019 11:25:45 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Menus: Set better default for $args parameter in Walker_Nav_Menu methods, to match the documented parameter type.

Props trasweb.
Fixes #47524.

File:
1 edited

Legend:

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

    r45141 r45537  
    5151     * @param stdClass $args   An object of wp_nav_menu() arguments.
    5252     */
    53     public function start_lvl( &$output, $depth = 0, $args = array() ) {
     53    public function start_lvl( &$output, $depth = 0, $args = null ) {
    5454        if ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) {
    5555            $t = '';
     
    9090     * @param stdClass $args   An object of wp_nav_menu() arguments.
    9191     */
    92     public function end_lvl( &$output, $depth = 0, $args = array() ) {
     92    public function end_lvl( &$output, $depth = 0, $args = null ) {
    9393        if ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) {
    9494            $t = '';
     
    116116     * @param int      $id     Current item ID.
    117117     */
    118     public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
     118    public function start_el( &$output, $item, $depth = 0, $args = null, $id = 0 ) {
    119119        if ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) {
    120120            $t = '';
     
    260260     * @param stdClass $args   An object of wp_nav_menu() arguments.
    261261     */
    262     public function end_el( &$output, $item, $depth = 0, $args = array() ) {
     262    public function end_el( &$output, $item, $depth = 0, $args = null ) {
    263263        if ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) {
    264264            $t = '';
Note: See TracChangeset for help on using the changeset viewer.