WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#12434 closed defect (bug) (fixed)

Allow custom post types to have custom icons

Reported by: ptahdunbar Owned by:
Priority: normal Milestone: 3.0
Component: UI Version:
Severity: major Keywords: has-patch
Cc: WordPress@…

Description

Currently all custom post types receive a id attribute of 'menu-posts'. This allows for them to use the posts icon. However if you want to use your own icon, you won't be able to select your post type as all of them are assigned a 'menu-posts' id.

This patch addressing this issue by assigning custom post types with a 'menu-$post_type' id, where $post_type is a sanitized version of the label.

In addition, it abstracts all menu icons so they can be used more than once.

Attachments (4)

ticket_12434_menu_icons.diff (25.2 KB) - added by ptahdunbar 3 years ago.
ticket_12434_menu_icons.2.diff (142.5 KB) - added by ptahdunbar 3 years ago.
includes updated minified versions
12434.diff (24.9 KB) - added by Denis-de-Bernardy 3 years ago.
menu_icons.diff (84.2 KB) - added by ptahdunbar 3 years ago.
refreshed patch with minified versions

Download all attachments as: .zip

Change History (10)

ptahdunbar3 years ago

includes updated minified versions

comment:1 scribu3 years ago

  • Milestone changed from Unassigned to 3.0
  • Type changed from defect (bug) to enhancement

comment:2 voyagerfan57613 years ago

  • Cc WordPress@… added

Denis-de-Bernardy3 years ago

comment:3 Denis-de-Bernardy3 years ago

+1 to the idea. having dup IDs breaks jQuery.

@ptahdunbar: can you confirm I refreshed this properly? the only fix I needed to do was in the admin-menu.php file, to add the needed class.

comment:4 Denis-de-Bernardy3 years ago

  • Severity changed from normal to major

marking this as a bug. see #12445

comment:5 nacin3 years ago

  • Type changed from enhancement to defect (bug)

ptahdunbar3 years ago

refreshed patch with minified versions

comment:6 ryan3 years ago

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.