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/twentyeleven/content-gallery.php

    r42343 r43571  
    3333            <?php if ( post_password_required() ) : ?>
    3434                <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
    35             <?php
     35                <?php
    3636            else :
    3737                $images = twentyeleven_get_gallery_images();
     
    3939                    $total_images = count( $images );
    4040                    $image        = reset( $images );
    41             ?>
     41                    ?>
    4242                <figure class="gallery-thumb">
    4343                    <a href="<?php the_permalink(); ?>"><?php echo wp_get_attachment_image( $image, 'thumbnail' ); ?></a>
     
    4545
    4646    <p><em>
    47     <?php
    48                 printf(
    49                     _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyeleven' ),
    50                     'href="' . esc_url( get_permalink() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark"',
    51                     number_format_i18n( $total_images )
    52                 );
    53                                 ?>
     47                    <?php
     48                    printf(
     49                        _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyeleven' ),
     50                        'href="' . esc_url( get_permalink() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark"',
     51                        number_format_i18n( $total_images )
     52                    );
     53                    ?>
    5454                    </em></p>
    5555                        <?php endif; // end twentyeleven_get_gallery_images() check ?>
    56             <?php the_excerpt(); ?>
     56                <?php the_excerpt(); ?>
    5757        <?php endif; ?>
    5858        <?php
     
    6363            )
    6464        );
    65 ?>
     65        ?>
    6666    </div><!-- .entry-content -->
    6767    <?php endif; ?>
     
    7373            $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
    7474        if ( $categories_list ) :
    75         ?>
     75            ?>
    7676        <span class="cat-links">
    77         <?php
     77            <?php
    7878            printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
    79         $show_sep = true;
     79            $show_sep = true;
    8080            ?>
    8181        </span>
     
    8686        if ( $tags_list ) :
    8787            if ( $show_sep ) :
    88             ?>
     88                ?>
    8989        <span class="sep"> | </span>
    9090            <?php endif; // End if $show_sep ?>
     
    9898
    9999        <?php if ( comments_open() ) : ?>
    100         <?php if ( $show_sep ) : ?>
     100            <?php if ( $show_sep ) : ?>
    101101        <span class="sep"> | </span>
    102102        <?php endif; // End if $show_sep ?>
Note: See TracChangeset for help on using the changeset viewer.