[wp-trac] [WordPress Trac] #19063: Custom post_types and get_template_part
WordPress Trac
noreply at wordpress.org
Sat Aug 24 15:22:04 UTC 2013
#19063: Custom post_types and get_template_part
-------------------------+----------------------
Reporter: impleri | Owner:
Type: enhancement | Status: closed
Priority: normal | Milestone:
Component: Template | Version:
Severity: minor | Resolution: wontfix
Keywords: has-patch |
-------------------------+----------------------
Comment (by impleri):
Replying to [comment:15 c3mdigital]:
> `get_template_part()` Is meant to be a simple tempting function that
gets a template part. This complicates our template hierarchy. Couldn't
you do basically the same thing in your archive.php file? Put your
function that returns the $slug-$type part then in your archive.php
That's fine for theming stuff, but I'm coming at it from the perspective
of a plugin author. I have a plugin which uses CPT to display books. For
someone to be able to use my plugin, they cannot simple install it. They
have to either edit their template files (as you suggest) or create their
own template files. So, are you suggesting that I, as a plugin author,
create a theme template and require users to use it or roll their own just
so that my CPT is actually viewable?
This kind of leaving third party developers out to dry is a reason why
I've slowly left using WP. Both Joomla and Drupal have this kind of
functionality out of the box. Sad, because I'd rather use WP than the
others or forking WP for such a small change. All I'm asking is for post
types to be included in the get_post_template() magic and an additional WP
hook to allow plugins to define initial template parts for those CPT.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19063#comment:17>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list