Make WordPress Core

Opened 20 years ago

Closed 19 years ago

#3335 closed enhancement (fixed)

Add condition function(s) for page templates

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

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 20 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 19 years ago.
Updated patch with documentation for tag included

Download all attachments as: .zip

Change History (8)

@rob1n
20 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
20 years ago

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

#2 @rob1n
20 years ago

  • Keywords 2nd-opinion removed
  • Milestone 2.2 → 2.3
  • Status assigned → new

Pushing to 2.3.

#3 @rob1n
19 years ago

  • Component Administration → Template
  • Keywords 2nd-opinion added
  • Priority normal → low

@westi
19 years ago

Updated patch with documentation for tag included

#4 @westi
19 years ago

  • Keywords needs-testing added
  • Owner changed from rob1n to westi
  • Status new → 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
19 years ago

  • Milestone 2.3 → 2.4 (next)

#6 @westi
19 years ago

  • Resolution → fixed
  • Status assigned → 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.