Notices extends Notices

Extends the WPTRT Notices class to allow additional HTML in the admin notice.

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Table of Contents

$notices  : array<string|int, mixed>
An array of notices.
__construct()  : mixed
Constructor.
add()  : void
Add a notice.
boot()  : void
Adds actions for the notices.
filter_allowed_html()  : array<string|int, mixed>
Filter allowed html in notices.
get()  : Notice|null
Get a single notice.
get_all()  : array<string|int, mixed>
Get all notices.
print_scripts()  : void
Prints scripts for the notices.
remove()  : void
Remove a notice.
the_notices()  : void
Prints the notice.

Properties

$notices

An array of notices.

private array<string|int, mixed> $notices = []
Tags
access

private

since
1.0

Methods

__construct()

Constructor.

public __construct() : mixed
Return values
mixed

add()

Add a notice.

public add(string $id, string $title, string $message[, array<string|int, mixed> $options = [] ]) : void
Parameters
$id : string

A unique ID for this notice. Can contain lowercase characters and underscores.

$title : string

The title for our notice.

$message : string

The message for our notice.

$options : array<string|int, mixed> = []

An array of additional options to change the defaults for this notice. See Notice::__constructor() for details.

Tags
access

public

since
1.0
Return values
void

boot()

Adds actions for the notices.

public boot() : void
Tags
access

public

since
1.0
Return values
void

filter_allowed_html()

Filter allowed html in notices.

public static filter_allowed_html(array<string|int, mixed> $allowed_html) : array<string|int, mixed>
Parameters
$allowed_html : array<string|int, mixed>
Return values
array<string|int, mixed>

get()

Get a single notice.

public get(string $id) : Notice|null
Parameters
$id : string

The unique ID of the notice we want to retrieve.

Tags
access

public

since
1.0
Return values
Notice|null

get_all()

Get all notices.

public get_all() : array<string|int, mixed>
Tags
access

public

since
1.0
Return values
array<string|int, mixed>

print_scripts()

Prints scripts for the notices.

public print_scripts() : void
Tags
access

public

since
1.0
Return values
void

remove()

Remove a notice.

public remove(string $id) : void
Parameters
$id : string

The unique ID of the notice we want to remove.

Tags
access

public

since
1.0
Return values
void

the_notices()

Prints the notice.

public the_notices() : void
Tags
access

public

since
1.0
Return values
void

Search results