WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 8 months ago

#49362 closed defect (bug) (fixed)

The docs for is_page_template should clarify it is expecting a filename

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

Description

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:

page-cool.php

/**
  * 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 8 months ago.
Diff to fix 49362, adds "filename" to inline docs instead of just "name"

Download all attachments as: .zip

Change History (4)

@mkaz
8 months ago

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

#1 @mkaz
8 months ago

  • Keywords has-patch added

#2 @SergeyBiryukov
8 months 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
8 months 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.