WordPress/wp-admin/css
Weston Ruter 87b0a1b989 Customize: Add setting validation model and control notifications to augment setting sanitization.
When a setting is invalid, not only will it be blocked from being saved but all other settings will be blocked as well. This ensures that Customizer saves aren't partial but are more transactional. User will be displayed the error in a notification so that they can fix and re-attempt saving.

PHP changes:

* Introduces `WP_Customize_Setting::validate()`, `WP_Customize_Setting::$validate_callback`, and the `customize_validate_{$setting_id}` filter.
* Introduces `WP_Customize_Manager::validate_setting_values()` to do validation (and sanitization) for the setting values supplied, returning a list of `WP_Error` instances for invalid settings.
* Attempting to save settings that are invalid will result in the save being blocked entirely, with the errors being sent in the `customize_save_response`. Modifies `WP_Customize_Manager::save()` to check all settings for validity issues prior to calling their `save` methods.
* Introduces `WP_Customize_Setting::json()` for parity with the other Customizer classes. This includes exporting of the `type`.
* Modifies `WP_Customize_Manager::post_value()` to apply `validate` after `sanitize`, and if validation fails, to return the `$default`.
* Introduces `customize_save_validation_before` action which fires right before the validation checks are made prior to saving.

JS changes:

* Introduces `wp.customize.Notification` in JS which to represent `WP_Error` instances returned from the server when setting validation fails.
* Introduces `wp.customize.Setting.prototype.notifications`.
* Introduces `wp.customize.Control.prototype.notifications`, which are synced with a control's settings' notifications.
* Introduces `wp.customize.Control.prototype.renderNotifications()` to re-render a control's notifications in its notification area. This is called automatically when the notifications collection changes.
* Introduces `wp.customize.settingConstructor`, allowing custom setting types to be used in the same way that custom controls, panels, and sections can be made.
* Injects a notification area into existing controls which is populated in response to the control's `notifications` collection changing. A custom control can customize the placement of the notification area by overriding the new `getNotificationsContainerElement` method.
* When a save fails due to setting invalidity, the invalidity errors will be added to the settings to then populate in the controls' notification areas, and the first such invalid control will be focused.

Props westonruter, celloexpressions, mrahmadawais.
See #35210.
See #30937.
Fixes #34893.

Built from https://develop.svn.wordpress.org/trunk@37476


