Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#44110 closed enhancement (invalid)

Removed unnecessary else's in admin.php

Reported by: rnaby's profile rnaby Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.1
Component: Administration Keywords: has-patch needs-testing
Focuses: administration Cc:


As the global variables are getting declared in top, so I think the else conditions are unnecessary here.

Attachments (1)

44110.diff (543 bytes) - added by rnaby 6 years ago.
Th patch for the ticket.

Download all attachments as: .zip

Change History (2)

6 years ago

Th patch for the ticket.

#1 @SergeyBiryukov
6 years ago

  • Component changed from General to Administration
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Hi @rnaby, welcome to WordPress Trac!

The $typenow global is indeed declared a few lines above, but its value is undefined. The else condition makes sure the variable is always defined, so it cannot be removed.

Note: See TracTickets for help on using tickets.