Notices

The Admin_Notice class, responsible for creating admin notices.

Each notice is a new instance of the object.

Tags
since
1.0.0

Table of Contents

$notices  : array<string|int, mixed>
An array of notices.
add()  : void
Add a notice.
boot()  : void
Adds actions for the 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

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

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