WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/23/2017 04:08:42 AM (21 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-admin/themes.php

    r42201 r42217  
    251251    $aria_action = esc_attr( $theme['id'] . '-action' );
    252252    $aria_name   = esc_attr( $theme['id'] . '-name' );
     253
     254    $active_class = '';
     255    if ( $theme['active'] ) {
     256        $active_class = ' active';
     257    }
    253258    ?>
    254 <div class="theme<?php if ( $theme['active'] ) echo ' active'; ?>" tabindex="0" aria-describedby="<?php echo $aria_action . ' ' . $aria_name; ?>">
     259<div class="theme<?php echo $active_class; ?>" tabindex="0" aria-describedby="<?php echo $aria_action . ' ' . $aria_name; ?>">
    255260    <?php if ( ! empty( $theme['screenshot'][0] ) ) { ?>
    256261        <div class="theme-screenshot">
Note: See TracChangeset for help on using the changeset viewer.