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-signup.php

    r41911 r42217  
    167167            ?>
    168168        </p>
    169     <?php endif; // Languages. ?>
     169    <?php
     170        endif; // Languages.
     171
     172        $blog_public_on_checked = $blog_public_off_checked = '';
     173        if ( isset( $_POST['blog_public'] ) && '0' == $_POST['blog_public']  ) {
     174            $blog_public_off_checked = 'checked="checked"';
     175        } else {
     176            $blog_public_on_checked = 'checked="checked"';
     177        }
     178    ?>
    170179
    171180    <div id="privacy">
     
    175184            <br style="clear:both" />
    176185            <label class="checkbox" for="blog_public_on">
    177                 <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if ( !isset( $_POST['blog_public'] ) || $_POST['blog_public'] == '1' ) { ?>checked="checked"<?php } ?> />
     186                <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php echo $blog_public_on_checked; ?> />
    178187                <strong><?php _e( 'Yes' ); ?></strong>
    179188            </label>
    180189            <label class="checkbox" for="blog_public_off">
    181                 <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if ( isset( $_POST['blog_public'] ) && $_POST['blog_public'] == '0' ) { ?>checked="checked"<?php } ?> />
     190                <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php echo $blog_public_off_checked; ?> />
    182191                <strong><?php _e( 'No' ); ?></strong>
    183192            </label>
Note: See TracChangeset for help on using the changeset viewer.