LLMS_Abstract_Notification_View::__construct( mixed $notification )
Constructor
Parameters Parameters
- $notification
-
(mixed) (Required) Notification id, instance of LLMS_Notification or an object containing at least an 'id'.
Return Return
(void)
Source Source
File: includes/abstracts/llms.abstract.notification.view.php
public function __construct( $notification ) {
if ( is_numeric( $notification ) ) {
$this->id = $notification;
$this->notification = new LLMS_Notification( $notification );
} elseif ( is_a( $notification, 'LLMS_Notification' ) ) {
$this->id = $notification->get( 'id' );
$this->notification = $notification;
} elseif ( is_object( $notification ) && isset( $notification->id ) ) {
$this->id = $notification->id;
$this->notification = new LLMS_Notification( $notification->id );
}
$this->subscriber = new LLMS_Student( $this->notification->get( 'subscriber' ) );
$this->user = new LLMS_Student( $this->notification->get( 'user_id' ) );
$this->post = $this->get_object();
$this->basic_options = apply_filters( $this->get_filter( 'basic_options' ), $this->basic_options, $this );
add_filter( 'llms_user_info_shortcode_user_id', array( $this, 'set_shortcode_user' ) );
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 5.0.0 | Force [llms-user] shortocde to the user ID of the user who triggered the notification. |
| 3.8.0 | |
| 3.37.19 | Moved the retrieval of the associated llms post into a protected method. |
| 3.31.0 | Introduced. |