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/twentyfourteen/inc/widgets.php

    r42749 r43571  
    3232    public function __construct() {
    3333        parent::__construct(
    34             'widget_twentyfourteen_ephemera', __( 'Twenty Fourteen Ephemera', 'twentyfourteen' ), array(
     34            'widget_twentyfourteen_ephemera',
     35            __( 'Twenty Fourteen Ephemera', 'twentyfourteen' ),
     36            array(
    3537                'classname'                   => 'widget_twentyfourteen_ephemera',
    3638                'description'                 => __( 'Use this widget to list your recent Aside, Quote, Video, Audio, Image, Gallery, and Link posts.', 'twentyfourteen' ),
     
    141143                    $tmp_more        = $GLOBALS['more'];
    142144                    $GLOBALS['more'] = 0;
    143                 ?>
     145                    ?>
    144146                <li>
    145147                <article <?php post_class(); ?>>
     
    182184
    183185                                    if ( ! empty( $post_thumbnail ) ) :
    184                         ?>
     186                                        ?>
    185187                        <a href="<?php the_permalink(); ?>"><?php echo $post_thumbnail; ?></a>
    186188                        <?php endif; ?>
    187189                        <p class="wp-caption-text">
    188                         <?php
    189                             printf(
    190                                 _n( 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photo</a>.', 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photos</a>.', $total_images, 'twentyfourteen' ),
    191                                 esc_url( get_permalink() ),
    192                                 number_format_i18n( $total_images )
    193                             );
    194                         ?>
     190                                <?php
     191                                printf(
     192                                    _n( 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photo</a>.', 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photos</a>.', $total_images, 'twentyfourteen' ),
     193                                    esc_url( get_permalink() ),
     194                                    number_format_i18n( $total_images )
     195                                );
     196                                ?>
    195197                        </p>
    196                         <?php
     198                                <?php
    197199                        endif;
    198200
     
    200202                                the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) );
    201203                            endif;
    202                         ?>
     204                            ?>
    203205                    </div><!-- .entry-content -->
    204206
Note: See TracChangeset for help on using the changeset viewer.