开发者 |
jcow
ekaj |
---|---|
更新时间 | 2015年6月13日 10:47 |
捐献地址: | 去捐款 |
PHP版本: | 3.6.1 及以上 |
WordPress版本: | 4.2.2 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
http://example.com/path/to/page/?update=true
will generate the message: "Updated." in the notification center.
Arguments for Messages
When adding a message, there are arguments you can use to customize the functionality.
error
When set to true, this will add the error class to the message. Default: falsefade
When set to true, this will fade the message out after 3 seconds. You can change the pause time by setting fade to a number (in milliseconds). Default: falsedismiss
Allows a message to be dismissed by the user with a close button. Default: falseevent
Allows message to be persistent, so that it shows up on each page load unless dismissed. The event tracks the message and updates the user's meta when the message is dismissed, so it will stop showing up. Default: falsepage
Lock a message to a specific page only. When page is set, a is_page($page)
check will be performed before showing the message. Particularly useful when setting up query variable pairs. Default: falseshow
action.
if ( $something_happened ) : do_action( 'sewn/notifications/add', $message, $args ); endif;