WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/23/2017 04:08:42 AM (23 months 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/twentyeleven/header.php

    r31265 r42217  
    120120                // Has the text been hidden?
    121121                if ( 'blank' == get_header_textcolor() ) :
     122                    $header_image_class = '';
     123                    if ( $header_image ) {
     124                        $header_image_class = ' with-image';
     125                    }
    122126            ?>
    123                 <div class="only-search<?php if ( $header_image ) : ?> with-image<?php endif; ?>">
     127                <div class="only-search<?php echo $header_image_class; ?>">
    124128                <?php get_search_form(); ?>
    125129                </div>
Note: See TracChangeset for help on using the changeset viewer.