This function allows you to add a new notification for a specific user. Notifications are shown when the user logs in (if the notice is generated when they are not online) or on the next page reload (if they are logged in).
$notice = array( 'user_id' => 1, 'message' => 'You have received 10 points!' ); mycred_add_new_notice( $notice );
- notice (array)
An associative array containing the users ID and the message to show.
- lifespan (int)
Option to set the number of days the message is saved. Defaults to 1.