- Timestamp:
- 12/14/2018 07:08:06 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/src/wp-content/themes/twentynineteen/inc/color-patterns.php
r43909 r44187 13 13 function twentynineteen_custom_colors_css() { 14 14 15 if ( 'default' === get_theme_mod( 'primary_color', 'default' ) ) { 16 $primary_color = 199; 17 } else { 18 $primary_color = absint( get_theme_mod( 'primary_color_hue', 199 ) ); 15 $primary_color = 199; 16 if ( 'default' !== get_theme_mod( 'primary_color', 'default' ) ) { 17 $primary_color = absint( get_theme_mod( 'primary_color', 199 ) ); 19 18 } 20 19 … … 26 25 * @param int $saturation Color saturation level. 27 26 */ 28 29 $saturation = absint( apply_filters( 'twentynineteen_custom_colors_saturation', 100 ) ); 30 $saturation = $saturation . '%'; 31 27 $saturation = apply_filters( 'twentynineteen_custom_colors_saturation', 100 ); 28 $saturation = absint( $saturation ) . '%'; 29 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 . '%'; 37 38 $lightness_hover = absint( apply_filters( 'twentynineteen_custom_colors_lightness_hover', 23 ) ); 39 $lightness_hover = $lightness_hover . '%'; 40 41 $lightness_selection = absint( apply_filters( 'twentynineteen_custom_colors_lightness_selection', 90 ) ); 42 $lightness_selection = $lightness_selection . '%'; 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 ) . '%'; 49 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 ) . '%'; 59 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 = ' … … 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 … … 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 }
Note: See TracChangeset
for help on using the changeset viewer.