Make WordPress Core


Ignore:
Timestamp:
11/23/2017 04:08:42 AM (7 years ago)
Author:
pento
Message:

General: Reformat inline if () statements inside HTML tags.

This pattern occurs a handful of times across the codebase:

<div class="foo<?php if ( $bar ) { echo ' baz'; } ?>">

Unfortunately, it doesn't really play nicely with phpcbf, so all instances need to be removed in preperation for auto code formatting.

See #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyseventeen/functions.php

    r41756 r42217  
    399399    require_once( get_parent_theme_file_path( '/inc/color-patterns.php' ) );
    400400    $hue = absint( get_theme_mod( 'colorscheme_hue', 250 ) );
     401
     402    $customize_preview_data_hue = '';
     403    if ( is_customize_preview() ) {
     404        $customize_preview_data_hue = 'data-hue="' . $hue . '"';
     405    }
    401406?>
    402     <style type="text/css" id="custom-theme-colors" <?php if ( is_customize_preview() ) { echo 'data-hue="' . $hue . '"'; } ?>>
     407    <style type="text/css" id="custom-theme-colors" <?php echo $customize_preview_data_hue; ?>>
    403408        <?php echo twentyseventeen_custom_colors_css(); ?>
    404409    </style>
Note: See TracChangeset for help on using the changeset viewer.