If you do not wish to use Composer, you can [download the latest release](https://gitlab.com/wpdesk/wp-notice/-/jobs/artifacts/master/download?job=library). Then, to use the Notices, include the init.php file.
If you prefer not to use the Composer you can also [download the latest library release](https://gitlab.com/wpdesk/wp-notice/-/jobs/artifacts/master/download?job=library). Once it is done, simply include the init.php file to use the Notices.
$notice=wpdesk_wp_notice('Notice text goes here');
...
...
@@ -57,13 +57,13 @@ $notice = \WPDesk\Notice\Factory::notice('Notice text goes here');
$notice=new\WPDesk\Notice\Notice('Notice text goes here');
```
Notice must be used before WordPress action `admin_notices`. WordPress admin actions order is listed [here](https://codex.wordpress.org/Plugin_API/Action_Reference#Actions_Run_During_an_Admin_Page_Request).
Please mind that the Notice must be used before WordPress `admin_notices` action. You can find WordPress admin actions order listed [here](https://codex.wordpress.org/Plugin_API/Action_Reference#Actions_Run_During_an_Admin_Page_Request).
## Permanent dismissible notices
## Permanently dismissible notices
### AJAX handler
To use permanent dismissible notices AJAX handler must be created and hooks initialized:
In order to use permanently dismissible notices the AJAX handler needs to be created first and the hooks initialized: