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

    r42343 r43571  
    101101        // This theme allows users to set a custom background.
    102102        add_theme_support(
    103             'custom-background', array(
     103            'custom-background',
     104            array(
    104105                // Let WordPress know what our default background color is.
    105106                'default-color' => 'f1f1f1',
     
    227228     */
    228229    function twentyten_admin_header_style() {
    229     ?>
     230        ?>
    230231    <style type="text/css" id="twentyten-admin-header-css">
    231232    /* Shows the same border as on front end */
     
    239240    */
    240241    </style>
    241     <?php
     242        <?php
    242243    }
    243244endif;
     
    378379        switch ( $comment->comment_type ) :
    379380            case '':
    380         ?>
     381                ?>
    381382        <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
    382383        <div id="comment-<?php comment_ID(); ?>">
     
    385386                <?php printf( __( '%s <span class="says">says:</span>', 'twentyten' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>
    386387            </div><!-- .comment-author .vcard -->
    387             <?php if ( $comment->comment_approved == '0' ) : ?>
     388                <?php if ( $comment->comment_approved == '0' ) : ?>
    388389                <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em>
    389390                <br />
     
    394395                    /* translators: 1: date, 2: time */
    395396                    printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(), get_comment_time() );
    396                     ?>
     397                ?>
    397398                    </a>
    398399                    <?php
    399400                    edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' );
    400                 ?>
     401                    ?>
    401402                </div><!-- .comment-meta .commentmetadata -->
    402403
     
    407408                comment_reply_link(
    408409                    array_merge(
    409                         $args, array(
     410                        $args,
     411                        array(
    410412                            'depth'     => $depth,
    411413                            'max_depth' => $args['max_depth'],
     
    413415                    )
    414416                );
    415 ?>
     417                ?>
    416418                </div><!-- .reply -->
    417419            </div><!-- #comment-##  -->
    418420
    419         <?php
     421                <?php
    420422                break;
    421423            case 'pingback':
    422424            case 'trackback':
    423         ?>
     425                ?>
    424426        <li class="post pingback">
    425427        <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); ?></p>
    426     <?php
     428                <?php
    427429                break;
    428430        endswitch;
Note: See TracChangeset for help on using the changeset viewer.