[wp-trac] [WordPress Trac] #41717: WP_Theme::get_post_templates() fails to read parent theme
WordPress Trac
noreply at wordpress.org
Wed Aug 23 21:38:29 UTC 2017
#41717: WP_Theme::get_post_templates() fails to read parent theme
------------------------------+------------------------------
Reporter: JoelStransky | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version: 4.7
Severity: normal | Resolution:
Keywords: needs-unit-tests | Focuses:
------------------------------+------------------------------
Comment (by JoelStransky):
@swissspidy thanks for the reply but the line you reference only works for
a single post type. I believe the goal of a method named
`get_post_templates` would be to return every '''post''' template
available throughout the theme. This functions as expected in the post
metabox because it doesn't use get_post_templates(). I uses
get_page_templates() because all it needs is the list for a single post
type.
Right now the only way to get all '''post''' templates from child and
parent is to use `get_post_types()` and loop over the results calling
`get_page_templates(null, $post_type)` on each one.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41717#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list