WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#36729 closed defect (bug) (fixed)

Empty original title in class-walker-nav-menu-edit.php custom menu item type

Reported by: grapplerulrich Owned by: ocean90
Milestone: 4.6 Priority: normal
Severity: normal Version: 3.0
Component: Menus Keywords: has-patch has-unit-tests
Focuses: ui Cc:

Description

When using a custom menu-item-type like line_break, "Original:" without a title is shown after adding the menu item to the menu.

The reason for this is that $original_title is originally defined as a empty string but the check later on is $original_title !== false.

My fix for this would be to define $original_title = false in the beginning

Attachments (2)

36729.patch (530 bytes) - added by grapplerulrich 4 years ago.
36729.diff (2.3 KB) - added by swissspidy 4 years ago.

Download all attachments as: .zip

Change History (7)

#1 @grapplerulrich
4 years ago

  • Keywords has-patch added

@swissspidy
4 years ago

#2 @swissspidy
4 years ago

  • Keywords has-unit-tests added

Just for completness and better understanding, 36729.diff adds a test for that case.

#3 @ocean90
4 years ago

  • Milestone changed from Awaiting Review to 4.6
  • Version changed from trunk to 3.0

Introduced in [14287] and [18426].

#4 @ocean90
4 years ago

  • Summary changed from Empty original tile in class-walker-nav-menu-edit.php custom menu item type to Empty original title in class-walker-nav-menu-edit.php custom menu item type

#5 @ocean90
4 years ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from new to closed

In 37953:

Nav Menus: In Walker_Nav_Menu_Edit::start_el() initialize $original_title with false.

Prevents displaying "Original:" without a title when adding a menu item without a title.

Props grapplerulrich, swissspidy.
Fixes #36729.

Note: See TracTickets for help on using tickets.