LLMS_Abstract_Notification_Controller::send( bool $force = false, null|string[] $filter_types = null )
Send all the subscriptions
Parameters Parameters
- $force
-
(bool) (Optional) If true, will force a send even if duplicates. Default is
false.<br> Only applies to controllers that flag $this->auto_dupcheck to true.Default value: false
- $filter_types
-
(null|string[]) (Optional) Array of notification types to be sent. Default is
null.<br> When not provided (null) all the types.Default value: null
Return Return
(void)
Source Source
File: includes/abstracts/llms.abstract.notification.controller.php
public function send( $force = false, $filter_types = null ) {
$this->add_subscriptions( $filter_types );
foreach ( $this->get_subscriptions() as $subscriber => $types ) {
foreach ( $types as $type ) {
/**
* Filter to determine if a notification should be sent to a subscriber.
*
* @since 9.0.0
*/
if ( ! apply_filters( 'llms_send_notification_to_subscriber', true, $this, $subscriber, $type, $this->post_id ) ) {
continue;
}
$this->send_one( $type, $subscriber, $force );
}
}
/**
* Cleanup subscriptions so if the notification
* is triggered again we don't have incorrect subscribers
* on the next trigger.
* This happens when receipts are triggered in bulk by action scheduler.
*/
$this->unset_subscriptions();
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 5.2.0 | Added parameter to only send notifications of specific types. |
| 3.8.0 | |
| 3.11.0 | Introduced. |