Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#50199 closed defect (bug) (fixed)

Theme Editor: Remove unused $has_templates boolean

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.5 Priority: normal
Severity: trivial Version:
Component: Themes Keywords: needs-patch good-first-bug
Focuses: administration Cc:

Description

In wp-admin/theme-editor.php, the $has_templates boolean is a remnant from when the Theme Editor still had the "Templates" heading and is unused in the current logic.

Some history:

  • [20315]: $has_templates introduced.
  • [35180]: $has_templates moved around.
  • [41851]: "Templates" heading removed.
  • [42155]: $has_templates made redundant by && $theme->parent().

Attachments (1)

50199.diff (1.0 KB) - added by dboy1988 5 years ago.

Download all attachments as: .zip

Change History (3)

#1 @dboy1988
5 years ago


Version 1, edited 5 years ago by dboy1988 (previous) (next) (diff)

@dboy1988
5 years ago

#2 @SergeyBiryukov
5 years ago

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

In 47844:

Theme Editor: Remove unused $has_templates boolean.

The variable is a remnant from when the Theme Editor still had the "Templates" heading and is unused in the current logic.

The condition it was a part of would always evaluate to true for a child theme, regardless of the $has_templates value.

Props dboy1988.
Fixes #50199.

Note: See TracTickets for help on using tickets.