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.


Top ↑

Return Return

(void)


Top ↑

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 );
		}



Top ↑

Changelog Changelog

Changelog
Version Description
5.2.0 Use strict type comparison.
3.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.