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/twentytwelve/functions.php

    r42343 r43571  
    7070     */
    7171    add_theme_support(
    72         'custom-background', array(
     72        'custom-background',
     73        array(
    7374            'default-color' => 'e6e6e6',
    7475        )
     
    331332                <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?></div>
    332333            </nav><!-- .navigation -->
    333         <?php
     334            <?php
    334335    endif;
    335336    }
     
    353354            case 'trackback':
    354355                // Display trackbacks differently than normal comments.
    355         ?>
     356                ?>
    356357        <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
    357358        <p><?php _e( 'Pingback:', 'twentytwelve' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?></p>
    358     <?php
     359                <?php
    359360                break;
    360361            default:
    361362                // Proceed with normal comments.
    362363                global $post;
    363         ?>
     364                ?>
    364365        <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
    365366        <article id="comment-<?php comment_ID(); ?>" class="comment">
     
    380381                        sprintf( __( '%1$s at %2$s', 'twentytwelve' ), get_comment_date(), get_comment_time() )
    381382                    );
    382                     ?>
     383                ?>
    383384                </header><!-- .comment-meta -->
    384385
     
    396397                comment_reply_link(
    397398                    array_merge(
    398                         $args, array(
     399                        $args,
     400                        array(
    399401                            'reply_text' => __( 'Reply', 'twentytwelve' ),
    400402                            'after'      => ' <span>&darr;</span>',
     
    404406                    )
    405407                );
    406 ?>
     408                ?>
    407409                </div><!-- .reply -->
    408410            </article><!-- #comment-## -->
    409         <?php
     411                <?php
    410412                break;
    411413        endswitch; // end comment_type check
     
    552554    if ( isset( $wp_customize->selective_refresh ) ) {
    553555        $wp_customize->selective_refresh->add_partial(
    554             'blogname', array(
     556            'blogname',
     557            array(
    555558                'selector'            => '.site-title > a',
    556559                'container_inclusive' => false,
     
    559562        );
    560563        $wp_customize->selective_refresh->add_partial(
    561             'blogdescription', array(
     564            'blogdescription',
     565            array(
    562566                'selector'            => '.site-description',
    563567                'container_inclusive' => false,
Note: See TracChangeset for help on using the changeset viewer.