[wp-trac] [WordPress Trac] #38698: REST API: Enable page templates for all post types

WordPress Trac noreply at wordpress.org
Mon Nov 7 22:46:22 UTC 2016


#38698: REST API: Enable page templates for all post types
--------------------------------------+-----------------------
 Reporter:  swissspidy                |       Owner:
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  4.7
Component:  Posts, Post Types         |     Version:  trunk
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  rest-api
--------------------------------------+-----------------------

Comment (by dd32):

 Replying to [comment:1 danielbachhuber]:
 > Is there a `post_type_supports` opt-in / -out for templates? I can see
 cases where automatically adding templates to some post types would be
 unexpected.

 Nope. All `post_type`s support page templates now - as long as the theme
 includes templates for that post type.

 As in the patch `wp_get_theme()->get_page_templates( null,
 $this->post_type )` is probably the best way to determine if there's page
 templates available for the current post type - as even pages can have no
 templates, perhaps the `if` should jue be changed to check that instead
 (So if the site has no page templates available for `post_type = page`,
 it's not exposed in the API)

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


More information about the wp-trac mailing list