WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/17/2018 01:50:26 AM (2 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-includes/comment-template.php

    r43531 r43571  
    11531153    if ( true !== $deprecated_echo ) {
    11541154        _deprecated_argument(
    1155             __FUNCTION__, '2.5.0',
     1155            __FUNCTION__,
     1156            '2.5.0',
    11561157            /* translators: %s: get_trackback_url() */
    11571158            sprintf(
     
    16771678    } else {
    16781679        $data_attributes = array(
    1679             'commentid'        => $comment->comment_ID,
    1680             'postid'           => $post->ID,
    1681             'belowelement'     => $args['add_below'] . '-' . $comment->comment_ID,
    1682             'respondelement'   => $args['respond_id'],
     1680            'commentid'      => $comment->comment_ID,
     1681            'postid'         => $post->ID,
     1682            'belowelement'   => $args['add_below'] . '-' . $comment->comment_ID,
     1683            'respondelement' => $args['respond_id'],
    16831684        );
    16841685
     
    16861687
    16871688        foreach ( $data_attributes as $name => $value ) {
    1688             $data_attribute_string .= " data-${name}=\"" . esc_attr( $value ) . "\"";
     1689            $data_attribute_string .= " data-${name}=\"" . esc_attr( $value ) . '"';
    16891690        }
    16901691
     
    16931694        $link = sprintf(
    16941695            "<a rel='nofollow' class='comment-reply-link' href='%s' %s aria-label='%s'>%s</a>",
    1695             esc_url( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $args['respond_id'],
     1696            esc_url( add_query_arg( 'replytocom', $comment->comment_ID ) ) . '#' . $args['respond_id'],
    16961697            $data_attribute_string,
    16971698            esc_attr( sprintf( $args['reply_to_text'], $comment->comment_author ) ),
     
    17801781        $onclick = sprintf(
    17811782            'return addComment.moveForm( "%1$s-%2$s", "0", "%3$s", "%2$s" )',
    1782             $args['add_below'], $post->ID, $args['respond_id']
     1783            $args['add_below'],
     1784            $post->ID,
     1785            $args['respond_id']
    17831786        );
    17841787
     
    22642267    $html5    = 'html5' === $args['format'];
    22652268    $fields   = array(
    2266         'author'  => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
     2269        'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
    22672270                     '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" maxlength="245"' . $html_req . ' /></p>',
    2268         'email'   => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
     2271        'email'  => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
    22692272                     '<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" maxlength="100" aria-describedby="email-notes"' . $html_req . ' /></p>',
    2270         'url'     => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' .
     2273        'url'    => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' .
    22712274                     '<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" /></p>',
    22722275    );
     
    23772380            do_action( 'comment_form_must_log_in_after' );
    23782381        else :
    2379         ?>
     2382            ?>
    23802383            <form action="<?php echo esc_url( $args['action'] ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>" class="<?php echo esc_attr( $args['class_form'] ); ?>"<?php echo $html5 ? ' novalidate' : ''; ?>>
    23812384                <?php
Note: See TracChangeset for help on using the changeset viewer.