Make WordPress Core

Opened 10 years ago

Closed 7 years ago

#38844 closed enhancement (fixed)

Post Type Objects and Menu Icons

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

Description

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 10 years ago.
38844.diff​ (1.0 KB ) - added by m.usama.masood 7 years ago.
38844.2.patch​ (1.0 KB ) - added by m.usama.masood 7 years ago.

Download all attachments as: .zip

Change History (10)

#1 @SergeyBiryukov
10 years ago

  • Keywords has-patch added

#2 @desrosj
8 years ago

  • Keywords needs-refresh good-first-bug added
  • Milestone Awaiting Review → Future Release
  • Version 4.6.1 → 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.


7 years ago

#4 @m.usama.masood
7 years ago

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

#5 @davidbaumwald
7 years ago

  • Keywords needs-refresh removed
  • Milestone Future Release → 5.4

#6 @SergeyBiryukov
7 years ago

  • Owner set to SergeyBiryukov
  • Status new → reviewing

#7 @SergeyBiryukov
7 years ago

  • Resolution → fixed
  • Status reviewing → 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.