CoreFiles by mySites.guru
customize.js27 lines, 821 bytes, from wordpress-5.9.21.zip
Raw History Compare with 5.9.20
md5
ce068783c3d038375ebd6121ebd0f201
sha1
7811e1bd1a17568a7f0de2bc7f963d17fb848fe6
sha256
2757641ec76a65bf9ab8ea03216b0e86d4b087e1e100407e65e364852468af79
/* global wp, jQuery */

( function( $, api ) {
	$( function() {
		// Make it possible to reset the color based on a radio input's value.
		// `active` can be either `custom` or `default`.
		api.control( 'accent_hue_active' ).setting.bind( function( active ) {
			var control = api.control( 'accent_hue' ); // Get the accent hue control.

			if ( 'custom' === active ) {
				// Activate the hue color picker control and focus it.
				control.activate( {
					completeCallback: function() {
						control.focus();
					}
				} );
			} else {
				// If the `custom` option isn't selected, deactivate the hue color picker and set a default.
				control.deactivate( {
					completeCallback: function() {
						control.setting.set( control.params.defaultValue );
					}
				} );
			}
		} );
	} );
}( jQuery, wp.customize ) );

The same content is in 66 releases, WordPress 5.9-beta1 to 6.1-RC1. See them all, or every version of this file.