Ticket #3335 (closed enhancement: fixed)

Opened 2 years ago

Last modified 1 year ago

Add condition function(s) for page templates

Reported by: jimisola Assigned to: westi
Priority: low Milestone: 2.5
Component: Template Version:
Severity: minor Keywords: has-patch 2nd-opinion needs-testing
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

3335.diff (0.7 kB) - added by rob1n on 03/31/07 03:39:23.
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 on 09/01/07 09:42:57.
Updated patch with documentation for tag included

Change History

03/31/07 03:39:23 changed by rob1n

  • attachment 3335.diff added.

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.

03/31/07 03:40:08 changed by rob1n

  • keywords set to has-patch 2nd-opinion.
  • owner changed from anonymous to rob1n.
  • status changed from new to assigned.
  • milestone set to 2.2.

04/10/07 23:11:32 changed by rob1n

  • keywords changed from has-patch 2nd-opinion to has-patch.
  • status changed from assigned to new.
  • milestone changed from 2.2 to 2.3.

Pushing to 2.3.

04/27/07 02:51:22 changed by rob1n

  • keywords changed from has-patch to has-patch 2nd-opinion.
  • priority changed from normal to low.
  • component changed from Administration to Template.

09/01/07 09:42:57 changed by westi

  • attachment 3335.2.diff added.

Updated patch with documentation for tag included

09/01/07 09:44:44 changed by westi

  • keywords changed from has-patch 2nd-opinion to has-patch 2nd-opinion needs-testing.
  • 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.

09/06/07 23:42:25 changed by Nazgul

  • milestone changed from 2.3 to 2.4 (next).

10/12/07 20:01:17 changed by westi

  • status changed from assigned to closed.
  • resolution set to fixed.

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