piotrpress / wordpress-notice
该库简化了在WordPress仪表板中显示通知的功能。
v1.1.0
2024-09-16 12:41 UTC
Requires
- php: >=7.4
- piotrpress/elementor: ^2.0.0
- piotrpress/wordpress-hooks: ^5.3.0
This package is auto-updated.
Last update: 2024-09-16 12:42:36 UTC
README
该库简化了在WordPress仪表板中显示通知的功能。
安装
$ composer require piotrpress/wordpress-notice
示例
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 ) );
参数
string
$message - 通知消息。string
$type - 通知类型。可能的值有Notice::INFO
、Notice::SUCCESS
、Notice::WARNING
、Notice::ERROR
。默认是null
。bool
$dismissible - 通知是否可忽略。可能的值有true
、false
。默认是false
。bool
$alt - 通知的替代显示样式(带有填充背景)。可能的值有true
、false
。默认是false
。
需求
PHP >= 7.4
版本。