git-svn-id: http://core.svn.wordpress.org/trunk@37444 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-20 21:10:27 +00:00
..
colors Accessibility: Improve the color contrast ratio for the input placeholders. 2016-02-22 23:29:26 +00:00
about-rtl.css 4.5 About Page, second round. 2016-04-10 02:03:29 +00:00
about-rtl.min.css 4.5 About Page, second round. 2016-04-10 02:03:29 +00:00
about.css 4.5 About Page, second round. 2016-04-10 02:03:29 +00:00
about.min.css 4.5 About Page, second round. 2016-04-10 02:03:29 +00:00
admin-menu-rtl.css Multisite: Use the admin-multisite Dashicon for sites 2016-05-05 17:13:26 +00:00
admin-menu-rtl.min.css Multisite: Use the admin-multisite Dashicon for sites 2016-05-05 17:13:26 +00:00
admin-menu.css Multisite: Use the admin-multisite Dashicon for sites 2016-05-05 17:13:26 +00:00
admin-menu.min.css Multisite: Use the admin-multisite Dashicon for sites 2016-05-05 17:13:26 +00:00
color-picker-rtl.css Accessibility: Reduce the WordPress shades of grey, Episode 3. 2016-03-09 19:51:26 +00:00
color-picker-rtl.min.css Accessibility: Reduce the WordPress shades of grey, Episode 3. 2016-03-09 19:51:26 +00:00
color-picker.css Accessibility: Reduce the WordPress shades of grey, Episode 3. 2016-03-09 19:51:26 +00:00
color-picker.min.css Accessibility: Reduce the WordPress shades of grey, Episode 3. 2016-03-09 19:51:26 +00:00
common-rtl.css Accessibility: make the tab order match the visual order in the Edit terms screens. 2016-05-16 13:02:29 +00:00
common-rtl.min.css Accessibility: make the tab order match the visual order in the Edit terms screens. 2016-05-16 13:02:29 +00:00
common.css Accessibility: make the tab order match the visual order in the Edit terms screens. 2016-05-16 13:02:29 +00:00
common.min.css Accessibility: make the tab order match the visual order in the Edit terms screens. 2016-05-16 13:02:29 +00:00
customize-controls-rtl.css Customize: Add setting validation model and control notifications to augment setting sanitization. 2016-05-20 21:10:27 +00:00
customize-controls-rtl.min.css Customize: Add setting validation model and control notifications to augment setting sanitization. 2016-05-20 21:10:27 +00:00
customize-controls.css Customize: Add setting validation model and control notifications to augment setting sanitization. 2016-05-20 21:10:27 +00:00
customize-controls.min.css Customize: Add setting validation model and control notifications to augment setting sanitization. 2016-05-20 21:10:27 +00:00
customize-nav-menus-rtl.css Customize: Fix toggle of title attribute field visibility on nav menus admin page. 2016-03-30 21:55:27 +00:00
customize-nav-menus-rtl.min.css Customize: Fix toggle of title attribute field visibility on nav menus admin page. 2016-03-30 21:55:27 +00:00
customize-nav-menus.css Customize: Fix toggle of title attribute field visibility on nav menus admin page. 2016-03-30 21:55:27 +00:00
customize-nav-menus.min.css Customize: Fix toggle of title attribute field visibility on nav menus admin page. 2016-03-30 21:55:27 +00:00
customize-widgets-rtl.css Accessibility: Improve the color contrast ratio of the expandable panel "handles". 2016-03-10 21:44:26 +00:00
customize-widgets-rtl.min.css Accessibility: Improve the color contrast ratio of the expandable panel "handles". 2016-03-10 21:44:26 +00:00
customize-widgets.css Accessibility: Improve the color contrast ratio of the expandable panel "handles". 2016-03-10 21:44:26 +00:00
customize-widgets.min.css Accessibility: Improve the color contrast ratio of the expandable panel "handles". 2016-03-10 21:44:26 +00:00
dashboard-rtl.css Drop Open Sans in the admin in favor of system fonts. 2016-05-04 22:07:37 +00:00
dashboard-rtl.min.css Accessibility: Reduce the WordPress shades of grey, Episode 3. 2016-03-09 19:51:26 +00:00
dashboard.css Drop Open Sans in the admin in favor of system fonts. 2016-05-04 22:07:37 +00:00
dashboard.min.css Accessibility: Reduce the WordPress shades of grey, Episode 3. 2016-03-09 19:51:26 +00:00
deprecated-media-rtl.css Accessibility: Reduce the WordPress shades of grey, Episode 3. 2016-03-09 19:51:26 +00:00
deprecated-media-rtl.min.css Accessibility: Reduce the WordPress shades of grey, Episode 3. 2016-03-09 19:51:26 +00:00
deprecated-media.css Accessibility: Reduce the WordPress shades of grey, Episode 3. 2016-03-09 19:51:26 +00:00
deprecated-media.min.css Accessibility: Reduce the WordPress shades of grey, Episode 3. 2016-03-09 19:51:26 +00:00
edit-rtl.css Accessibility: make the tab order match the visual order in the Edit terms screens. 2016-05-16 13:02:29 +00:00
edit-rtl.min.css Accessibility: make the tab order match the visual order in the Edit terms screens. 2016-05-16 13:02:29 +00:00
edit.css Accessibility: make the tab order match the visual order in the Edit terms screens. 2016-05-16 13:02:29 +00:00
edit.min.css Accessibility: make the tab order match the visual order in the Edit terms screens. 2016-05-16 13:02:29 +00:00
farbtastic-rtl.css Stop using .rtl classes, instead relying on flipping LTR CSS to RTL. 2013-11-17 16:18:11 +00:00
farbtastic-rtl.min.css CSS: Stop using `wp-admin.min.css` and instead queue the individual stylesheets up through `load-styles.php`. 2016-01-18 09:57:29 +00:00
farbtastic.css Stop using .rtl classes, instead relying on flipping LTR CSS to RTL. 2013-11-17 16:18:11 +00:00
farbtastic.min.css CSS: Stop using `wp-admin.min.css` and instead queue the individual stylesheets up through `load-styles.php`. 2016-01-18 09:57:29 +00:00
forms-rtl.css Refine the FTP credentials form interaction. 2016-05-19 22:59:28 +00:00
forms-rtl.min.css Refine the FTP credentials form interaction. 2016-05-19 22:59:28 +00:00
forms.css Refine the FTP credentials form interaction. 2016-05-19 22:59:28 +00:00
forms.min.css Refine the FTP credentials form interaction. 2016-05-19 22:59:28 +00:00
ie-rtl.css Accessibility: Reduce the WordPress shades of grey, Episode 3. 2016-03-09 19:51:26 +00:00
ie-rtl.min.css Accessibility: Reduce the WordPress shades of grey, Episode 3. 2016-03-09 19:51:26 +00:00
ie.css Accessibility: Reduce the WordPress shades of grey, Episode 3. 2016-03-09 19:51:26 +00:00
ie.min.css Accessibility: Reduce the WordPress shades of grey, Episode 3. 2016-03-09 19:51:26 +00:00
install-rtl.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
install-rtl.min.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
install.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
install.min.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
l10n-rtl.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
l10n-rtl.min.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
l10n.css ru_RU: In back-compat styles for admin menu, inherit the width from the parent element, `#adminmenuwrap`, to account for media queries. 2015-11-20 01:40:25 +00:00
l10n.min.css CSS: Stop using `wp-admin.min.css` and instead queue the individual stylesheets up through `load-styles.php`. 2016-01-18 09:57:29 +00:00
list-tables-rtl.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
list-tables-rtl.min.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
list-tables.css Accessibility: Improve the color contrast ratio of the expandable panel "handles". 2016-03-10 21:44:26 +00:00
list-tables.min.css Accessibility: Improve the color contrast ratio of the expandable panel "handles". 2016-03-10 21:44:26 +00:00
login-rtl.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
login-rtl.min.css Refine the FTP credentials form interaction. 2016-05-19 22:59:28 +00:00
login.css Drop Open Sans in the admin in favor of system fonts. 2016-05-04 22:07:37 +00:00
login.min.css Refine the FTP credentials form interaction. 2016-05-19 22:59:28 +00:00
media-rtl.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
media-rtl.min.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
media.css Accessibility: change the close "X" in the Media "Attach to existing content" modal in a button. 2016-04-17 16:58:26 +00:00
media.min.css Accessibility: change the close "X" in the Media "Attach to existing content" modal in a button. 2016-04-17 16:58:26 +00:00
nav-menus-rtl.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
nav-menus-rtl.min.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
nav-menus.css Accessibility: Reduce the WordPress shades of grey, Episode 3. 2016-03-09 19:51:26 +00:00
nav-menus.min.css Accessibility: Reduce the WordPress shades of grey, Episode 3. 2016-03-09 19:51:26 +00:00
press-this-editor-rtl.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
press-this-editor-rtl.min.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
press-this-editor.css Drop Open Sans in the admin in favor of system fonts. 2016-05-04 22:07:37 +00:00
press-this-editor.min.css Drop Open Sans in the admin in favor of system fonts. 2016-05-04 22:07:37 +00:00
press-this-rtl.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
press-this-rtl.min.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
press-this.css Drop Open Sans in the admin in favor of system fonts. 2016-05-04 22:07:37 +00:00
press-this.min.css Drop Open Sans in the admin in favor of system fonts. 2016-05-04 22:07:37 +00:00
revisions-rtl.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
revisions-rtl.min.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
revisions.css Accessibility: Reduce the WordPress shades of grey, Episode 2. 2016-02-18 22:30:27 +00:00
revisions.min.css Accessibility: Reduce the WordPress shades of grey, Episode 2. 2016-02-18 22:30:27 +00:00
site-icon-rtl.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
site-icon-rtl.min.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
site-icon.css Customize: Reduce vertical space of site icon control. 2016-03-09 21:19:27 +00:00
site-icon.min.css Customize: Reduce vertical space of site icon control. 2016-03-09 21:19:27 +00:00
themes-rtl.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
themes-rtl.min.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
themes.css Customize: Increase the target size of the expand/collapse button in the customizer. 2016-05-01 20:29:27 +00:00
themes.min.css Customize: Increase the target size of the expand/collapse button in the customizer. 2016-05-01 20:29:27 +00:00
widgets-rtl.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
widgets-rtl.min.css Revive `grunt-rtlcss`, which does not appear to enjoy syntax errors. 2016-05-05 15:22:27 +00:00
widgets.css Widgets: When the Inactive Widgets section is hidden also hide the “Clear Inactive Widgets” button description text. 2016-04-28 20:40:28 +00:00
widgets.min.css Widgets: When the Inactive Widgets section is hidden also hide the “Clear Inactive Widgets” button description text. 2016-04-28 20:40:28 +00:00
wp-admin-rtl.css Introducing Site Icon, favicon management for WordPress. 2015-06-29 12:58:25 +00:00
wp-admin-rtl.min.css CSS: Stop using `wp-admin.min.css` and instead queue the individual stylesheets up through `load-styles.php`. 2016-01-18 09:57:29 +00:00
wp-admin.css Introducing Site Icon, favicon management for WordPress. 2015-06-29 12:58:25 +00:00
wp-admin.min.css CSS: Stop using `wp-admin.min.css` and instead queue the individual stylesheets up through `load-styles.php`. 2016-01-18 09:57:29 +00:00