Edit File by line
/home/barbar84/www/wp-conte.../themes/twentytw.../assets/js
File: customize.js
/* global twentytwentyoneGetHexLum */
[0] Fix | Delete
[1] Fix | Delete
( function() {
[2] Fix | Delete
// Wait until the customizer has finished loading.
[3] Fix | Delete
wp.customize.bind( 'ready', function() {
[4] Fix | Delete
// Hide the "respect_user_color_preference" setting if the background-color is dark.
[5] Fix | Delete
if ( 127 > twentytwentyoneGetHexLum( wp.customize( 'background_color' ).get() ) ) {
[6] Fix | Delete
wp.customize.control( 'respect_user_color_preference' ).deactivate();
[7] Fix | Delete
wp.customize.control( 'respect_user_color_preference_notice' ).deactivate();
[8] Fix | Delete
}
[9] Fix | Delete
[10] Fix | Delete
// Handle changes to the background-color.
[11] Fix | Delete
wp.customize( 'background_color', function( setting ) {
[12] Fix | Delete
setting.bind( function( value ) {
[13] Fix | Delete
if ( 127 > twentytwentyoneGetHexLum( value ) ) {
[14] Fix | Delete
wp.customize.control( 'respect_user_color_preference' ).deactivate();
[15] Fix | Delete
wp.customize.control( 'respect_user_color_preference_notice' ).activate();
[16] Fix | Delete
} else {
[17] Fix | Delete
wp.customize.control( 'respect_user_color_preference' ).activate();
[18] Fix | Delete
wp.customize.control( 'respect_user_color_preference_notice' ).deactivate();
[19] Fix | Delete
}
[20] Fix | Delete
} );
[21] Fix | Delete
} );
[22] Fix | Delete
} );
[23] Fix | Delete
}() );
[24] Fix | Delete
[25] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function