Automattic\WooCommerce\Internal\StockNotifications
NotificationQuery::count_notifications
Count notifications matching the given filters.
Method of the class: NotificationQuery{}
No Hooks.
Returns
int. Number of matching notifications.
Usage
$result = NotificationQuery::count_notifications( $args ): int;
- $args(array) (required)
- Same filter args as {@see self::get_notifications()}, minus the
return/limit/offsetkeys (those are forced tocount/ no-limit).
NotificationQuery::count_notifications() NotificationQuery::count notifications code WC 11.2.1
public static function count_notifications( array $args ): int {
$args['return'] = 'count';
unset( $args['limit'], $args['offset'] );
return (int) self::run_query( $args );
}