LLMS_Abstract_Notification_Controller::subscribe( mixed $subscriber, string $type )
Subscribe a user to a notification type
Parameters Parameters
- $subscriber
-
(mixed) (Required) WP User ID, email address, etc...
- $type
-
(string) (Required) Identifier for a subscription type eg: basic.
Return Return
(void)
Source Source
File: includes/abstracts/llms.abstract.notification.controller.php
* @param string $type Identifier for a subscription type eg: basic. * @return void */ public function subscribe( $subscriber, $type ) { // Prevent unsupported types from being subscribed. if ( ! $this->supports( $type ) ) { return; } $subscriptions = $this->get_subscriber_subscriptions( $subscriber ); if ( ! in_array( $type, $subscriptions, true ) ) { array_push( $subscriptions, $type ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
5.2.0 | Use strict type comparison. |
3.8.0 | Introduced. |