Register CPTs using Dashicons for admin menu icon in WP 3.8

After going through the rabbit hole and back, the answer is – yes, core does allow to easily use dashicons when registering post types and adding menu pages.

To use dashicon you need to pass its CSS class dashicons-[name] to menu_icon or icon_url in relevant places.

Classes available can be looked up in dashicons.css in source or Dashicons site (click icon and look at the name for it on top).

Alert! 3.8 seems to have released with dashicons-piechart as example of the class in inline docs, which is wrong and won’t work. Actual class for that icon in release is dashicons-chart-pie.

Leave a Comment