diff --git a/README.md b/README.md index 6e1c28bc4ce68c3195e32917da28233df71d3c1d..384bddfed1af8219362ec15f18a2e973457e143d 100644 --- a/README.md +++ b/README.md @@ -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 - ( new \WPDesk\Notice\AjaxHandler() )->hooks(); +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' ); ```