pfeifferNet

User_Notifications
in package

User notifications functionality.

Applies to any person with login credentials. Shows notifications on the user home page.

Tags
since
5.7.0
since
5.11.0

Deprecated global singleton.

Table of Contents

Properties

$instances  : array<string|int, object>
The array of instances of this class and sub-classes.
$messages  : Messages
The instance of the Messages class.
$user  : User
The instance of the User class.

Methods

get_instance()  : object
Creates and/or returns the instance of this class.
render()  : void
Maybe render the user notifications section.
__construct()  : void
Initialise the class.
get_notifications()  : array<string|int, string>
Return marked up notifications.

Properties

$instances

The array of instances of this class and sub-classes.

protected static array<string|int, object> $instances = array()
Tags
since
5.11.0

Methods

get_instance()

Creates and/or returns the instance of this class.

public static get_instance() : object
Tags
since
5.11.0
Return values
object

The instance of this class.

get_notifications()

Return marked up notifications.

protected get_notifications([int $user_id = 0 ]) : array<string|int, string>

This will only echo output if there are notifications to show.

Parameters
$user_id : int = 0

The user id.

Tags
since
5.7.0
since
6.0.0

Refactor to use new UI notification handling.

uses
Messages::get_banner()
uses
User::get_data()
uses
User::get_user_home_url()
Return values
array<string|int, string>

An array of marked up notifications,


        
On this page

Search results