Filter
rpress_menu_order_count
On this page
Filters the number shown in the pending order badge on the Orders admin menu item.
Applied after the pending count has been computed, only when the badge is enabled and the user can edit_shop_payments. The count reflects orders in the needs-attention window of the Orders list and is cached in a transient for two minutes. A falsy return value (0) means no badge is added.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$pending_count | int | Number of orders needing attention. |
Return value#
int. The number to display in the badge. Return 0 to hide the badge.
Example#
function my_cap_menu_order_count( $pending_count ) {
return min( (int) $pending_count, 99 );
}
add_filter( 'rpress_menu_order_count', 'my_cap_menu_order_count' );
Source#
Applied in:
includes/admin/admin-pages.php(line 126), inRP_Admin_Menus::menu_order_count()
See also#
Was this page helpful?
