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/includes/dashboard.php

    r43545 r43571  
    227227        }
    228228
    229 ?>
     229        ?>
    230230<div id="dashboard-widgets" class="metabox-holder<?php echo $columns_css; ?>">
    231231        <div id="postbox-container-1" class="postbox-container">
     
    243243</div>
    244244
    245 <?php
     245        <?php
    246246        wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
    247247        wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
     
    261261 */
    262262function wp_dashboard_right_now() {
    263 ?>
     263        ?>
    264264        <div class="main">
    265265        <ul>
     
    389389
    390390        if ( ! empty( $actions ) ) :
    391         ?>
     391                ?>
    392392        <div class="sub">
    393393                <?php echo $actions; ?>
    394394        </div>
    395         <?php
     395                <?php
    396396        endif;
    397397}
     
    428428                echo '</ul>';
    429429        }
    430 ?>
     430        ?>
    431431        <br class="clear" />
    432432
     
    459459                </p>
    460460        </form>
    461 <?php
     461        <?php
    462462        /**
    463463         * Fires at the end of the 'Right Now' widget in the Network Admin dashboard.
     
    511511
    512512        $post_ID = (int) $post->ID;
    513 ?>
     513        ?>
    514514
    515515        <form name="post" action="<?php echo esc_url( admin_url( 'post.php' ) ); ?>" method="post" id="quick-press" class="initial-form hide-if-no-js">
     
    693693                }
    694694        }
    695 ?>
     695        ?>
    696696
    697697                <li id="comment-<?php echo $comment->comment_ID; ?>" <?php comment_class( array( 'comment-item', wp_get_comment_status( $comment ) ), $comment ); ?>>
     
    703703                        <div class="dashboard-comment-wrap has-row-actions">
    704704                        <p class="comment-meta">
    705                         <?php
     705                                <?php
    706706                                // Comments might not have a post they relate to, e.g. programmatically created ones.
    707                         if ( $comment_post_link ) {
    708                                 printf(
    709                                         /* translators: 1: comment author, 2: post link, 3: notification if the comment is pending */
    710                                         __( 'From %1$s on %2$s %3$s' ),
    711                                         '<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>',
    712                                         $comment_post_link,
    713                                         '<span class="approve">' . __( '[Pending]' ) . '</span>'
    714                                 );
    715                         } else {
    716                                 printf(
    717                                         /* translators: 1: comment author, 2: notification if the comment is pending */
    718                                         __( 'From %1$s %2$s' ),
    719                                         '<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>',
    720                                         '<span class="approve">' . __( '[Pending]' ) . '</span>'
    721                                 );
    722                         }
    723                         ?>
     707                                if ( $comment_post_link ) {
     708                                        printf(
     709                                                /* translators: 1: comment author, 2: post link, 3: notification if the comment is pending */
     710                                                __( 'From %1$s on %2$s %3$s' ),
     711                                                '<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>',
     712                                                $comment_post_link,
     713                                                '<span class="approve">' . __( '[Pending]' ) . '</span>'
     714                                        );
     715                                } else {
     716                                        printf(
     717                                                /* translators: 1: comment author, 2: notification if the comment is pending */
     718                                                __( 'From %1$s %2$s' ),
     719                                                '<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>',
     720                                                '<span class="approve">' . __( '[Pending]' ) . '</span>'
     721                                        );
     722                                }
     723                                ?>
    724724                        </p>
    725725
    726                         <?php
     726                                <?php
    727727                        else :
    728728                                switch ( $comment->comment_type ) {
     
    737737                                }
    738738                                $type = esc_html( $type );
    739                         ?>
     739                                ?>
    740740                        <div class="dashboard-comment-wrap has-row-actions">
    741741                        <p class="comment-meta">
    742                         <?php
     742                                <?php
    743743                                // Pingbacks, Trackbacks or custom comment types might not have a post they relate to, e.g. programmatically created ones.
    744                         if ( $comment_post_link ) {
    745                                 printf(
    746                                         /* translators: 1: type of comment, 2: post link, 3: notification if the comment is pending */
    747                                         _x( '%1$s on %2$s %3$s', 'dashboard' ),
    748                                         "<strong>$type</strong>",
    749                                         $comment_post_link,
    750                                         '<span class="approve">' . __( '[Pending]' ) . '</span>'
    751                                 );
    752                         } else {
    753                                 printf(
    754                                         /* translators: 1: type of comment, 2: notification if the comment is pending */
    755                                         _x( '%1$s %2$s', 'dashboard' ),
    756                                         "<strong>$type</strong>",
    757                                         '<span class="approve">' . __( '[Pending]' ) . '</span>'
    758                                 );
    759                         }
    760                         ?>
     744                                if ( $comment_post_link ) {
     745                                        printf(
     746                                                /* translators: 1: type of comment, 2: post link, 3: notification if the comment is pending */
     747                                                _x( '%1$s on %2$s %3$s', 'dashboard' ),
     748                                                "<strong>$type</strong>",
     749                                                $comment_post_link,
     750                                                '<span class="approve">' . __( '[Pending]' ) . '</span>'
     751                                        );
     752                                } else {
     753                                        printf(
     754                                                /* translators: 1: type of comment, 2: notification if the comment is pending */
     755                                                _x( '%1$s %2$s', 'dashboard' ),
     756                                                "<strong>$type</strong>",
     757                                                '<span class="approve">' . __( '[Pending]' ) . '</span>'
     758                                        );
     759                                }
     760                                ?>
    761761                        </p>
    762762                        <p class="comment-author"><?php comment_author_link( $comment ); ?></p>
     
    769769                        </div>
    770770                </li>
    771 <?php
     771        <?php
    772772        $GLOBALS['comment'] = null;
    773773}
     
    10501050        if ( is_scalar( $widget_control_id ) && $widget_control_id && isset( $wp_dashboard_control_callbacks[ $widget_control_id ] ) && is_callable( $wp_dashboard_control_callbacks[ $widget_control_id ] ) ) {
    10511051                call_user_func(
    1052                         $wp_dashboard_control_callbacks[ $widget_control_id ], '', array(
     1052                        $wp_dashboard_control_callbacks[ $widget_control_id ],
     1053                        '',
     1054                        array(
    10531055                                'id'       => $widget_control_id,
    10541056                                'callback' => $wp_dashboard_control_callbacks[ $widget_control_id ],
     
    17611763                                printf(
    17621764                                        __( 'Manage <a href="%1$s">widgets</a> or <a href="%2$s">menus</a>' ),
    1763                                         admin_url( 'widgets.php' ), admin_url( 'nav-menus.php' )
     1765                                        admin_url( 'widgets.php' ),
     1766                                        admin_url( 'nav-menus.php' )
    17641767                                );
    17651768                        } elseif ( current_theme_supports( 'widgets' ) ) {
Note: See TracChangeset for help on using the changeset viewer.