Download the PHP package duckdev/wp-flash-notices without Composer
On this page you can find all versions of the php package duckdev/wp-flash-notices. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download duckdev/wp-flash-notices
More information about duckdev/wp-flash-notices
Files in duckdev/wp-flash-notices
Package wp-flash-notices
Short Description WordPress admin notices as flash notice using transient API to display after page reload.
License GPL-2.0+
Informations about the package wp-flash-notices
WP Flash Admin Notices
WordPress admin notices as flash notice using transient API to display after page reload.
By default WordPress doesn't provide a solution to show admin notices after page reload. Frameworks lik CodeIgniter does have a flash message feature. Using which, you can show one time notices across user interface. With this simple library you can make use of WordPress' transient API and show one time admin notices like a flash message.
Installation
You can install this library using composer
Or, you can download latest version of the library from releases tab.
Dependencies
- PHP 5.4+
- WordPress 4.0+
Usage Example
Import the library class and assign custom namespace.
Create new instance of the notices class with our custom transient name.
Notice Types
There are 4 types of notices.
Success Notice:
Notice with green bar.
Error Notice:
Notice with red bar.
Warning Notice:
Notice with yellow bar.
Info Notice:
Notice with blue bar.
Dismissible Notice
Show a dismiss button in notice.
Network Admin Notice
By default all notices are shown within single site admin screens. If you have Multisite you can add network admin notices by setting last argument as true:
Frontend Compatibility
If you'd like to print the notices in the front-end, then use the below action to your template.