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

    r42201 r42217  
    6969</tr>
    7070
    71 <?php if ( !is_multisite() ) { ?>
     71<?php
     72    if ( !is_multisite() ) {
     73        $wp_site_url_class = $wp_home_class = '';
     74        if ( defined( 'WP_SITEURL' ) ) {
     75            $wp_site_url_class = ' disabled';
     76        }
     77        if ( defined( 'WP_HOME' ) ) {
     78            $wp_home_class = ' disabled';
     79        }
     80?>
    7281
    7382<tr>
    7483<th scope="row"><label for="siteurl"><?php _e('WordPress Address (URL)') ?></label></th>
    75 <td><input name="siteurl" type="url" id="siteurl" value="<?php form_option( 'siteurl' ); ?>"<?php disabled( defined( 'WP_SITEURL' ) ); ?> class="regular-text code<?php if ( defined( 'WP_SITEURL' ) ) echo ' disabled' ?>" /></td>
     84<td><input name="siteurl" type="url" id="siteurl" value="<?php form_option( 'siteurl' ); ?>"<?php disabled( defined( 'WP_SITEURL' ) ); ?> class="regular-text code<?php echo $wp_site_url_class; ?>" /></td>
    7685</tr>
    7786
    7887<tr>
    7988<th scope="row"><label for="home"><?php _e('Site Address (URL)') ?></label></th>
    80 <td><input name="home" type="url" id="home" aria-describedby="home-description" value="<?php form_option( 'home' ); ?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php if ( defined( 'WP_HOME' ) ) echo ' disabled' ?>" />
     89<td><input name="home" type="url" id="home" aria-describedby="home-description" value="<?php form_option( 'home' ); ?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php echo $wp_home_class; ?>" />
    8190<?php if ( ! defined( 'WP_HOME' ) ) : ?>
    8291<p class="description" id="home-description"><?php
Note: See TracChangeset for help on using the changeset viewer.