llms_notice_count( string $notice_type = '' )

Returns a count of all current notices by type.


Parameters Parameters

$notice_type

(string) (Optional) Type of notice passed. IE: error, success, warning

Default value: ''


Top ↑

Return Return

(int)


Top ↑

Source Source

File: includes/functions/llms.functions.notice.php

function llms_notice_count( $notice_type = '' ) {

	$notice_count = 0;

	$all_notices = LLMS()->session->get( 'llms_notices', array() );

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

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

	} elseif ( empty( $notice_type ) ) {

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

	return $notice_count;
}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.