[wp-trac] [WordPress Trac] #49967: Remove never-used commented out code in nav-menus.php update add menu block

WordPress Trac noreply at wordpress.org
Tue Apr 21 08:56:38 UTC 2020


#49967: Remove never-used commented out code in nav-menus.php update add menu block
------------------------------+-------------------------------
 Reporter:  garrett-eclipse   |       Owner:  audrasjb
     Type:  defect (bug)      |      Status:  accepted
 Priority:  normal            |   Milestone:  5.5
Component:  Menus             |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:  coding-standards
------------------------------+-------------------------------
Description changed by SergeyBiryukov:

Old description:

> Hello,
>
> While working on #44286 I noticed there was a piece of commented out
> code;
> {{{#!php
> <?php
> // $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
> [https://core.trac.wordpress.org/changeset/23810 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.

New description:

 Hello,

 While working on #44286 I noticed there was a piece of commented out code;
 {{{#!php
 <?php
 // $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.

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49967#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list