WordPress.org

Make WordPress Core

Ticket #38384: readability-patch.38384.diff

File readability-patch.38384.diff, 915 bytes (added by vrundakansara, 4 years ago)

Code readability bug fixed

  • functions.php

    diff --git functions.php functions.php
    index 2c73443..43906de 100644
    add_action( 'wp_enqueue_scripts', 'twentyseventeen_scripts' ); 
    335335function twentyseventeen_content_image_sizes_attr( $sizes, $size ) {
    336336        $width = $size[0];
    337337
    338         740 <= $width && $sizes = '(max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px';
     338        if ( 740 <= $width ) {
     339                $sizes = '(max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px';
     340        }
    339341
    340342        if ( is_active_sidebar( 'sidebar-1' ) || is_archive() || is_search() || is_home() || is_page() ) {
    341343                if ( ! ( is_page() && 'one-column' === get_theme_mod( 'page_options' ) ) ) {
    342                         767 <= $width && $sizes = '(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px';
     344                        if ( 740 <= $width ) {
     345                                $sizes = '(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px';
     346                        }
    343347                }
    344348        }
    345349