WordPress at a glance
function is not described

wc_notice_count() WC 2.1

Get the count of notices added, either for all notices (default) or for one. particular notice type specified by $notice_type.

No Hooks.

Return

Int. Nothing.

Usage

wc_notice_count( $notice_type );
$notice_type(string)
The name of the notice type - either error, success or notice.

Changelog

Since 2.1 Introduced.

Code of wc_notice_count() WC 5.3.0

<?php
function wc_notice_count( $notice_type = '' ) {
	if ( ! did_action( 'woocommerce_init' ) ) {
		wc_doing_it_wrong( __FUNCTION__, __( 'This function should not be called before woocommerce_init.', 'woocommerce' ), '2.3' );
		return;
	}

	$notice_count = 0;
	$all_notices  = WC()->session->get( 'wc_notices', array() );

	if ( isset( $all_notices[ $notice_type ] ) ) {

		$notice_count = count( $all_notices[ $notice_type ] );

	} elseif ( empty( $notice_type ) ) {

		foreach ( $all_notices as $notices ) {
			$notice_count += count( $notices );
		}
	}

	return $notice_count;
}