Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/piotrpress/wordpress-notice
This library simplifies the displaying of Notices in the WordPress dashboard.
https://github.com/piotrpress/wordpress-notice
Last synced: 5 days ago
JSON representation
This library simplifies the displaying of Notices in the WordPress dashboard.
- Host: GitHub
- URL: https://github.com/piotrpress/wordpress-notice
- Owner: PiotrPress
- License: gpl-3.0
- Created: 2024-08-27T09:25:35.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-09-16T12:42:33.000Z (about 2 months ago)
- Last Synced: 2024-09-16T14:41:42.321Z (about 2 months ago)
- Language: PHP
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
# WordPress Notice
This library simplifies the displaying of Notices in the WordPress dashboard.
## Installation
```shell
$ composer require piotrpress/wordpress-notice
```## Example
```php
require __DIR__ . '/vendor/autoload.php';namespace PiotrPress\WordPress;
// Example #1
echo new Notice( 'This is an example notice message', Notice::ERROR );// Example #2
Hooks::add( new Notice( 'This is an example notice message', Notice::ERROR ) );
```## Arguments
- `string` **$message** - The notice message.
- `string` **$type** - The notice type. Possible values are `Notice::INFO`, `Notice::SUCCESS`, `Notice::WARNING`, `Notice::ERROR`. Default is `null`.
- `bool` **$dismissible** - Whether the notice is dismissible. Possible values are `true`, `false`. Default is `false`.
- `bool` **$alt** - The alternative notice display style (with filled-in background). Possible values are `true`, `false`. Default is `false`.## Requirements
PHP >= `7.4` version.
## License
[GPL3.0](license.txt)