Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
LLMS_Abstract_Notification_Controller::add_subscriptions( null|string[] $filter_types = null )
Adds subscribers before sending a notifications
Parameters Parameters
- $filter_types
-
(null|string[]) (Optional) Array of notification types to be sent. Default is
null
. When not provided (null
) all the types.Default value: null
Return Return
(void)
Source Source
File: includes/abstracts/llms.abstract.notification.controller.php
private function add_subscriptions( $filter_types = null ) { foreach ( array_keys( $this->get_supported_types() ) as $type ) { if ( ! is_null( $filter_types ) && ! in_array( $type, $filter_types, true ) ) { continue; } foreach ( $this->get_subscribers_settings( $type ) as $subscriber_key => $enabled ) { if ( 'no' === $enabled ) { continue; } elseif ( 'custom' === $subscriber_key ) { $this->add_custom_subscriptions( $type ); } $subscriber = $this->get_subscriber( $subscriber_key ); if ( $subscriber ) { $this->subscribe( $subscriber, $type ); } } } }
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 | Introduced. |