piotrpress / wordpress-notice
This library simplifies the displaying of Notices in the WordPress dashboard.
v1.1.0
2024-09-16 12:41 UTC
Requires
- php: >=7.4
- piotrpress/elementor: ^2.0.0
- piotrpress/wordpress-hooks: ^5.3.0
This package is auto-updated.
Last update: 2024-10-16 12:55:32 UTC
README
This library simplifies the displaying of Notices in the WordPress dashboard.
Installation
$ composer require piotrpress/wordpress-notice
Example
require __DIR__ . '/vendor/autoload.php'; namespace PiotrPress\WordPress; // Example #1 echo new Notice( 'This is an example notice message', Notice::ERROR ); // Example #2 Hooks::add( new Notice( 'This is an example notice message', Notice::ERROR ) );
Arguments
string
$message - The notice message.string
$type - The notice type. Possible values areNotice::INFO
,Notice::SUCCESS
,Notice::WARNING
,Notice::ERROR
. Default isnull
.bool
$dismissible - Whether the notice is dismissible. Possible values aretrue
,false
. Default isfalse
.bool
$alt - The alternative notice display style (with filled-in background). Possible values aretrue
,false
. Default isfalse
.
Requirements
PHP >= 7.4
version.