Add a shopping cart icon to WooCommerce products menu item in the WP 3.8 dashboard
// Remove WooCommerce menu.css on WP 3.8+
add_action( 'admin_print_styles', 'wpex_remove_woocommerce_admin_menu_styles' );
if ( ! function_exists('wpex_remove_woocommerce_admin_menu_styles') ) {
function wpex_remove_woocommerce_admin_menu_styles() {
global $wp_version;
if ( $wp_version >= 3.8 ) {
wp_dequeue_style( 'woocommerce_admin_menu_styles' );
}
}
}
// Change WooCommerce Menu icon on WP 3.8+
add_action('woocommerce_register_post_type_product','wpex_change_product_dashicon');
if ( ! function_exists('wpex_change_product_dashicon') ) {
function wpex_change_product_dashicon($array) {
global $wp_version;
if ( $wp_version >= 3.8 ) {
$menu_icon = array(
'menu_icon' => 'dashicons-cart',
);
$array = array_merge($array, $menu_icon);
}
return $array;
}
}