LLMS_Notifications::enqueue_basic()

Enqueue basic notifications for onscreen display


Return Return

(void)


Top ↑

Source Source

File: includes/notifications/class.llms.notifications.php

			array(
				'per_page'   => 5,
				'statuses'   => 'new',
				'types'      => 'basic',
				'subscriber' => $user_id,
			)
		);

		$this->displayed = $query->get_notifications();

		// Push to JS.
		llms()->assets->enqueue_inline(
			'llms-queued-notifications',
			'window.llms.queued_notifications = ' . wp_json_encode( $this->displayed ) . ';',
			'footer'
		);

	}

	/**
	 * Record notifications as read.
	 *
	 * Ensures that notifications are not missed due to redirects that happen after `wp`.
	 *
	 * @since 3.36.1
	 *
	 * @return void


Top ↑

Changelog Changelog

Changelog
Version Description
4.4.0 Use LLMS_Assets::enqueue_inline() in favor of deprecated LLMS_Frontend_Assets::enqueue_inline_script().
3.38.0 Use wp_json_decode() in favor of json_decode().
3.36.1 Don't automatically mark notifications as read.
3.22.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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