WordPress.org

Make WordPress Core

#44110 closed enhancement (invalid)

Removed unnecessary else's in admin.php

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

Description

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 21 months ago.
Th patch for the ticket.

Download all attachments as: .zip

Change History (2)

@rnaby
21 months ago

Th patch for the ticket.

#1 @SergeyBiryukov
21 months 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.