Opened 13 years ago
Closed 13 years ago
#12397 closed enhancement (fixed)
get_body_class should show more IDs
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Themes | Keywords: | has-patch |
Focuses: | Cc: |
Description
- We show the IDs of posts and pages.
- We support
category-[ID].php
- andtag-[ID].php
-style templates, but do not show their IDs in the body class.
Attachments (2)
Change History (11)
#2
in reply to:
↑ 1
@
13 years ago
Replying to nacin:
Was something in particular there about IDs? They seem to concern slugs.
There's also the general concern that slugs are stable while IDs are not, especially when terms are shared in multisite setups.
I understand that, but it seems to me that the stability sufficient enough to allow category-[ID].php
-style templates is also sufficient to allow such body class names. They should rise and fall together.
And to tip the scales further, it's consistent with the behavior of other request types, such as posts and pages.
#3
@
13 years ago
Two points about stability: the "stability" of a category ID, for example, is an issue only for MS. And between MS and standard, MS is the least likely to be the recipient of a very specific, custom theme--the very situation when you need to be able to do something like category-2.php
.
In other words, it's more likely that I'll be creating a theme that gives category X a particular treatment, when the site is not MS. MS setups tend to use out-of-the-box themes for the purpose of flexibility.
Second, I've found that slugs change a lot during development time, which is just when I have to decide the template logic for a client.
For example, the client first calls the category "Movie Reviews," and then changes her mind to "Movies," "Reviews," or "Critic's Corner." Not only does it mean more work for me to re-do slug-based logic, it's frustrating to the client who can't change the slug without breaking functionality she doesn't have the technical means to fix.
#4
@
13 years ago
- Keywords early added
- Milestone changed from 3.0 to 3.1
- Type changed from defect (bug) to enhancement
Looks good, let's shoot for early 3.1 here.
#5
@
13 years ago
- Milestone changed from Awaiting Triage to 3.1
- Owner set to filosofo
- Status changed from new to accepted
Or just close it.
#6
@
13 years ago
- Keywords needs-refresh added; has-patch early removed
The new taxonomy body classes also need this.
Or just close it.
Tempting.
#7
@
13 years ago
- Keywords has-patch added; needs-refresh removed
Refreshed patch.
I think using IDs is consistent with other behavior, at least.
See also #11331 and #8446. There's also the general concern that slugs are stable while IDs are not, especially when terms are shared in multisite setups.