Skip to content

Commit 8c8c2c2

Browse files
committed
Add Admin Notices documentation to README
- Document how to use the Notices class for displaying admin notifications - Include code examples showing proper instantiation and usage - Explain available notice types and configuration options - Reflects the non-static implementation of the add() method Closes #23
1 parent d822803 commit 8c8c2c2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

readme.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,24 @@ if ( file_exists( __DIR__ . '/vendor/easy-digital-downloads/edd-sl-sdk/edd-sl-sd
108108
- `file` - The main plugin file. Not needed for themes.
109109
- `type` - `plugin` or `theme`. Not needed for plugins.
110110
- `weekly_check` - Optional: whether to make a weekly request to confirm the license status. Defaults to true.
111+
112+
## Admin Notices
113+
114+
The SDK includes a `Notices` class for displaying admin notices. To use it, create an instance and add notices:
115+
116+
```php
117+
use EasyDigitalDownloads\Updater\Admin\Notices;
118+
119+
// Create notices instance
120+
$notices = new Notices();
121+
122+
// Add a notice
123+
$notices->add( array(
124+
'id' => 'my-notice-id',
125+
'type' => 'success', // 'success', 'error', 'warning', 'info'
126+
'message' => 'Your license has been activated successfully!',
127+
'classes' => array( 'my-custom-class' ) // Optional additional CSS classes
128+
) );
129+
```
130+
131+
The notice will be automatically displayed on admin pages. The `Notices` class handles rendering and styling according to WordPress admin notice standards.

0 commit comments

Comments
 (0)