Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (7 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/feed-rss2.php

    r39614 r42343  
    66 */
    77
    8 header('Content-Type: ' . feed_content_type('rss2') . '; charset=' . get_option('blog_charset'), true);
     8header( 'Content-Type: ' . feed_content_type( 'rss2' ) . '; charset=' . get_option( 'blog_charset' ), true );
    99$more = 1;
    1010
    11 echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
     11echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>';
    1212
    1313/**
     
    4141    <title><?php wp_title_rss(); ?></title>
    4242    <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
    43     <link><?php bloginfo_rss('url') ?></link>
    44     <description><?php bloginfo_rss("description") ?></description>
    45     <lastBuildDate><?php
     43    <link><?php bloginfo_rss( 'url' ); ?></link>
     44    <description><?php bloginfo_rss( 'description' ); ?></description>
     45    <lastBuildDate>
     46    <?php
    4647        $date = get_lastpostmodified( 'GMT' );
    4748        echo $date ? mysql2date( 'r', $date, false ) : date( 'r' );
    48     ?></lastBuildDate>
     49    ?>
     50    </lastBuildDate>
    4951    <language><?php bloginfo_rss( 'language' ); ?></language>
    50     <sy:updatePeriod><?php
     52    <sy:updatePeriod>
     53    <?php
    5154        $duration = 'hourly';
    5255
     
    6063         */
    6164        echo apply_filters( 'rss_update_period', $duration );
    62     ?></sy:updatePeriod>
    63     <sy:updateFrequency><?php
     65    ?>
     66    </sy:updatePeriod>
     67    <sy:updateFrequency>
     68    <?php
    6469        $frequency = '1';
    6570
     
    7378         */
    7479        echo apply_filters( 'rss_update_frequency', $frequency );
    75     ?></sy:updateFrequency>
     80    ?>
     81    </sy:updateFrequency>
    7682    <?php
    7783    /**
     
    8086     * @since 2.0.0
    8187     */
    82     do_action( 'rss2_head');
     88    do_action( 'rss2_head' );
    8389
    84     while( have_posts()) : the_post();
     90    while ( have_posts() ) :
     91        the_post();
    8592    ?>
    8693    <item>
    87         <title><?php the_title_rss() ?></title>
    88         <link><?php the_permalink_rss() ?></link>
     94        <title><?php the_title_rss(); ?></title>
     95        <link><?php the_permalink_rss(); ?></link>
    8996<?php if ( get_comments_number() || comments_open() ) : ?>
    9097        <comments><?php comments_link_feed(); ?></comments>
    9198<?php endif; ?>
    92         <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
    93         <dc:creator><![CDATA[<?php the_author() ?>]]></dc:creator>
    94         <?php the_category_rss('rss2') ?>
     99        <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
     100        <dc:creator><![CDATA[<?php the_author(); ?>]]></dc:creator>
     101        <?php the_category_rss( 'rss2' ); ?>
    95102
    96103        <guid isPermaLink="false"><?php the_guid(); ?></guid>
    97 <?php if (get_option('rss_use_excerpt')) : ?>
     104<?php if ( get_option( 'rss_use_excerpt' ) ) : ?>
    98105        <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
    99106<?php else : ?>
    100107        <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
    101     <?php $content = get_the_content_feed('rss2'); ?>
     108    <?php $content = get_the_content_feed( 'rss2' ); ?>
    102109    <?php if ( strlen( $content ) > 0 ) : ?>
    103110        <content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>
     
    107114<?php endif; ?>
    108115<?php if ( get_comments_number() || comments_open() ) : ?>
    109         <wfw:commentRss><?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?></wfw:commentRss>
     116        <wfw:commentRss><?php echo esc_url( get_post_comments_feed_link( null, 'rss2' ) ); ?></wfw:commentRss>
    110117        <slash:comments><?php echo get_comments_number(); ?></slash:comments>
    111118<?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.