Opened 12 years ago
Closed 12 years ago
#21203 closed defect (bug) (fixed)
A CPT named 'code' triggers wierd font/order bugs in admin
Reported by: | clarklab | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | minor | Version: | 3.0 |
Component: | UI | Keywords: | has-patch |
Focuses: | Cc: |
Description
When you make a custom post type named 'code', some weird problems arise. In the admin, the post list is rendered in Consalas (see attachment). Even weirder, the default sort changes to alpha order, not date.
The font looks to be happening because the class 'code' gets added to the TR in the post list, but I'm not sure why the order would change.
I checked for a reserved CPT name, but all the codex said was to avoid the wp_ prefix.
Attachments (4)
Change History (15)
#1
follow-up:
↓ 2
@
12 years ago
- Component changed from Post Types to UI
- Keywords ui-feedback has-patch added; needs-patch removed
- Version changed from 3.4.1 to 3.0
Was not able to reproduce sort order but confirmed font changing. Is the .code css class used anywhere in admin?
#2
in reply to:
↑ 1
;
follow-up:
↓ 3
@
12 years ago
Replying to c3mdigital:
Is the .code css class used anywhere in admin?
Yes - quite a few places. Things like inputs, especially those containing code or URL entry, and some lists (files to delete, etc.).
#3
in reply to:
↑ 2
@
12 years ago
Replying to helenyhou:
Replying to c3mdigital:
Is the .code css class used anywhere in admin?
Yes - quite a few places. Things like inputs, especially those containing code or URL entry, and some lists (files to delete, etc.).
Just did a search and found around 20 uses so removing .code from css is not an option.
#4
follow-up:
↓ 7
@
12 years ago
- Keywords needs-patch added; has-patch removed
I assume the issue here is that there's some css class being generated based on the post type name.
We should prefix that class, to avoid collisions. Example: class="cpt-<?php echo $post_type; ?>"
.
#7
in reply to:
↑ 4
@
12 years ago
Replying to scribu:
I assume the issue here is that there's some css class being generated based on the post type name.
We should prefix that class, to avoid collisions. Example:
class="cpt-<?php echo $post_type; ?>"
.
Makes sense but would require changing get_post_class:
$classes[] = 'post-' . $post->ID; $classes[] = $post->post_type; $classes[] = 'type-' . $post->post_type; $classes[] = 'status-' . $post->post_status;
Might break some themes.
the post listing rendered in the wrong font.