WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/17/2018 01:50:26 AM (3 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/media.php

    r42343 r43571  
    114114        }
    115115
    116     ?>
     116        ?>
    117117
    118118    <div class="wrap">
    119119    <h1 class="wp-heading-inline">
    120 <?php
    121 echo esc_html( $title );
    122 ?>
     120        <?php
     121        echo esc_html( $title );
     122        ?>
    123123</h1>
    124124
    125 <?php
    126 if ( current_user_can( 'upload_files' ) ) {
    127 ?>
     125        <?php
     126        if ( current_user_can( 'upload_files' ) ) {
     127            ?>
    128128    <a href="media-new.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'file' ); ?></a>
    129129<?php } ?>
     
    133133    <form method="post" class="media-upload-form" id="media-single-form">
    134134    <p class="submit" style="padding-bottom: 0;">
    135     <?php submit_button( __( 'Update Media' ), 'primary', 'save', false ); ?>
     135        <?php submit_button( __( 'Update Media' ), 'primary', 'save', false ); ?>
    136136    </p>
    137137
    138138    <div class="media-single">
    139139    <div id="media-item-<?php echo $att_id; ?>" class="media-item">
    140     <?php
    141     echo get_media_item(
    142         $att_id, array(
    143             'toggle'     => false,
    144             'send'       => false,
    145             'delete'     => false,
    146             'show_title' => false,
    147             'errors'     => ! empty( $errors[ $att_id ] ) ? $errors[ $att_id ] : null,
    148         )
    149     );
    150 ?>
     140        <?php
     141        echo get_media_item(
     142            $att_id,
     143            array(
     144                'toggle'     => false,
     145                'send'       => false,
     146                'delete'     => false,
     147                'show_title' => false,
     148                'errors'     => ! empty( $errors[ $att_id ] ) ? $errors[ $att_id ] : null,
     149            )
     150        );
     151        ?>
    151152    </div>
    152153    </div>
    153154
    154     <?php submit_button( __( 'Update Media' ), 'primary', 'save' ); ?>
     155        <?php submit_button( __( 'Update Media' ), 'primary', 'save' ); ?>
    155156    <input type="hidden" name="post_id" id="post_id" value="<?php echo isset( $post_id ) ? esc_attr( $post_id ) : ''; ?>" />
    156157    <input type="hidden" name="attachment_id" id="attachment_id" value="<?php echo esc_attr( $att_id ); ?>" />
    157158    <input type="hidden" name="action" value="editattachment" />
    158     <?php wp_original_referer_field( true, 'previous' ); ?>
    159     <?php wp_nonce_field( 'media-form' ); ?>
     159        <?php wp_original_referer_field( true, 'previous' ); ?>
     160        <?php wp_nonce_field( 'media-form' ); ?>
    160161
    161162    </form>
     
    163164    </div>
    164165
    165     <?php
     166        <?php
    166167
    167     require( ABSPATH . 'wp-admin/admin-footer.php' );
     168        require( ABSPATH . 'wp-admin/admin-footer.php' );
    168169
    169170        exit;
Note: See TracChangeset for help on using the changeset viewer.