Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#49362 closed defect (bug) (fixed)

The docs for is_page_template should clarify it is expecting a filename

Reported by: mkaz's profile mkaz Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.4 Priority: normal
Severity: minor Version:
Component: Posts, Post Types Keywords: has-patch
Focuses: template Cc:


The function is_page_template() accepts a filename as a parameter, this is not the same thing as the template name which is what the inline docs refer to. The template name is specified in the header of the template for example:


  * Template name: My Cool Template

The parameter should be page-cool.php and not My Cool Template

Attachments (1)

49362.diff (1.2 KB) - added by mkaz 4 years ago.
Diff to fix 49362, adds "filename" to inline docs instead of just "name"

Download all attachments as: .zip

Change History (4)

4 years ago

Diff to fix 49362, adds "filename" to inline docs instead of just "name"

#1 @mkaz
4 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
4 years ago

  • Component changed from General to Posts, Post Types
  • Milestone changed from Awaiting Review to 5.4
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#3 @SergeyBiryukov
4 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 47182:

Docs: Clarify that is_page_template() accepts a template filename, not the Template Name file header.

Props mkaz.
Fixes #49362.

Note: See TracTickets for help on using tickets.