Clanbite

insert( array $data ): int|\WP_Error

Insert a new notification.

public static

Class: Kernowdev\Clanbite\Extensions\Notification\Notification_Data_Access

Parameters

$data (array<string, mixed>) Required

Notification data.

  • $user_id int Required. User to notify.
  • $type string Required. Notification type slug.
  • $title string Required. Short title.
  • $message string Optional. Longer message.
  • $url string Optional. Link URL.
  • $actor_id int Optional. User who triggered the notification.
  • $object_type string Optional. Related object type (e.g., 'team', 'post').
  • $object_id int Optional. Related object ID.
  • $data array Optional. Additional data (JSON encoded).
  • $actions array Optional. Action buttons (see clanbite_notify for format).

Returns

int|\WP_Error Notification ID or error.

Defined in inc/extensions/notifications/class-notification-data-access.php