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

WordPress Trac noreply at wordpress.org
Sat Aug 8 08:38:17 UTC 2015


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

Comment (by prionkor):

 Listing another use case of being able to add (fake) templates on the
 dropdown list (also check #33309).

 I have an MVC structured theme.  Where I do not want to create files for
 page templates. Instead all the templates are generated by a master
 factory class placed in the `index.php`. The master class decides and
 calls view classes depending on the request.

 An simplified example if the template file name is `view/no-sidebar.php`
 it will call `View\No_Sidebar` class etc.

 So, in order to achieve that I would need to add new items to the dropdown
 list. Currently I am using blank page template files in order to add items
 on the list.

 I would vote for removing `array_intersect_assoc()` and have to full
 control to developers.

 WPSE thread

 http://wordpress.stackexchange.com/questions/196995/adding-items-to-page-
 template-dropdown-on-page-edit-screen)

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


More information about the wp-trac mailing list