\WPTRT\AdminNoticesDismiss

The Dismiss class, responsible for dismissing and checking the status of admin notices.

Summary

Methods
Properties
Constants
__construct()
print_script()
is_dismissed()
ajax_maybe_dismiss_notice()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
dismiss_notice()
$id
$prefix
$scope
N/A

Properties

$id

$id :string

The notice-ID.

Type

string

$prefix

$prefix :string

The prefix we'll be using for the option/user-meta.

Type

string

$scope

$scope :string

The notice's scope. Can be "user" or "global".

Type

string

Methods

__construct()

__construct(string  $id,string  $prefix,  $scope = 'global')

Constructor.

Parameters

string $id

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

string $prefix

The prefix that will be used for the option/user-meta.

$scope

print_script()

print_script(): void

Print the script for dismissing the notice.

is_dismissed()

is_dismissed(): boolean

Check if the notice has been dismissed or not.

Returns

boolean

ajax_maybe_dismiss_notice()

ajax_maybe_dismiss_notice(): void

Run check to see if we need to dismiss the notice.

If all tests are successful then call the dismiss_notice() method.

dismiss_notice()

dismiss_notice(): void

Actually dismisses the notice.