Skip to content
Snippets Groups Projects
Commit 53c14ac2 authored by Grzegorz Rola's avatar Grzegorz Rola
Browse files

feature(readme): readme

parent 796d39c8
No related branches found
No related tags found
2 merge requests!22Feature/readme,!21feature(readme): readme
Pipeline #11388 canceled
......@@ -42,7 +42,7 @@ require_once('/path/to/wp-desk/wp-notice/init.php');
## Getting Started
Simple usage looks like:
###Simple usage looks like
```php
$notice = wpdesk_wp_notice('Notice text goes here');
......@@ -61,8 +61,24 @@ Notice must be used before WordPress action `admin_notices`. WordPress admin act
## Permanent dismissible notices
### AJAX handler
To use permanent dismissible notices AJAX handler must be created and hooks initialized:
```php
wpdesk_init_wp_notice_ajax_handler();
// Is equivalent to:
( new \WPDesk\Notice\AjaxHandler() )->hooks();
```
### Displaying
To display permanent dismissible notice:
```php
wpdesk_permanent_dismissible_wp_notice( 'Notice text goes here', 'notice-name' );
// Is equivalent to
new PermanentDismissibleNotice( 'Notice text goes here', 'notice-name' );
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment