Make WordPress Core

Opened 7 years ago

Closed 4 years ago

#38844 closed enhancement (fixed)

Post Type Objects and Menu Icons

Reported by: michaelecklund's profile michael.ecklund Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.4 Priority: normal
Severity: normal Version: 3.0
Component: Posts, Post Types Keywords: has-patch good-first-bug
Focuses: ui, administration Cc:


When using get_post_type_object(); the core Post Types don't have a menu_icon available.

For example:

$page_object = get_post_type_object( 'page' );

echo $page_object->menu_icon;

When executing the above code, I would expect that to output the same icon used in the administration menu on the left. This goes for all core Post Types.

Attachments (3)

38844.patch (845 bytes) - added by SergeyBiryukov 7 years ago.
38844.diff (1.0 KB) - added by m.usama.masood 4 years ago.
38844.2.patch (1.0 KB) - added by m.usama.masood 4 years ago.

Download all attachments as: .zip

Change History (10)

#1 @SergeyBiryukov
7 years ago

  • Keywords has-patch added

#2 @desrosj
5 years ago

  • Keywords needs-refresh good-first-bug added
  • Milestone changed from Awaiting Review to Future Release
  • Version changed from 4.6.1 to 3.0

The menu_icon parameter was introduced in [14014].

Patch needs a refresh.

This ticket was mentioned in Slack in #core by m.usama.masood. View the logs.

4 years ago

4 years ago

#4 @m.usama.masood
4 years ago

The menu_icon parameter has been added in parameters for default post types.

#5 @davidbaumwald
4 years ago

  • Keywords needs-refresh removed
  • Milestone changed from Future Release to 5.4

#6 @SergeyBiryukov
4 years ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#7 @SergeyBiryukov
4 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 47196:

Posts, Post Types: Add default menu_icon values for built-in post types.

This allows the icons to be retrieved via get_post_type_object().

Props m.usama.masood, michael.ecklund, SergeyBiryukov.
Fixes #38844.

Note: See TracTickets for help on using tickets.