LLMS_AJAX_Handler::notifications_heartbeart( array $request )

Handle notification display & dismissal


Parameters Parameters

$request

(array) (Required) $_POST data.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/class.llms.ajax.handler.php

	/**
	 * Handle notification display & dismissal.
	 *
	 * @since 3.8.0
	 * @since 3.37.14 Use strict comparison.
	 * @since 7.1.0 Improve notifications query performance by not calculating unneeded found rows.
	 *
	 * @param array $request $_POST data.
	 * @return array
	 */
	public static function notifications_heartbeart( $request ) {

		if ( ! is_user_logged_in() ) {
			wp_die();
		}

		$ret = array(
			'new' => array(),
		);

		if ( ! empty( $request['dismissals'] ) ) {
			foreach ( $request['dismissals'] as $nid ) {
				$noti = new LLMS_Notification( $nid );
				if ( get_current_user_id() === absint( $noti->get( 'subscriber' ) ) ) {
					$noti->set( 'status', 'read' );
				}
			}
		}


Top ↑

Changelog Changelog

Changelog
Version Description
3.8.0
3.37.14 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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