Automattic\WooCommerce\Admin\Features

TransientNotices::get_queue_by_user()public staticWC 1.0

Get all notices in the queue by a given user ID.

Method of the class: TransientNotices{}

No Hooks.

Return

Array.

Usage

$result = TransientNotices::get_queue_by_user( $user_id );
$user_id(int) (required)
User ID.

TransientNotices::get_queue_by_user() code WC 8.6.1

public static function get_queue_by_user( $user_id ) {
	$notices = self::get_queue();

	return array_filter(
		$notices,
		function( $notice ) use ( $user_id ) {
			return ! isset( $notice['user_id'] ) ||
				null === $notice['user_id'] ||
				$user_id === $notice['user_id'];
		}
	);
}