Make WordPress Core


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

    r42875 r43571  
    177177                        __( 'https://codex.wordpress.org/Using_Permalinks' )
    178178                );
    179         ?>
     179                ?>
    180180        </p>
    181181
    … …  
    318318</form>
    319319<?php if ( ! is_multisite() ) { ?>
    320 <?php
    321 if ( $iis7_permalinks ) :
    322         if ( isset( $_POST['submit'] ) && $permalink_structure && ! $using_index_permalinks && ! $writable ) :
    323                 if ( file_exists( $home_path . 'web.config' ) ) :
    324                 ?>
    325 <p>
    326 <?php
    327         printf(
    328                 /* translators: 1: web.config, 2: Codex URL, 3: CTRL + a, 4: element code */
    329                 __( 'If your %1$s file was <a href="%2$s">writable</a>, we could do this automatically, but it isn&#8217;t so this is the url rewrite rule you should have in your %1$s file. Click in the field and press %3$s to select all. Then insert this rule inside of the %4$s element in %1$s file.' ),
    330                 '<code>web.config</code>',
    331                 __( 'https://codex.wordpress.org/Changing_File_Permissions' ),
    332                 '<kbd>CTRL + a</kbd>',
    333                 '<code>/&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt;</code>'
    334         );
    335 ?>
     320        <?php
     321        if ( $iis7_permalinks ) :
     322                if ( isset( $_POST['submit'] ) && $permalink_structure && ! $using_index_permalinks && ! $writable ) :
     323                        if ( file_exists( $home_path . 'web.config' ) ) :
     324                                ?>
     325<p>
     326                                <?php
     327                                printf(
     328                                        /* translators: 1: web.config, 2: Codex URL, 3: CTRL + a, 4: element code */
     329                                        __( 'If your %1$s file was <a href="%2$s">writable</a>, we could do this automatically, but it isn&#8217;t so this is the url rewrite rule you should have in your %1$s file. Click in the field and press %3$s to select all. Then insert this rule inside of the %4$s element in %1$s file.' ),
     330                                        '<code>web.config</code>',
     331                                        __( 'https://codex.wordpress.org/Changing_File_Permissions' ),
     332                                        '<kbd>CTRL + a</kbd>',
     333                                        '<code>/&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt;</code>'
     334                                );
     335                                ?>
    336336</p>
    337337<form action="options-permalink.php" method="post">
    338 <?php wp_nonce_field( 'update-permalink' ); ?>
     338                                <?php wp_nonce_field( 'update-permalink' ); ?>
    339339        <p><textarea rows="9" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules() ); ?></textarea></p>
    340340</form>
    341341<p>
    342 <?php
    343         printf(
    344                 /* translators: %s: web.config */
    345                 __( 'If you temporarily make your %s file writable for us to generate rewrite rules automatically, do not forget to revert the permissions after rule has been saved.' ),
    346                 '<code>web.config</code>'
    347         );
    348 ?>
     342                                <?php
     343                                printf(
     344                                        /* translators: %s: web.config */
     345                                        __( 'If you temporarily make your %s file writable for us to generate rewrite rules automatically, do not forget to revert the permissions after rule has been saved.' ),
     346                                        '<code>web.config</code>'
     347                                );
     348                                ?>
    349349</p>
    350350                <?php else : ?>
    351351<p>
    352 <?php
     352        <?php
    353353        printf(
    354354                /* translators: 1: Codex URL, 2: web.config, 3: CTRL + a */
    … …  
    358358                '<kbd>CTRL + a</kbd>'
    359359        );
    360 ?>
     360        ?>
    361361</p>
    362362<form action="options-permalink.php" method="post">
    363 <?php wp_nonce_field( 'update-permalink' ); ?>
     363        <?php wp_nonce_field( 'update-permalink' ); ?>
    364364        <p><textarea rows="18" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules( true ) ); ?></textarea></p>
    365365</form>
    366366<p>
    367 <?php
     367        <?php
    368368        printf(
    369369                /* translators: %s: web.config */
    … …  
    371371                '<code>web.config</code>'
    372372        );
    373 ?>
     373        ?>
    374374</p>
    375375                <?php endif; ?>
    … …  
    377377<?php elseif ( $is_nginx ) : ?>
    378378        <p><?php _e( '<a href="https://codex.wordpress.org/Nginx">Documentation on Nginx configuration</a>.' ); ?></p>
    379 <?php
     379        <?php
    380380else :
    381381        if ( $permalink_structure && ! $using_index_permalinks && ! $writable && $update_required ) :
    382         ?>
    383 <p>
    384 <?php
    385         printf(
    386                 /* translators: 1: .htaccess, 2: Codex URL, 3: CTRL + a */
    387                 __( 'If your %1$s file was <a href="%2$s">writable</a>, we could do this automatically, but it isn&#8217;t so these are the mod_rewrite rules you should have in your %1$s file. Click in the field and press %3$s to select all.' ),
    388                 '<code>.htaccess</code>',
    389                 __( 'https://codex.wordpress.org/Changing_File_Permissions' ),
    390                 '<kbd>CTRL + a</kbd>'
    391         );
    392 ?>
     382                ?>
     383<p>
     384                <?php
     385                printf(
     386                        /* translators: 1: .htaccess, 2: Codex URL, 3: CTRL + a */
     387                        __( 'If your %1$s file was <a href="%2$s">writable</a>, we could do this automatically, but it isn&#8217;t so these are the mod_rewrite rules you should have in your %1$s file. Click in the field and press %3$s to select all.' ),
     388                        '<code>.htaccess</code>',
     389                        __( 'https://codex.wordpress.org/Changing_File_Permissions' ),
     390                        '<kbd>CTRL + a</kbd>'
     391                );
     392                ?>
    393393</p>
    394394<form action="options-permalink.php" method="post">
    395 <?php wp_nonce_field( 'update-permalink' ); ?>
     395                <?php wp_nonce_field( 'update-permalink' ); ?>
    396396        <p><textarea rows="6" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->mod_rewrite_rules() ); ?></textarea></p>
    397397</form>
Note: See TracChangeset for help on using the changeset viewer.