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.
Return
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 9.7.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']; } ); }