WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#20036 closed enhancement (wontfix)

A custom post type icon?

Reported by: empireoflight Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:

Description

I posted this over the weekend, not sure if it's still being reviewed or if I just never submitted it...I think we need a default custom post type icon, instead of the tack. Maybe a pencil, sticky note, scotch tape, other ideas?

Attachments (1)

20036-custom-icon-switch.diff (2.2 KB) - added by DrewAPicture 2 years ago.
Adds menu-icon-custom

Download all attachments as: .zip

Change History (6)

comment:1 in reply to: ↑ description ; follow-up: nacin2 years ago

Replying to empireoflight:

I posted this over the weekend, not sure if it's still being reviewed or if I just never submitted it...

Never submitted it — have now, though.

I think we need a default custom post type icon, instead of the tack. Maybe a pencil, sticky note, scotch tape, other ideas?

Interesting idea. Worth noting that the vast majority of post type registrations are possibly missing an icon, so that would change quite a bit of dashboards. (Not that this is a deal breaker, of course.) I think we'd probably need to consider some proofs of concept before deciding to make a switch. Curious what others think.

Version 0, edited 2 years ago by nacin (next)

comment:2 in reply to: ↑ 1 DrewAPicture2 years ago

  • Cc xoodrew@… added

Replying to nacin:

Interesting idea. Worth noting that the vast majority of post type registrations are possibly missing an icon, so that would change quite a bit of dashboards. (Not that this is a deal breaker, of course.)

What about associating the icon with non-post/non-page post types and therefore post type registrations lacking icons wouldn't be adversely affected? Almost as if the icon were the non-post/non-page fallback. It's kind of coming at it from behind so to speak but it might work.

DrewAPicture2 years ago

Adds menu-icon-custom

comment:3 DrewAPicture2 years ago

  • Keywords has-patch 2nd-opinion needs-ui added

I'd say the obvious question would be what to change the icon to. I agree that it would be nice to have something to set CPTs apart from Posts, especially if no menu_icon is specified.

As for a patch, the switch was much simpler than I originally thought. In wp-admin/menu.php#L97 there's already a _builtin = false check as well as an is_string check on $ptype_obj->menu_icon.

The attached diff introduces the menu-icon-custom class. All that would be left to do would to add the icon(s) to the end of the menu sprites (wp-admin/images/menu.png and menu-vs.png).

comment:4 empireoflight2 years ago

It just looks weird to have a bunch of pins when you set up custom post types...but I agree, it may be a shock for users to suddenly see a different icon.
What about a little plus sign next to the pin, or a star, or racing stripes down the middle --like a customized Camaro :)

comment:5 helenyhou2 years ago

  • Keywords 2nd-opinion needs-ui removed
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

From dev chat today:

Jane__:

we have that generic gear for things that add top level menus... i wouldnt' want to introduce a random 'other type' icon bc it could get confused with other meaningful icons

a pencil, for example, always means edit/write

i think it would make more sense to do an education push around adding a custom icon with your custom post type

once you get someone doing 3 custom post types in one install the 'custom non-post icon' doesn't do anything anymore in terms of differentiating


New thought: we should make it easier to register a sprite for the icons instead of having developers go the long way around with CSS. See #20052

Note: See TracTickets for help on using tickets.