Make WordPress Core

Opened 14 years ago

Last modified 13 years ago

#14746 closed task (blessed)

Post Kinds/Styles/Types — at Version 10

Reported by: ryan's profile ryan Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version:
Component: Template Keywords: ongoing-project ui-feedback
Focuses: Cc:

Description (last modified by ryan)

Allow denoting a post as a certain style/type/kind. Some example styles are aside, gallery, link, quote. This will allow themes to style these posts according to kind.

This can be implemented as a custom taxonomy. wp_post_style, for example. Terms within wp_post_style would be the styles. Some core styles will be pre-populated. The slugs and names will be stored as English. Dummy gettext calls will get the strings into the catalog and later the fetched names can be run through translate().

It can also be implemented as a post meta field. Since there can be only one type per post, a taxonomy could be overkill. Using meta would also save us an extra taxonomy query. Using a taxonomy would, however, make it easier for plugins to add new types persistently.

UI on the edit post form will allow selecting from one of the terms in the wp_post_style taxonomy. Themes will be provided some simple API such as get_post_style() and has_post_style().

Change History (10)

#1 @iandstewart
14 years ago

  • Cc ian@… added

#2 @zamoose
14 years ago

"Style" is too loaded of a word in HTML design circles. I think it conveys something we're not necessarily looking for here.

We've got custom post types already, but what you're proposing is a way to alter posts that would be returned intra Loop, yes?

I'm not sure what a suitable replacement would be -- genre? Variety?

#3 @zamoose
14 years ago

  • Cc zamoose added

#4 @ryan
14 years ago

Thinking we shouldn't have add_theme_support(). The idea for this is to carry across themes. You shouldn't be limited by the types supported by the current theme. You could switch later and wish you had set the type for previous posts.

#5 @ryan
14 years ago

We need to take care to avoid confusion with Page Templates as well. Maybe we should call these templates and work these and page templates together into a shared UI.

#6 @zamoose
14 years ago

@Ryan:
Not trying to be a nattering nabob of negativity here. I guess I'm trying to grok how this functionality isn't already in place via simple category use. The functionality for styling posts differently per-category already exists in core.

What am I missing here?

#7 @ryan
14 years ago

Using regular categories is very fragile. They can change with the language. They can be deleted. Their slugs can be edited. Thus the suggestion of a new taxonomy. One that will be hidden with no edit/manage UI exposed. The downside to a new taxonomy is an extra query.

#8 @ryan
14 years ago

Alternatively, since there can be only one "template", forget taxonomies and use a post meta field. We fetch all post meta anyway.

#9 @ryan
14 years ago

  • Description modified (diff)

#10 @ryan
14 years ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.