Changeset 49320 for trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize.php
- Timestamp:
- 10/27/2020 01:58:37 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize.php
r49247 r49320 147 147 ) 148 148 ); 149 150 $wp_customize->add_setting(151 'respect_user_color_preference',152 array(153 'capability' => 'edit_theme_options',154 'default' => true,155 'sanitize_callback' => function( $value ) {156 return (bool) $value;157 },158 )159 );160 161 $wp_customize->add_control(162 'respect_user_color_preference',163 array(164 'type' => 'checkbox',165 'section' => 'colors',166 'label' => esc_html__( 'Respect visitor\'s device dark mode settings', 'twentytwentyone' ),167 'description' => __( 'Dark mode is a device setting. If a visitor to your site requests it, your site will be shown with a dark background and light text.', 'twentytwentyone' ),168 'active_callback' => function( $value ) {169 return 127 < Twenty_Twenty_One_Custom_Colors::get_relative_luminance_from_hex( get_theme_mod( 'background_color', 'D1E4DD' ) );170 },171 )172 );173 149 } 174 150
Note: See TracChangeset
for help on using the changeset viewer.