[wp-trac] [WordPress Trac] #30280: Clearing color in customizer not working

WordPress Trac noreply at wordpress.org
Sun Nov 9 22:24:49 UTC 2014


#30280: Clearing color in customizer not working
--------------------------+------------------------------
 Reporter:  sidati        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Customize     |     Version:  4.0
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by westonruter):

 Thanks for the report, sidati.

 I don't think the problem is related to changing the value to `null`. If
 you look at the [https://core.trac.wordpress.org/browser/tags/4.0/src/wp-
 includes/js/customize-base.js#L186 wp.customize.Value.set()] method:

 {{{#!js
 // Bail if the sanitized value is null or unchanged.
 if ( null === to || this._value === to )
     return this;
 }}}

 So you can't actually set a value to being `null`. And if you look at the
 [https://core.trac.wordpress.org/browser/tags/4.0/src/wp-admin/js
 /customize-controls.js#L170 ColorControl] you can see that the `clear`
 method doesn't set the setting's value to `null` but to `false`:

 {{{#!js
 control.setting.set( false );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30280#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list