[wp-trac] [WordPress Trac] #13818: There should be index pages for custom post types
WordPress Trac
wp-trac at lists.automattic.com
Fri Oct 15 04:57:14 UTC 2010
#13818: There should be index pages for custom post types
----------------------------+-----------------------------------------------
Reporter: frankieroberto | Owner: nacin
Type: task (blessed) | Status: accepted
Priority: normal | Milestone: 3.1
Component: Template | Version: 3.0
Severity: normal | Keywords:
----------------------------+-----------------------------------------------
Comment(by greenshady):
> Actually, we always know. We know exactly what post types a user has
because we build those post types right into the theme.
>
> Any existing post types which they have will be replaced by the ones in
the theme which is being developed. If they're going to the trouble of
migrating a custom post type from one theme to another then it's fairly
reasonable to assume that they might also migrate the CPT template.
Actually, we don't always know. Post types don't have to be developed
within a theme. Plugins can also create post types. We can find out
which post types are registered, of course. We don't always know
beforehand (during development) which exist and should be able to create
fallbacks within our themes.
For example, suppose a plugin registers the "movie" post type. The theme
would normally handle the presentantion of this on the front end of the
site. For the movie archive page, a theme developer cannot know to create
a special template called `archive-movie.php` to handle that specific
archive. However, a theme developer would likely want to have a
conditional within `archive.php` to handle post type archives in general.
This is no different than other archive-type conditional tags such as
`is_category()`, `is_author()`, and `is_tax()`. The proposal for
`is_post_type_archive()` is not some weird stretch of the imagination
here. It fits right in with other, similar conditional tags. The other
proposed functions do as well.
> Fallbacks are always good, but I don't think it's a major issue for
custom post types.
I *know* it'll be a major issue. I've already done enough of these types
of sites and setups with average users to know the above three things will
be critical.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/13818#comment:50>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list