WordPress.org

Make WordPress Core

Opened 15 years ago

Closed 14 years ago

#3335 closed enhancement (fixed)

Add condition function(s) for page templates

Reported by: jimisola Owned by: westi
Milestone: 2.5 Priority: low
Severity: minor Version:
Component: Template Keywords: has-patch 2nd-opinion needs-testing
Focuses: Cc:

Description

There does not exist a condition function for Page Templates like there is for Page etc (see http://codex.wordpress.org/Conditional_Tags).

Not only me seem to be missing this functionality: http://wordpress.org/support/topic/55378?replies=5

Attachments (2)

3335.diff (763 bytes) - added by rob1n 15 years ago.
Add is_page_template() function to find out if either it's a page template we're using, or if the current page template == the argument.
3335.2.diff (1.3 KB) - added by westi 14 years ago.
Updated patch with documentation for tag included

Download all attachments as: .zip

Change History (8)

@rob1n
15 years ago

Add is_page_template() function to find out if either it's a page template we're using, or if the current page template == the argument.

#1 @rob1n
15 years ago

  • Keywords has-patch 2nd-opinion added
  • Milestone set to 2.2
  • Owner changed from anonymous to rob1n
  • Status changed from new to assigned

#2 @rob1n
15 years ago

  • Keywords 2nd-opinion removed
  • Milestone changed from 2.2 to 2.3
  • Status changed from assigned to new

Pushing to 2.3.

#3 @rob1n
15 years ago

  • Component changed from Administration to Template
  • Keywords 2nd-opinion added
  • Priority changed from normal to low

@westi
14 years ago

Updated patch with documentation for tag included

#4 @westi
14 years ago

  • Keywords needs-testing added
  • Owner changed from rob1n to westi
  • Status changed from new to assigned

I have updated the patch here to include some documentation and to make the code more obvious.

I think we should try and ensure that all new template tags come with documentation.

I am not sure whether of not to punt this one out to 2.4

And as of yet it has had no testing.

#5 @Nazgul
14 years ago

  • Milestone changed from 2.3 to 2.4 (next)

#6 @westi
14 years ago

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

(In [6228]) Add is_page_template() function to allow theme developers to detect that they are is a page template. Fixes #3335

Note: See TracTickets for help on using tickets.