[wp-trac] [WordPress Trac] #18375: Post type templates

WordPress Trac noreply at wordpress.org
Tue Sep 20 19:02:34 UTC 2016


#18375: Post type templates
--------------------------------------+-----------------------
 Reporter:  johnbillion               |       Owner:
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  4.7
Component:  Posts, Post Types         |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  template
--------------------------------------+-----------------------
Changes (by swissspidy):

 * keywords:  needs-unit-tests has-patch => has-patch has-unit-tests
 * milestone:  Future Release => 4.7


Comment:

 In [attachment:18375.diff]:

 * Do not introduce new functions everywhere, at least for now.
 * Remove checks for the 'post' post type in various places
 (`get_page_template_slug()`, `WP_Posts_List_Table` (quick edit),
 `is_page_template()`, `wp_insert_post()` etc.)
 * Also makes this work in the `WP_Post` class
 * Adds a new `attributes` post type label as it now affects much more post
 types
 * Adds unit tests or modifies existing ones where necessary.

 Basically, this adds support for custom templates for any post type that
 supports `page-attributes`. That means with the current patch it doesn't
 work for posts by default.

 To do:

 * Discuss backward compatibility:
  * Should the 'page_templates' cache group change to 'post_templates' or
 should there be both? If it should change, the docs inside `WP_Theme` need
 to reflect that.
  * Add new params or new `is_post_type_template()` /
 `get_post_type_templates()` functions? It's totally confusing when there's
 `get_page_templates()` ''and'' `get_page_template()`
  * Should the 'post' post type have the `page-attributes` support by
 default?
 * Test all the things: custom post types, posts, pages, quick edit, etc.

 Feedback welcome.

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


More information about the wp-trac mailing list