Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // WooCommerce - Show the processing order count in the admin bar
- add_action('admin_bar_menu', 'show_new_orders_in_admin_bar', 900 );
- function show_new_orders_in_admin_bar( $wp_admin_bar ) {
- $order_count = wc_processing_order_count();
- $args = array(
- 'id' => 'new_orders',
- 'title' => 'Orders'.' <span class="order_count">'.$order_count.'</span>',
- 'href' => 'https://topcode.co.uk/dev/wp-admin/edit.php?post_type=shop_order',
- 'meta' => array(
- 'class' => 'show_new_orders_in_admin_bar',
- 'title' => 'Show new orders'
- )
- );
- $wp_admin_bar->add_node($args);
- }
- ?>
- /* Then some custom css to make it show in red */
- #wpadminbar .order_count {
- display: inline-block;
- min-width: 13px;
- height: 17px;
- padding: 0 4px 4px;
- text-align: center;
- line-height: 1.6;
- background-color: #d63638;
- border-radius: 10px;
- }
- /* This will need an admin-side css plugin. */
Add Comment
Please, Sign In to add comment