Ticket #45424: 45424.6.patch
File 45424.6.patch, 3.3 KB (added by , 6 years ago) |
---|
-
src/wp-content/themes/twentynineteen/inc/color-patterns.php
12 12 */ 13 13 function twentynineteen_custom_colors_css() { 14 14 15 if ( 'default' === get_theme_mod( 'primary_color', 'default' ) ) { 16 $primary_color = 199; 17 } else { 15 $primary_color = 199; 16 if ( 'default' !== get_theme_mod( 'primary_color', 'default' ) ) { 18 17 $primary_color = absint( get_theme_mod( 'primary_color_hue', 199 ) ); 19 18 } 20 19 … … 25 24 * 26 25 * @param int $saturation Color saturation level. 27 26 */ 27 $saturation = apply_filters( 'twentynineteen_custom_colors_saturation', 100 ); 28 $saturation = absint( $saturation ) . '%'; 28 29 29 $saturation = absint( apply_filters( 'twentynineteen_custom_colors_saturation', 100 ) ); 30 $saturation = $saturation . '%'; 31 30 /** 31 * Filter Twenty Nineteen default selection saturation level. 32 * 33 * @since Twenty Nineteen 1.0 34 * 35 * @param int $saturation_selection Selection color saturation level. 36 */ 32 37 $saturation_selection = absint( apply_filters( 'twentynineteen_custom_colors_saturation_selection', 50 ) ); 33 38 $saturation_selection = $saturation_selection . '%'; 34 39 35 $lightness = absint( apply_filters( 'twentynineteen_custom_colors_lightness', 33 ) ); 36 $lightness = $lightness . '%'; 40 /** 41 * Filter Twenty Nineteen default lightness level. 42 * 43 * @since Twenty Nineteen 1.0 44 * 45 * @param int $lightness Color lightness level. 46 */ 47 $lightness = apply_filters( 'twentynineteen_custom_colors_lightness', 33 ); 48 $lightness = absint( $lightness ) . '%'; 37 49 38 $lightness_hover = absint( apply_filters( 'twentynineteen_custom_colors_lightness_hover', 23 ) ); 39 $lightness_hover = $lightness_hover . '%'; 50 /** 51 * Filter Twenty Nineteen default hover lightness level. 52 * 53 * @since Twenty Nineteen 1.0 54 * 55 * @param int $lightness_hover Hover color lightness level. 56 */ 57 $lightness_hover = apply_filters( 'twentynineteen_custom_colors_lightness_hover', 23 ); 58 $lightness_hover = absint( $lightness_hover ) . '%'; 40 59 41 $lightness_selection = absint( apply_filters( 'twentynineteen_custom_colors_lightness_selection', 90 ) ); 42 $lightness_selection = $lightness_selection . '%'; 60 /** 61 * Filter Twenty Nineteen default selection lightness level. 62 * 63 * @since Twenty Nineteen 1.0 64 * 65 * @param int $lightness_selection Selection color lightness level. 66 */ 67 $lightness_selection = apply_filters( 'twentynineteen_custom_colors_lightness_selection', 90 ); 68 $lightness_selection = absint( $lightness_selection ) . '%'; 43 69 44 70 $theme_css = ' 45 71 /* … … 233 259 color: inherit; 234 260 } 235 261 '; 236 $css = ''; 262 237 263 if ( function_exists( 'register_block_type' ) && is_admin() ) { 238 $css .= $editor_css; 239 } else if ( ! is_admin() ) { 240 $css = $theme_css; 264 $theme_css = $editor_css; 241 265 } 242 266 243 267 /** … … 249 273 * @param int $primary_color The user's selected color hue. 250 274 * @param string $saturation Filtered theme color saturation level. 251 275 */ 252 return apply_filters( 'twentynineteen_custom_colors_css', $ css, $primary_color, $saturation );276 return apply_filters( 'twentynineteen_custom_colors_css', $theme_css, $primary_color, $saturation ); 253 277 }