[wp-trac] [WordPress Trac] #42682: Allow customize notifications to be auto dismissed after a delay

WordPress Trac noreply at wordpress.org
Thu Nov 23 15:06:22 UTC 2017


#42682: Allow customize notifications to be auto dismissed after a delay
-------------------------+-----------------------------
 Reporter:  nikeo        |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Customize    |    Version:  4.9
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 The notifications are one of the great recent additions to the customizer
 but there's currently no way to create auto dismissible notifications.
 Once rendered, it requires a user action to dismiss a notification.

 My proposition is a basic way to implement this, by allowing the
 {{{dismissible}}} param to accept either a boolean param ( as it is right
 now ) or a number indicating the delay in milliseconds after which the
 notification should be auto dismissed.

 As far as my tests went, there's no risk of regression when using this
 param with either a boolean or number.
 Works fine when processing the notification template here :
 https://core.trac.wordpress.org/browser/trunk/src/wp-includes/class-wp-
 customize-manager.php#L4087

 The example below illustrates how to add a notification auto dismissed
 after 5 seconds.
 {{{#!javascript
 wp.customize.notifications.add( new wp.customize.Notification(
 'auto_dismissible_notification', {
     type: 'info',
     message: 'This notification will be auto dismissed after 5 seconds',
     dismissible: 5000
 } ) );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42682>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list