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-rdf.php

    r38925 r42343  
    66 */
    77
    8 header('Content-Type: ' . feed_content_type('rdf') . '; charset=' . get_option('blog_charset'), true);
     8header( 'Content-Type: ' . feed_content_type( 'rdf' ) . '; 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/** This action is documented in wp-includes/feed-rss2.php */
     
    3030    ?>
    3131>
    32 <channel rdf:about="<?php bloginfo_rss("url") ?>">
     32<channel rdf:about="<?php bloginfo_rss( 'url' ); ?>">
    3333    <title><?php wp_title_rss(); ?></title>
    34     <link><?php bloginfo_rss('url') ?></link>
    35     <description><?php bloginfo_rss('description') ?></description>
    36     <dc:date><?php
     34    <link><?php bloginfo_rss( 'url' ); ?></link>
     35    <description><?php bloginfo_rss( 'description' ); ?></description>
     36    <dc:date>
     37    <?php
    3738        $date = get_lastpostmodified( 'GMT' );
    3839        echo $date ? mysql2date( 'Y-m-d\TH:i:s\Z', $date ) : date( 'Y-m-d\TH:i:s\Z' );
    39     ?></dc:date>
    40     <sy:updatePeriod><?php
     40    ?>
     41    </dc:date>
     42    <sy:updatePeriod>
     43    <?php
    4144        /** This filter is documented in wp-includes/feed-rss2.php */
    4245        echo apply_filters( 'rss_update_period', 'hourly' );
    43     ?></sy:updatePeriod>
    44     <sy:updateFrequency><?php
     46    ?>
     47    </sy:updatePeriod>
     48    <sy:updateFrequency>
     49    <?php
    4550        /** This filter is documented in wp-includes/feed-rss2.php */
    4651        echo apply_filters( 'rss_update_frequency', '1' );
    47     ?></sy:updateFrequency>
     52    ?>
     53    </sy:updateFrequency>
    4854    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    4955    <?php
     
    5763    <items>
    5864        <rdf:Seq>
    59         <?php while (have_posts()): the_post(); ?>
    60             <rdf:li rdf:resource="<?php the_permalink_rss() ?>"/>
     65        <?php
     66        while ( have_posts() ) :
     67            the_post();
     68?>
     69            <rdf:li rdf:resource="<?php the_permalink_rss(); ?>"/>
    6170        <?php endwhile; ?>
    6271        </rdf:Seq>
    6372    </items>
    6473</channel>
    65 <?php rewind_posts(); while (have_posts()): the_post(); ?>
    66 <item rdf:about="<?php the_permalink_rss() ?>">
    67     <title><?php the_title_rss() ?></title>
    68     <link><?php the_permalink_rss() ?></link>
    69     <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_date_gmt, false); ?></dc:date>
    70     <dc:creator><![CDATA[<?php the_author() ?>]]></dc:creator>
    71     <?php the_category_rss('rdf') ?>
    72 <?php if (get_option('rss_use_excerpt')) : ?>
    73     <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
     74<?php
     75rewind_posts();
     76while ( have_posts() ) :
     77    the_post();
     78?>
     79<item rdf:about="<?php the_permalink_rss(); ?>">
     80    <title><?php the_title_rss(); ?></title>
     81    <link><?php the_permalink_rss(); ?></link>
     82    <dc:date><?php echo mysql2date( 'Y-m-d\TH:i:s\Z', $post->post_date_gmt, false ); ?></dc:date>
     83    <dc:creator><![CDATA[<?php the_author(); ?>]]></dc:creator>
     84    <?php the_category_rss( 'rdf' ); ?>
     85<?php if ( get_option( 'rss_use_excerpt' ) ) : ?>
     86    <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
    7487<?php else : ?>
    75     <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
    76     <content:encoded><![CDATA[<?php the_content_feed('rdf') ?>]]></content:encoded>
     88    <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
     89    <content:encoded><![CDATA[<?php the_content_feed( 'rdf' ); ?>]]></content:encoded>
    7790<?php endif; ?>
    7891    <?php
     
    8598    ?>
    8699</item>
    87 <?php endwhile;  ?>
     100<?php endwhile; ?>
    88101</rdf:RDF>
Note: See TracChangeset for help on using the changeset viewer.