Automattic\WooCommerce\Admin\Features
TransientNotices::get_queue_by_user
Get all notices in the queue by a given user ID.
Method of the class: TransientNotices{}
No Hooks.
Returns
Array.
Usage
$result = TransientNotices::get_queue_by_user( $user_id );
- $user_id(int) (required)
- User ID.
TransientNotices::get_queue_by_user() TransientNotices::get queue by user code WC 10.5.0
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'];
}
);
}