WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 3 years ago

#14746 closed task (blessed)

Post Kinds/Styles/Types — at Version 11

Reported by: 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 types. Themes will be provided some simple API such as get_post_style() and has_post_style().

Change History (11)

comment:1 iandstewart4 years ago

  • Cc ian@… added

comment:2 zamoose4 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?

comment:3 zamoose4 years ago

  • Cc zamoose added

comment:4 ryan4 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.

comment:5 ryan4 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.

comment:6 zamoose4 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?

comment:7 ryan4 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.

comment:8 ryan4 years ago

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

comment:9 ryan4 years ago

  • Description modified (diff)

comment:10 ryan4 years ago

  • Description modified (diff)

comment:11 ryan4 years ago

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