From 31ce230c589f06282a07883802a257f7bda10145 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 15 Jan 2018 23:46:02 +0000 Subject: [PATCH] Widgets: When checking for errors in Custom HTML widget, pass correct value to `toggleClass()` for Save button. `toggleClass()` expects a boolean as a second argument, not an integer. Props iCaleb. Fixes #42867. git-svn-id: https://develop.svn.wordpress.org/trunk@42457 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/widgets/custom-html-widgets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/js/widgets/custom-html-widgets.js b/src/wp-admin/js/widgets/custom-html-widgets.js index 6d5b1679c8..5469755870 100644 --- a/src/wp-admin/js/widgets/custom-html-widgets.js +++ b/src/wp-admin/js/widgets/custom-html-widgets.js @@ -215,7 +215,7 @@ wp.customHtmlWidgets = ( function( $ ) { * @returns {void} */ onUpdateErrorNotice: function onUpdateErrorNotice( errorAnnotations ) { - control.saveButton.toggleClass( 'validation-blocked disabled', errorAnnotations.length ); + control.saveButton.toggleClass( 'validation-blocked disabled', errorAnnotations.length > 0 ); control.updateErrorNotice( errorAnnotations ); } });