Created
January 17, 2017 18:26
-
-
Save westonruter/6d4981b1d5e9f12faaba253b9f14745e to your computer and use it in GitHub Desktop.
Add a notification of each type to each customizer setting: paste this into your console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp.customize.each( function( setting ) { | |
var notifications = [ | |
new wp.customize.Notification( 'example-error', { 'message': 'This is an example error.', type: 'error' } ), | |
new wp.customize.Notification( 'example-warning', { 'message': 'This is an example warning.', type: 'warning' } ), | |
new wp.customize.Notification( 'example-info', { 'message': 'This is an example info.', type: 'info' } ), | |
new wp.customize.Notification( 'example-notice', { 'message': 'This is an example notice.', type: 'notice' } ), | |
]; | |
_.each( notifications, function ( notification ) { | |
setting.notifications.add( notification.code, notification ); | |
} ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment