WordPress Library to display notices in admin area.
wp-notice is a simple library for WordPress plugins to display notices in admin area.
This library can display simple notices (error, warning, success, info) and dismissible notices. It also handles dismiss functionality with AJAX requests.
Requirements
PHP 5.5 or later.
Composer
You can install the bindings via Composer. Run the following command:
composer require wpdesk/wp-notice:^1.0
To use the bindings, use Composer's autoload:
require_once 'vendor/autoload.php';
Getting Started
Simple usage looks like:
$notice = new Notice(Notice::NOTICE_TYPE_INFO, 'Notice text goes here', false);
Notice must be used before WordPress action admin_notices
. WordPress admin actions order is listed here.