Make WordPress Core

Changeset 38999


Ignore:
Timestamp:
10/28/2016 09:52:38 PM (8 years ago)
Author:
davidakennedy
Message:

Twenty Seventeen: Remove excessive escaping in color-patterns.php

Uses absint() to escape when getting value. Removes esc_attr from each instance of the variable.

Props fencer04.

Fixes #38449.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyseventeen/inc/color-patterns.php

    r38996 r38999  
    1212 */
    1313function twentyseventeen_custom_colors_css() {
    14     $hue = get_theme_mod( 'colorscheme_hue', 250 );
     14    $hue = absint( get_theme_mod( 'colorscheme_hue', 250 ) );
    1515
    1616    /**
     
    2121     * @param $saturation integer
    2222     */
    23     $saturation = apply_filters( 'twentyseventeen_custom_colors_saturation', 50 );
     23    $saturation = absint( apply_filters( 'twentyseventeen_custom_colors_saturation', 50 ) );
    2424    $reduced_saturation = ( .8 * $saturation ) . '%';
    2525    $saturation = $saturation . '%';
     
    8787.colors-custom .widget ul li a:focus,
    8888.colors-custom .widget ul li a:hover {
    89     color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 0% ); /* base: #000; */
     89    color: hsl( ' . $hue . ', ' . $saturation . ', 0% ); /* base: #000; */
    9090}
    9191
     
    9696.colors-custom .posts-navigation a,
    9797.colors-custom .widget_authors a strong {
    98     -webkit-box-shadow: inset 0 -1px 0 hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 6% ); /* base: rgba(15, 15, 15, 1); */
    99     box-shadow: inset 0 -1px 0 hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 6% ); /* base: rgba(15, 15, 15, 1); */
     98    -webkit-box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 6% ); /* base: rgba(15, 15, 15, 1); */
     99    box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 6% ); /* base: rgba(15, 15, 15, 1); */
    100100}
    101101
     
    104104.colors-custom input[type="submit"],
    105105.colors-custom .entry-footer .edit-link a.post-edit-link {
    106     background-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 13% ); /* base: #222; */
     106    background-color: hsl( ' . $hue . ', ' . $saturation . ', 13% ); /* base: #222; */
    107107}
    108108
     
    146146.colors-custom .site-content .site-content-light,
    147147.colors-custom .twentyseventeen-panel .recent-posts .entry-header .edit-link {
    148     color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 13% ); /* base: #222; */
     148    color: hsl( ' . $hue . ', ' . $saturation . ', 13% ); /* base: #222; */
    149149}
    150150
     
    201201.colors-custom .widget ul li a:focus,
    202202.colors-custom .widget ul li a:hover {
    203     -webkit-box-shadow: inset 0 0 0 hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 13% ), 0 3px 0 hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 13% );
    204     box-shadow: inset 0 0 0 hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 13% ), 0 3px 0 hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 13% );
     203    -webkit-box-shadow: inset 0 0 0 hsl( ' . $hue . ', ' . $saturation . ', 13% ), 0 3px 0 hsl( ' . $hue . ', ' . $saturation . ', 13% );
     204    box-shadow: inset 0 0 0 hsl( ' . $hue . ', ' . $saturation. ' , 13% ), 0 3px 0 hsl( ' . $hue . ', ' . $saturation . ', 13% );
    205205}
    206206
     
    222222.colors-custom .comment-body,
    223223.colors-custom .site-content .wp-playlist-light .wp-playlist-current-item .wp-playlist-item-album {
    224     color: hsl( ' . esc_attr( $hue ) . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */
     224    color: hsl( ' . $hue . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */
    225225}
    226226
    227227.colors-custom .social-navigation a:hover,
    228228.colors-custom .social-navigation a:focus {
    229     background: hsl( ' . esc_attr( $hue ) . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */
     229    background: hsl( ' . $hue . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */
    230230}
    231231
     
    247247.colors-custom textarea:focus,
    248248.bypostauthor > .comment-body > .comment-meta > .comment-author .avatar {
    249     border-color: hsl( ' . esc_attr( $hue ) . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */
     249    border-color: hsl( ' . $hue . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */
    250250}
    251251
     
    275275.colors-custom .wp-caption,
    276276.colors-custom .gallery-caption {
    277     color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 40% ); /* base: #666; */
     277    color: hsl( ' . $hue . ', ' . $saturation . ', 40% ); /* base: #666; */
    278278}
    279279
    280280.colors-custom abbr,
    281281.colors-custom acronym {
    282     border-bottom-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 40% ); /* base: #666; */
     282    border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 40% ); /* base: #666; */
    283283}
    284284
     
    300300.colors-custom .main-navigation a:hover,
    301301.colors-custom .site-content .wp-playlist-light .wp-playlist-current-item .wp-playlist-item-artist {
    302     color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 46% ); /* base: #767676; */
     302    color: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */
    303303}
    304304
     
    333333.colors-custom input[type="submit"].secondary:focus,
    334334.colors-custom hr {
    335     background: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 73% ); /* base: #bbb; */
     335    background: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */
    336336}
    337337
     
    360360.colors-custom .wp_widget_tag_cloud a:hover,
    361361.colors-custom .wp_widget_tag_cloud a:focus {
    362     border-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 73% ); /* base: #bbb; */
     362    border-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */
    363363}
    364364
    365365.colors-custom thead th {
    366     border-bottom-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 73% ); /* base: #bbb; */
     366    border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */
    367367}
    368368
    369369.colors-custom .entry-footer .cat-links .icon,
    370370.colors-custom .entry-footer .tags-links .icon {
    371     color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 73% ); /* base: #bbb; */
     371    color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */
    372372}
    373373
     
    379379.colors-custom .prev.page-numbers,
    380380.colors-custom .next.page-numbers {
    381     background-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 87% ); /* base: #ddd; */
     381    background-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */
    382382}
    383383
     
    385385.colors-custom .widget.widget_tag_cloud a,
    386386.colors-custom .wp_widget_tag_cloud a {
    387     border-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 87% ); /* base: #ddd; */
     387    border-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */
    388388}
    389389
    390390.colors-custom.twentyseventeen-front-page article:not(.has-post-thumbnail):not(:first-child),
    391391.colors-custom .widget ul li {
    392     border-top-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 87% ); /* base: #ddd; */
     392    border-top-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */
    393393}
    394394
    395395.colors-custom .widget ul li {
    396     border-bottom-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 87% ); /* base: #ddd; */
     396    border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */
    397397}
    398398
     
    400400.colors-custom mark,
    401401.colors-custom ins {
    402     background: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 93% ); /* base: #eee; */
     402    background: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */
    403403}
    404404
     
    409409.colors-custom .entry-footer,
    410410.colors-custom .site-footer {
    411     border-top-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 93% ); /* base: #eee; */
     411    border-top-color: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */
    412412}
    413413
     
    418418.colors-custom .site-content .wp-playlist-light .wp-playlist-item,
    419419.colors-custom tr {
    420     border-bottom-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 93% ); /* base: #eee; */
     420    border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */
    421421}
    422422
    423423.colors-custom .site-content .wp-playlist-light {
    424     border-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 93% ); /* base: #eee; */
     424    border-color: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */
    425425}
    426426
    427427.colors-custom .site-header,
    428428.colors-custom .single-featured-image-header {
    429     background-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 98% ); /* base: #fafafa; */
     429    background-color: hsl( ' . $hue . ', ' . $saturation . ', 98% ); /* base: #fafafa; */
    430430}
    431431
     
    447447.colors-custom.has-header-image .site-title a,
    448448.colors-custom.has-header-image .site-description {
    449     color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 100% ); /* base: #fff; */
     449    color: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */
    450450}
    451451
     
    453453.colors-custom .navigation-top,
    454454.colors-custom .main-navigation ul {
    455     background: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 100% ); /* base: #fff; */
     455    background: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */
    456456}
    457457
    458458.colors-custom .widget ul li a,
    459459.colors-custom .site-footer .widget-area ul li a {
    460     -webkit-box-shadow: inset 0 -1px 0 hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 100% ); /* base: rgba(255, 255, 255, 1); */
    461     box-shadow: inset 0 -1px 0 hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 100% );  /* base: rgba(255, 255, 255, 1); */
     460    -webkit-box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: rgba(255, 255, 255, 1); */
     461    box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 100% );  /* base: rgba(255, 255, 255, 1); */
    462462}
    463463
     
    515515    .colors-custom .nav-links .nav-previous .nav-title .icon,
    516516    .colors-custom .nav-links .nav-next .nav-title .icon {
    517         color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 20% ); /* base: #222; */
     517        color: hsl( ' . $hue . ', ' . $saturation . ', 20% ); /* base: #222; */
    518518    }
    519519
    520520    .colors-custom .main-navigation li li:hover,
    521521    .colors-custom .main-navigation li li.focus {
    522         background: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 46% ); /* base: #767676; */
     522        background: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */
    523523    }
    524524
    525525    .colors-custom .navigation-top .menu-scroll-down {
    526         color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 46% ); /* base: #767676; */;
     526        color: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */;
    527527    }
    528528
    529529    .colors-custom abbr[title] {
    530         border-bottom-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 46% ); /* base: #767676; */;
     530        border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */;
    531531    }
    532532
    533533    .colors-custom .main-navigation ul ul {
    534         border-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 73% ); /* base: #bbb; */
    535         background: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 100% ); /* base: #fff; */
     534        border-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */
     535        background: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */
    536536    }
    537537
    538538    .colors-custom .main-navigation ul li.menu-item-has-children:before,
    539539    .colors-custom .main-navigation ul li.page_item_has_children:before {
    540         border-bottom-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 73% ); /* base: #bbb; */
     540        border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */
    541541    }
    542542
    543543    .colors-custom .main-navigation ul li.menu-item-has-children:after,
    544544    .colors-custom .main-navigation ul li.page_item_has_children:after {
    545         border-bottom-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 100% ); /* base: #fff; */
     545        border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */
    546546    }
    547547
     
    555555    .colors-custom .main-navigation li li.current_page_item a:focus,
    556556    .colors-custom .main-navigation li li.current-menu-item a:focus {
    557         color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 100% ); /* base: #fff; */
     557        color: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */
    558558    }
    559559}';
Note: See TracChangeset for help on using the changeset viewer.