LLMS_Abstract_Notification_Controller::get_mock_view( string $type = 'basic', int $subscriber = null, int $user_id = null, int $post_id = null )

Get a fake instance of a view, used for managing options & customization on the admin panel


Parameters Parameters

$type

(string) (Optional) Notification type. Default is 'basic'.

Default value: 'basic'

$subscriber

(int) (Optional) Subscriber id. When not provided the current user id will be used.

Default value: null

$user_id

(int) (Optional) User id. When not provided the current user id will be used.

Default value: null

$post_id

(int) (Optional) Post id. When not provided the post_id ($this->post_id) associated with the notification will be used.

Default value: null


Top ↑

Return Return

(LLMS_Abstract_Notification_View|false)


Top ↑

Source Source

File: includes/abstracts/llms.abstract.notification.controller.php

	public function get_mock_view( $type = 'basic', $subscriber = null, $user_id = null, $post_id = null ) {

		$notification = new LLMS_Notification();
		$notification->set( 'type', $type );
		$notification->set( 'subscriber', $subscriber ? $subscriber : get_current_user_id() );
		$notification->set( 'user_id', $user_id ? $user_id : get_current_user_id() );
		$notification->set( 'post_id', $post_id );
		$notification->set( 'trigger_id', $this->id );

		return llms()->notifications()->get_view( $notification );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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