wpplex / wp-notify
一个用于管理WordPress后台通知的小型类。
1.0.0
2015-04-29 15:37 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-09-28 18:34:47 UTC
README
一个用于管理WordPress后台通知的小型类。
用法
首先,您使用自定义前缀(通知的命名空间)初始化类。
$notify = new wpplex\WP_Notify\WP_Notify( 'my-notif' );
创建您的第一个通知
$id = 'notif-xxy';
$content = 'some random notif text';
$type = 'error';
$hide_button = true;
$notify->add_notification( $id, $content, $type, $hide_button );
显示您的通知
$id = 'notif-xxy';
$display_count = 20; // times
$notify->display_notification( $id, $display_count );
隐藏您的通知
$id = 'notif-xxy';
$notify->hide_notification( $id );