Last active
January 1, 2016 03:39
-
-
Save wpexplorer/8086713 to your computer and use it in GitHub Desktop.
Add a shopping cart icon to WooCommerce products menu item in the WP 3.8 dashboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment