Merge pull request #9820 from pmgarman/processing-order-counts-filter

Add filter to remove admin menu order counts
This commit is contained in:
Mike Jolley 2015-12-14 12:43:14 +00:00
commit 7ce6e2f1ab
1 changed files with 1 additions and 1 deletions

View File

@ -137,7 +137,7 @@ class WC_Admin_Menus {
unset( $submenu['woocommerce'][0] );
// Add count if user has access
if ( current_user_can( 'manage_woocommerce' ) && ( $order_count = wc_processing_order_count() ) ) {
if ( apply_filters( 'woocommerce_include_processing_order_count_in_menu', true ) && current_user_can( 'manage_woocommerce' ) && ( $order_count = wc_processing_order_count() ) ) {
foreach ( $submenu['woocommerce'] as $key => $menu_item ) {
if ( 0 === strpos( $menu_item[0], _x( 'Orders', 'Admin menu name', 'woocommerce' ) ) ) {
$submenu['woocommerce'][ $key ][0] .= ' <span class="awaiting-mod update-plugins count-' . $order_count . '"><span class="processing-count">' . number_format_i18n( $order_count ) . '</span></span>';