Make WordPress Core

Changeset 30221


Ignore:
Timestamp:
11/03/2014 09:58:56 PM (10 years ago)
Author:
iandstewart
Message:

Twenty Fifteen: check if user-selected custom colors are the same as default so we're not duplicating styles.

Props iamtakashi, fixes #30234

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfifteen/inc/custom-header.php

    r30208 r30221  
    168168 */
    169169function twentyfifteen_header_background_color_css() {
     170    $color_scheme            = twentyfifteen_get_color_scheme();
     171    $default_color           = $color_scheme[1];
    170172    $header_background_color = get_theme_mod( 'header_background_color', '#ffffff' );
    171173
    172174    // Don't do anything if the current color is the default.
    173     if ( '#ffffff' === $header_background_color ) {
     175    if ( $header_background_color === $default_color ) {
    174176        return;
    175177    }
     
    210212 */
    211213function twentyfifteen_sidebar_text_color_css() {
     214    $color_scheme       = twentyfifteen_get_color_scheme();
     215    $default_color      = $color_scheme[4];
    212216    $sidebar_link_color = get_theme_mod( 'sidebar_textcolor', '#333333' );
    213217
    214218    // Don't do anything if the current color is the default.
    215     if ( '#333333' === $sidebar_link_color ) {
     219    if ( $sidebar_link_color === $default_color ) {
    216220        return;
    217221    }
Note: See TracChangeset for help on using the changeset viewer.