Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#49967 closed defect (bug) (fixed)

Remove never-used commented out code in nav-menus.php update add menu block

Reported by: garrett-eclipse's profile garrett-eclipse Owned by: audrasjb's profile audrasjb
Milestone: 5.5 Priority: normal
Severity: normal Version:
Component: Menus Keywords: has-patch commit
Focuses: coding-standards Cc:

Description (last modified by SergeyBiryukov)


While working on #44286 I noticed there was a piece of commented out code;

// $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( '<strong>%s</strong> has been created.' ), $nav_menu_selected_title ) . '</p></div>';

Looking into it the piece of code was only used in a patch that never saw the light of day, instead in changeset [23810] for ticket #23770 it was added already commented out.

This code isn't needed as directly after it a wp_redirect is run so the message handler never executes in this case.

Attachments (1)

49967.diff (556 bytes) - added by garrett-eclipse 4 years ago.
Patch to remove unneeded commented out code.

Download all attachments as: .zip

Change History (5)

4 years ago

Patch to remove unneeded commented out code.

#1 @garrett-eclipse
4 years ago

  • Keywords has-patch added

49967.diff removes the code.

#2 @audrasjb
4 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 5.5
  • Owner set to audrasjb
  • Status changed from new to accepted

Thanks for catching this. Moving to milestone 5.5.
Patch looks good to go.

#3 @SergeyBiryukov
4 years ago

  • Description modified (diff)

#4 @SergeyBiryukov
4 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 47605:

Menus: Remove unused commented out code in wp-admin/nav-menus.php.

Props garrett-eclipse, audrasjb.
Fixes #49967.

Note: See TracTickets for help on using tickets.