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-includes/widgets/class-wp-widget-recent-posts.php

    r42343 r43571  
    7070                $r = new WP_Query(
    7171                        apply_filters(
    72                                 'widget_posts_args', array(
     72                                'widget_posts_args',
     73                                array(
    7374                                        'posts_per_page'      => $number,
    7475                                        'no_found_rows'       => true,
    7576                                        'post_status'         => 'publish',
    7677                                        'ignore_sticky_posts' => true,
    77                                 ), $instance
     78                                ),
     79                                $instance
    7880                        )
    7981                );
    … …  
    136138                $number    = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5;
    137139                $show_date = isset( $instance['show_date'] ) ? (bool) $instance['show_date'] : false;
    138 ?>
     140                ?>
    139141                <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
    140142                <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
    … …  
    145147                <p><input class="checkbox" type="checkbox"<?php checked( $show_date ); ?> id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" />
    146148                <label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Display post date?' ); ?></label></p>
    147 <?php
     149                <?php
    148150        }
    149151}
Note: See TracChangeset for help on using the changeset viewer.