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

    r42343 r43571  
    9090    while ( have_posts() ) :
    9191        the_post();
    92     ?>
     92        ?>
    9393    <item>
    9494        <title><?php the_title_rss(); ?></title>
    9595        <link><?php the_permalink_rss(); ?></link>
    96 <?php if ( get_comments_number() || comments_open() ) : ?>
     96        <?php if ( get_comments_number() || comments_open() ) : ?>
    9797        <comments><?php comments_link_feed(); ?></comments>
    98 <?php endif; ?>
     98        <?php endif; ?>
    9999        <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
    100100        <dc:creator><![CDATA[<?php the_author(); ?>]]></dc:creator>
     
    102102
    103103        <guid isPermaLink="false"><?php the_guid(); ?></guid>
    104 <?php if ( get_option( 'rss_use_excerpt' ) ) : ?>
     104        <?php if ( get_option( 'rss_use_excerpt' ) ) : ?>
    105105        <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
    106 <?php else : ?>
     106        <?php else : ?>
    107107        <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
    108     <?php $content = get_the_content_feed( 'rss2' ); ?>
    109     <?php if ( strlen( $content ) > 0 ) : ?>
     108            <?php $content = get_the_content_feed( 'rss2' ); ?>
     109            <?php if ( strlen( $content ) > 0 ) : ?>
    110110        <content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>
    111111    <?php else : ?>
    112112        <content:encoded><![CDATA[<?php the_excerpt_rss(); ?>]]></content:encoded>
    113113    <?php endif; ?>
    114 <?php endif; ?>
    115 <?php if ( get_comments_number() || comments_open() ) : ?>
     114        <?php endif; ?>
     115        <?php if ( get_comments_number() || comments_open() ) : ?>
    116116        <wfw:commentRss><?php echo esc_url( get_post_comments_feed_link( null, 'rss2' ) ); ?></wfw:commentRss>
    117117        <slash:comments><?php echo get_comments_number(); ?></slash:comments>
    118 <?php endif; ?>
    119 <?php rss_enclosure(); ?>
    120     <?php
    121     /**
    122     * Fires at the end of each RSS2 feed item.
    123     *
    124     * @since 2.0.0
    125     */
    126     do_action( 'rss2_item' );
    127     ?>
     118        <?php endif; ?>
     119        <?php rss_enclosure(); ?>
     120        <?php
     121        /**
     122        * Fires at the end of each RSS2 feed item.
     123        *
     124        * @since 2.0.0
     125        */
     126        do_action( 'rss2_item' );
     127        ?>
    128128    </item>
    129129    <?php endwhile; ?>
Note: See TracChangeset for help on using the changeset viewer.