Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,24 @@ if ( file_exists( __DIR__ . '/vendor/easy-digital-downloads/edd-sl-sdk/edd-sl-sd
- `file` - The main plugin file. Not needed for themes.
- `type` - `plugin` or `theme`. Not needed for plugins.
- `weekly_check` - Optional: whether to make a weekly request to confirm the license status. Defaults to true.

## Admin Notices

The SDK includes a `Notices` class for displaying admin notices. To use it, create an instance and add notices:

```php
use EasyDigitalDownloads\Updater\Admin\Notices;

// Create notices instance
$notices = new Notices();

// Add a notice
$notices->add( array(
'id' => 'my-notice-id',
'type' => 'success', // 'success', 'error', 'warning', 'info'
'message' => 'Your license has been activated successfully!',
'classes' => array( 'my-custom-class' ) // Optional additional CSS classes
) );
```

The notice will be automatically displayed on admin pages. The `Notices` class handles rendering and styling according to WordPress admin notice standards.
2 changes: 1 addition & 1 deletion src/Admin/Notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct() {
* @since <next-version>
* @param array $args The notice arguments.
*/
public static function add( array $args ) {
public function add( array $args ) {
$args = wp_parse_args(
$args,
array(
Expand Down