WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 20 months ago

#33388 new defect (bug)

WP_Theme should use get_file_data() for retrieving page templates

Reported by: dd32 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Themes Keywords: needs-testing
Focuses: Cc:
PR Number:

Description

Currently WP_Theme::get_page_templates() uses a direct regular expression on the result of get_file_contents(), it should instead use the get_file_data() helper method we have to interact with file header data.

Currently switching will result in a back-compat break, as some themes have been using headers such as <?php // Template Name: Something ?> as the header, which get_file_data() doesn't like - See #33387

See r21117 for where we previously did use it temporarily during the 3.4 cycle, but broke due to #33387

Attachments (2)

33388.diff (790 bytes) - added by m_uysl 3 years ago.
depends on #33387
33388.2.diff (1.3 KB) - added by Thomas Vitale 20 months ago.
Patch refreshed

Download all attachments as: .zip

Change History (4)

@m_uysl
3 years ago

depends on #33387

#1 @Thomas Vitale
20 months ago

  • Keywords needs-refresh added

@Thomas Vitale
20 months ago

Patch refreshed

#2 @Thomas Vitale
20 months ago

  • Keywords needs-testing added; needs-refresh removed
Note: See TracTickets for help on using tickets.