piotrpress / wordpress-notice
This library simplifies the displaying of Notices in the WordPress dashboard.
Installs: 52
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/piotrpress/wordpress-notice
Requires
- php: >=7.4
- piotrpress/elementor: ^2.0.0
- piotrpress/wordpress-hooks: ^5.3.0
This package is auto-updated.
Last update: 2025-10-16 14:57:28 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.