WordPress.org

Make WordPress Core

Opened 10 days ago

Closed 6 days ago

#50199 closed defect (bug) (fixed)

Theme Editor: Remove unused $has_templates boolean

Reported by: SergeyBiryukov Owned by: 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 7 days ago.

Download all attachments as: .zip

Change History (3)

#1 @dboy1988
7 days ago

New patch attached

Last edited 7 days ago by dboy1988 (previous) (diff)

@dboy1988
7 days ago

#2 @SergeyBiryukov
6 days 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.