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-admin/options-discussion.php

    r42201 r42217  
    184184
    185185$show_avatars = get_option( 'show_avatars' );
     186$show_avatars_class = '';
     187if ( ! $show_avatars ) {
     188    $show_avatars_class = ' hide-if-js';
     189}
    186190?>
    187191
     
    196200</fieldset></td>
    197201</tr>
    198 <tr class="avatar-settings<?php if ( ! $show_avatars ) echo ' hide-if-js'; ?>">
     202<tr class="avatar-settings<?php echo $show_avatars_class; ?>">
    199203<th scope="row"><?php _e('Maximum Rating'); ?></th>
    200204<td><fieldset><legend class="screen-reader-text"><span><?php _e('Maximum Rating'); ?></span></legend>
     
    219223</fieldset></td>
    220224</tr>
    221 <tr class="avatar-settings<?php if ( ! $show_avatars ) echo ' hide-if-js'; ?>">
     225<tr class="avatar-settings<?php echo $show_avatars_class; ?>">
    222226<th scope="row"><?php _e('Default Avatar'); ?></th>
    223227<td class="defaultavatarpicker"><fieldset><legend class="screen-reader-text"><span><?php _e('Default Avatar'); ?></span></legend>
Note: See TracChangeset for help on using the changeset viewer.