Make WordPress Core


Ignore:
Timestamp:
08/17/2018 01:50:26 AM (6 years ago)
Author:
pento
Message:

Coding Standards: Upgrade WPCS to 1.0.0

WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:

  • Multiline function calls must now put each parameter on a new line.
  • Auto-formatting files is now part of the grunt precommit script.
  • Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/options-media.php

    r42864 r43571  
    9797 */
    9898if ( isset( $GLOBALS['wp_settings']['media']['embeds'] ) ) :
    99 ?>
     99    ?>
    100100<h2 class="title"><?php _e( 'Embeds' ); ?></h2>
    101101<table class="form-table">
    102 <?php do_settings_fields( 'media', 'embeds' ); ?>
     102    <?php do_settings_fields( 'media', 'embeds' ); ?>
    103103</table>
    104104<?php endif; ?>
     
    107107<h2 class="title"><?php _e( 'Uploading Files' ); ?></h2>
    108108<table class="form-table">
    109 <?php
    110 // If upload_url_path is not the default (empty), and upload_path is not the default ('wp-content/uploads' or empty)
    111 if ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-content/uploads' && get_option( 'upload_path' ) ) ) :
    112 ?>
     109    <?php
     110    // If upload_url_path is not the default (empty), and upload_path is not the default ('wp-content/uploads' or empty)
     111    if ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-content/uploads' && get_option( 'upload_path' ) ) ) :
     112        ?>
    113113<tr>
    114114<th scope="row"><label for="upload_path"><?php _e( 'Store uploads in this folder' ); ?></label></th>
    115115<td><input name="upload_path" type="text" id="upload_path" value="<?php echo esc_attr( get_option( 'upload_path' ) ); ?>" class="regular-text code" />
    116116<p class="description">
    117 <?php
    118     /* translators: %s: wp-content/uploads */
    119     printf( __( 'Default is %s' ), '<code>wp-content/uploads</code>' );
    120 ?>
     117        <?php
     118        /* translators: %s: wp-content/uploads */
     119        printf( __( 'Default is %s' ), '<code>wp-content/uploads</code>' );
     120        ?>
    121121</p>
    122122</td>
     
    137137<label for="uploads_use_yearmonth_folders">
    138138<input name="uploads_use_yearmonth_folders" type="checkbox" id="uploads_use_yearmonth_folders" value="1"<?php checked( '1', get_option( 'uploads_use_yearmonth_folders' ) ); ?> />
    139 <?php _e( 'Organize my uploads into month- and year-based folders' ); ?>
     139    <?php _e( 'Organize my uploads into month- and year-based folders' ); ?>
    140140</label>
    141141</td>
    142142</tr>
    143143
    144 <?php do_settings_fields( 'media', 'uploads' ); ?>
     144    <?php do_settings_fields( 'media', 'uploads' ); ?>
    145145</table>
    146146<?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.