[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 /* global twentytwentyoneGetHexLum */ 2 3 ( function() { 4 // Wait until the customizer has finished loading. 5 wp.customize.bind( 'ready', function() { 6 // Hide the "respect_user_color_preference" setting if the background-color is dark. 7 if ( 127 > twentytwentyoneGetHexLum( wp.customize( 'background_color' ).get() ) ) { 8 wp.customize.control( 'respect_user_color_preference' ).deactivate(); 9 wp.customize.control( 'respect_user_color_preference_notice' ).deactivate(); 10 } 11 12 // Handle changes to the background-color. 13 wp.customize( 'background_color', function( setting ) { 14 setting.bind( function( value ) { 15 if ( 127 > twentytwentyoneGetHexLum( value ) ) { 16 wp.customize.control( 'respect_user_color_preference' ).deactivate(); 17 wp.customize.control( 'respect_user_color_preference_notice' ).activate(); 18 } else { 19 wp.customize.control( 'respect_user_color_preference' ).activate(); 20 wp.customize.control( 'respect_user_color_preference_notice' ).deactivate(); 21 } 22 } ); 23 } ); 24 } ); 25 }() );
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated : Sun Dec 22 08:20:01 2024 | Cross-referenced by PHPXref |