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/themes.php

    r42719 r43571  
    134134
    135135wp_localize_script(
    136     'theme', '_wpThemeSettings', array(
     136    'theme',
     137    '_wpThemeSettings',
     138    array(
    137139        'themes'   => $themes,
    138140        'settings' => array(
     
    173175<?php
    174176if ( ! validate_current_theme() || isset( $_GET['broken'] ) ) :
    175 ?>
     177    ?>
    176178<div id="message1" class="updated notice is-dismissible"><p><?php _e( 'The active theme is broken. Reverting to the default theme.' ); ?></p></div>
    177 <?php
     179    <?php
    178180elseif ( isset( $_GET['activated'] ) ) :
    179181    if ( isset( $_GET['previewed'] ) ) {
     
    185187}
    186188    elseif ( isset( $_GET['deleted'] ) ) :
    187     ?>
     189        ?>
    188190<div id="message3" class="updated notice is-dismissible"><p><?php _e( 'Theme deleted.' ); ?></p></div>
    189191<?php elseif ( isset( $_GET['delete-active-child'] ) ) : ?>
    190192    <div id="message4" class="error"><p><?php _e( 'You cannot delete a theme while it has an active child theme.' ); ?></p></div>
    191 <?php
     193    <?php
    192194endif;
    193195
     
    336338// List broken themes, if any.
    337339if ( ! is_multisite() && current_user_can( 'edit_themes' ) && $broken_themes = wp_get_themes( array( 'errors' => true ) ) ) {
    338 ?>
     340    ?>
    339341
    340342<div class="broken-themes">
     
    342344<p><?php _e( 'The following themes are installed but incomplete.' ); ?></p>
    343345
    344 <?php
    345 $can_delete  = current_user_can( 'delete_themes' );
    346 $can_install = current_user_can( 'install_themes' );
    347 ?>
     346    <?php
     347    $can_delete  = current_user_can( 'delete_themes' );
     348    $can_install = current_user_can( 'install_themes' );
     349    ?>
    348350<table>
    349351    <tr>
     
    368370                        'action'     => 'delete',
    369371                        'stylesheet' => urlencode( $stylesheet ),
    370                     ), admin_url( 'themes.php' )
     372                    ),
     373                    admin_url( 'themes.php' )
    371374                );
    372375                $delete_url = wp_nonce_url( $delete_url, 'delete-theme_' . $stylesheet );
     
    385388                            'action' => 'install-theme',
    386389                            'theme'  => urlencode( $parent_theme_name ),
    387                         ), admin_url( 'update.php' )
     390                        ),
     391                        admin_url( 'update.php' )
    388392                    );
    389393                    $install_url = wp_nonce_url( $install_url, 'install-theme_' . $parent_theme_name );
     
    399403</div>
    400404
    401 <?php
     405    <?php
    402406}
    403407?>
     
    534538
    535539wp_localize_script(
    536     'updates', '_wpUpdatesItemCounts', array(
     540    'updates',
     541    '_wpUpdatesItemCounts',
     542    array(
    537543        'totals' => wp_get_update_data(),
    538544    )
Note: See TracChangeset for help on using the changeset viewer.