Changeset 49247 for trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize.php
- Timestamp:
- 10/20/2020 06:24:33 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize.php
r49216 r49247 41 41 42 42 // Change site-title & description to postMessage. 43 $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; 44 $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; 43 $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; // @phpstan-ignore-line. Assume that this setting exists. 44 $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; // @phpstan-ignore-line. Assume that this setting exists. 45 45 46 46 // Add partial for blogname. … … 127 127 $palette = get_theme_support( 'editor-color-palette' ); 128 128 129 // Build the colors array from ourtheme-support.129 // Build the colors array from theme-support. 130 130 $colors = array(); 131 131 if ( isset( $palette[0] ) && is_array( $palette[0] ) ) { … … 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 ); 149 173 } 150 174
Note: See TracChangeset
for help on using the changeset viewer.