Make WordPress Core

Opened 18 months ago

Last modified 18 months ago

#46382 new defect (bug)

[walker-nav-menu] Undefined property stdclass::$current in class-walker-nav-menu.php

Reported by: winston_wolf Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.1
Component: Menus Keywords: has-patch
Focuses: Cc:


In wp-includes/class-walker-nav-menu.php line 177 there's a missing empty(); function around $item->current.
Causes PHP errors everywhere wp_nav_menu(); function occurrence:

$atts['aria-current'] = $item->current ? 'page' : '';

Should be:

$atts['aria-current'] = ! empty( $item->current ) ? 'page' : '';

Attachments (1)

46382.diff (687 bytes) - added by mukesh27 18 months ago.
Working patch.

Download all attachments as: .zip

Change History (3)

#1 follow-up: @mukesh27
18 months ago

Hi @winston_wolf, Welcome to WordPres Trac! Thanks for the report.

Good cache.

18 months ago

Working patch.

#2 in reply to: ↑ 1 @winston_wolf
18 months ago

You're welcome ;)

Replying to mukesh27:

Thanks for the report.
Good cache.

Note: See TracTickets for help on using tickets.