[wp-trac] [WordPress Trac] #13265: Filter results of get_page_templates()

WordPress Trac noreply at wordpress.org
Sun Mar 2 08:10:22 UTC 2014


#13265: Filter results of get_page_templates()
-------------------------+-------------------------
 Reporter:  nathanrice   |       Owner:  nathanrice
     Type:  enhancement  |      Status:  reopened
 Priority:  normal       |   Milestone:  3.9
Component:  Themes       |     Version:  3.0
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:  template
-------------------------+-------------------------

Comment (by downstairsdev):

 Thanks for the commit @nacin.  This solves my use case of removing page
 templates: https://github.com/devinsays/portfolio-
 press/commit/3e5e50f5e25ee5303f26bd15b78eed146bef6ebc

 @MikeSchinkel I didn't quite understand your first use case until I tested
 it.  Page templates are available if they are in theme/folder/page-
 template.php, but not if they are another directory level deep, e.g.
 theme/folder/folder/page-template.php.  I didn't realize that.  I had
 assumed WordPress would find a template anywhere in the theme directory
 structure.

 For a plugin to add a page template I would expect to:

 1)  Be completely self-sufficient (i.e. not rely on theme templates or
 styling)
 2)  Require the use of page data in some way (title, content, meta fields)

 I think @MikeSchinkel's examples meet the criteria.

 I could see a potential issue if someone wanted to create a basic theme
 and then offer additional features through a paid add-on plugin.  They
 might be tempted to include the additional templates in the plugin even
 though it would be much preferable to have them in the theme folder.

 However, I don't feel too strongly either way on this topic.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/13265#comment:52>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list