Dismiss
The Dismiss class, responsible for dismissing and checking the status of admin notices.
Tags
Table of Contents
- $id : string
- The notice-ID.
- $prefix : string
- The prefix we'll be using for the option/user-meta.
- $scope : string
- The notice's scope. Can be "user" or "global".
- __construct() : mixed
- Constructor.
- ajax_maybe_dismiss_notice() : void
- Run check to see if we need to dismiss the notice.
- is_dismissed() : bool
- Check if the notice has been dismissed or not.
- print_script() : void
- Print the script for dismissing the notice.
- dismiss_notice() : void
- Actually dismisses the notice.
Properties
$id
The notice-ID.
private
string
$id
Tags
$prefix
The prefix we'll be using for the option/user-meta.
private
string
$prefix
Tags
$scope
The notice's scope. Can be "user" or "global".
private
string
$scope
Tags
Methods
__construct()
Constructor.
public
__construct(string $id, string $prefix[, mixed $scope = 'global' ]) : mixed
Parameters
- $id : string
-
A unique ID for this notice. Can contain lowercase characters and underscores.
- $prefix : string
-
The prefix that will be used for the option/user-meta.
- $scope : mixed = 'global'
Tags
Return values
mixed —ajax_maybe_dismiss_notice()
Run check to see if we need to dismiss the notice.
public
ajax_maybe_dismiss_notice() : void
If all tests are successful then call the dismiss_notice() method.
Tags
Return values
void —is_dismissed()
Check if the notice has been dismissed or not.
public
is_dismissed() : bool
Tags
Return values
bool —print_script()
Print the script for dismissing the notice.
public
print_script() : void
Tags
Return values
void —dismiss_notice()
Actually dismisses the notice.
private
dismiss_notice() : void