clanbite_notify( int $user_id, string $type, string $title, array $args = array() ): int|\WP_ErrorSend a notification to a user.
Parameters
$user_id(int) RequiredUser to notify.
$type(string) RequiredNotification type slug (e.g., 'team_invite', 'friend_request').
$title(string) RequiredShort notification title.
$args(array<string, mixed>) OptionalOptional arguments.
Default:
array()$messagestringLonger message text.$urlstringLink URL when notification is clicked.$actor_idintUser who triggered the notification.$object_typestringRelated object type (e.g., 'team', 'post', 'comment').$object_idintRelated object ID.$dataarrayAdditional data to store (will be JSON encoded).$actionsarrayAction buttons. Each action is an array with: – key: (string) Unique action identifier (e.g., 'accept', 'decline'). – label: (string) Button label. – style: (string) 'primary', 'secondary', or 'danger'. Default 'secondary'. – handler: (string) Handler identifier for the action. – status: (string) Status to set after action ('accepted', 'declined', 'dismissed'). – success_message: (string) Message to show on success. – confirm: (string|false) Confirmation message, or false for no confirm.$dedupeboolIf true, won't create if similar notification exists. Default true.
Returns
int|\WP_Error Notification ID or error.
Defined in inc/extensions/notifications/functions.php