Skip to content
Snippets Groups Projects

Feature/readme

Merged Krzysztof Dyszczyk requested to merge feature/readme into master
1 file
+ 21
1
Compare changes
  • Side-by-side
  • Inline
+ 24
0
@@ -82,3 +82,27 @@ wpdesk_permanent_dismissible_wp_notice( 'Notice text goes here', 'notice-name' )
// Is equivalent to
$notice = new \WPDesk\Notice\PermanentDismissibleNotice( 'Notice text goes here', 'notice-name' );
```
## Project documentation
### 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
$notice = new \WPDesk\Notice\PermanentDismissibleNotice( 'Notice text goes here', 'notice-name' );
```
Loading