WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/17/2018 01:50:26 AM (3 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-writing.php

    r42343 r43571  
    7070<label for="use_smilies">
    7171<input name="use_smilies" type="checkbox" id="use_smilies" value="1" <?php checked( '1', get_option( 'use_smilies' ) ); ?> />
    72 <?php _e( 'Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display' ); ?></label><br />
     72    <?php _e( 'Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display' ); ?></label><br />
    7373<label for="use_balanceTags"><input name="use_balanceTags" type="checkbox" id="use_balanceTags" value="1" <?php checked( '1', get_option( 'use_balanceTags' ) ); ?> /> <?php _e( 'WordPress should correct invalidly nested XHTML automatically' ); ?></label>
    7474</fieldset></td>
     
    108108<?php
    109109if ( get_option( 'link_manager_enabled' ) ) :
    110 ?>
     110    ?>
    111111<tr>
    112112<th scope="row"><label for="default_link_category"><?php _e( 'Default Link Category' ); ?></label></th>
    113113<td>
    114 <?php
    115 wp_dropdown_categories(
    116     array(
    117         'hide_empty'   => 0,
    118         'name'         => 'default_link_category',
    119         'orderby'      => 'name',
    120         'selected'     => get_option( 'default_link_category' ),
    121         'hierarchical' => true,
    122         'taxonomy'     => 'link_category',
    123     )
    124 );
    125 ?>
     114    <?php
     115    wp_dropdown_categories(
     116        array(
     117            'hide_empty'   => 0,
     118            'name'         => 'default_link_category',
     119            'orderby'      => 'name',
     120            'selected'     => get_option( 'default_link_category' ),
     121            'hierarchical' => true,
     122            'taxonomy'     => 'link_category',
     123        )
     124    );
     125    ?>
    126126</td>
    127127</tr>
     
    137137/** This filter is documented in wp-admin/options.php */
    138138if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
    139 ?>
     139    ?>
    140140<h2 class="title"><?php _e( 'Post via email' ); ?></h2>
    141141<p>
    142 <?php
    143 printf(
    144     /* translators: 1, 2, 3: examples of random email addresses */
    145     __( 'To post to WordPress by email you must set up a secret email account with POP3 access. Any mail received at this address will be posted, so it&#8217;s a good idea to keep this address very secret. Here are three random strings you could use: %1$s, %2$s, %3$s.' ),
    146     sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ),
    147     sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ),
    148     sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) )
    149 );
    150 ?>
     142    <?php
     143    printf(
     144        /* translators: 1, 2, 3: examples of random email addresses */
     145        __( 'To post to WordPress by email you must set up a secret email account with POP3 access. Any mail received at this address will be posted, so it&#8217;s a good idea to keep this address very secret. Here are three random strings you could use: %1$s, %2$s, %3$s.' ),
     146        sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ),
     147        sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ),
     148        sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) )
     149    );
     150    ?>
    151151</p>
    152152
     
    172172<th scope="row"><label for="default_email_category"><?php _e( 'Default Mail Category' ); ?></label></th>
    173173<td>
    174 <?php
    175 wp_dropdown_categories(
    176     array(
    177         'hide_empty'   => 0,
    178         'name'         => 'default_email_category',
    179         'orderby'      => 'name',
    180         'selected'     => get_option( 'default_email_category' ),
    181         'hierarchical' => true,
    182     )
    183 );
    184 ?>
    185 </td>
    186 </tr>
    187 <?php do_settings_fields( 'writing', 'post_via_email' ); ?>
     174    <?php
     175    wp_dropdown_categories(
     176        array(
     177            'hide_empty'   => 0,
     178            'name'         => 'default_email_category',
     179            'orderby'      => 'name',
     180            'selected'     => get_option( 'default_email_category' ),
     181            'hierarchical' => true,
     182        )
     183    );
     184    ?>
     185</td>
     186</tr>
     187    <?php do_settings_fields( 'writing', 'post_via_email' ); ?>
    188188</table>
    189189<?php } ?>
     
    198198 */
    199199if ( apply_filters( 'enable_update_services_configuration', true ) ) {
    200 ?>
     200    ?>
    201201<h2 class="title"><?php _e( 'Update Services' ); ?></h2>
    202202
    203 <?php if ( 1 == get_option( 'blog_public' ) ) : ?>
     203    <?php if ( 1 == get_option( 'blog_public' ) ) : ?>
    204204
    205205    <p><label for="ping_sites">
    206     <?php
     206        <?php
    207207        printf(
    208208            /* translators: %s: Codex URL */
     
    210210            __( 'https://codex.wordpress.org/Update_Services' )
    211211        );
    212     ?>
     212        ?>
    213213    </label></p>
    214214
    215215    <textarea name="ping_sites" id="ping_sites" class="large-text code" rows="3"><?php echo esc_textarea( get_option( 'ping_sites' ) ); ?></textarea>
    216216
    217 <?php else : ?>
     217    <?php else : ?>
    218218
    219219    <p>
    220     <?php
     220        <?php
    221221        printf(
    222222            /* translators: 1: Codex URL, 2: Reading Settings URL */
     
    225225            'options-reading.php'
    226226        );
    227     ?>
     227        ?>
    228228    </p>
    229229
    230 <?php endif; ?>
     230    <?php endif; ?>
    231231<?php } // enable_update_services_configuration ?>
    232232
Note: See TracChangeset for help on using the changeset viewer.