wp/wp-includes/feed-rdf.php
changeset 9 177826044cd9
parent 7 cf61fcea0001
child 16 a86126ab1dd4
equal deleted inserted replaced
8:c7c34916027a 9:177826044cd9
     3  * RSS 1 RDF Feed Template for displaying RSS 1 Posts feed.
     3  * RSS 1 RDF Feed Template for displaying RSS 1 Posts feed.
     4  *
     4  *
     5  * @package WordPress
     5  * @package WordPress
     6  */
     6  */
     7 
     7 
     8 header('Content-Type: ' . feed_content_type('rdf') . '; charset=' . get_option('blog_charset'), true);
     8 header( 'Content-Type: ' . feed_content_type( 'rdf' ) . '; charset=' . get_option( 'blog_charset' ), true );
     9 $more = 1;
     9 $more = 1;
    10 
    10 
    11 echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
    11 echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>';
    12 
    12 
    13 /** This action is documented in wp-includes/feed-rss2.php */
    13 /** This action is documented in wp-includes/feed-rss2.php */
    14 do_action( 'rss_tag_pre', 'rdf' );
    14 do_action( 'rss_tag_pre', 'rdf' );
    15 ?>
    15 ?>
    16 <rdf:RDF
    16 <rdf:RDF
    27 	 * @since 2.0.0
    27 	 * @since 2.0.0
    28 	 */
    28 	 */
    29 	do_action( 'rdf_ns' );
    29 	do_action( 'rdf_ns' );
    30 	?>
    30 	?>
    31 >
    31 >
    32 <channel rdf:about="<?php bloginfo_rss("url") ?>">
    32 <channel rdf:about="<?php bloginfo_rss( 'url' ); ?>">
    33 	<title><?php wp_title_rss(); ?></title>
    33 	<title><?php wp_title_rss(); ?></title>
    34 	<link><?php bloginfo_rss('url') ?></link>
    34 	<link><?php bloginfo_rss( 'url' ); ?></link>
    35 	<description><?php bloginfo_rss('description') ?></description>
    35 	<description><?php bloginfo_rss( 'description' ); ?></description>
    36 	<dc:date><?php
    36 	<dc:date><?php echo get_feed_build_date( 'Y-m-d\TH:i:s\Z' ); ?>	</dc:date>
    37 		$date = get_lastpostmodified( 'GMT' );
    37 	<sy:updatePeriod>
    38 		echo $date ? mysql2date( 'Y-m-d\TH:i:s\Z', $date ) : date( 'Y-m-d\TH:i:s\Z' );
    38 	<?php
    39 	?></dc:date>
       
    40 	<sy:updatePeriod><?php
       
    41 		/** This filter is documented in wp-includes/feed-rss2.php */
    39 		/** This filter is documented in wp-includes/feed-rss2.php */
    42 		echo apply_filters( 'rss_update_period', 'hourly' );
    40 		echo apply_filters( 'rss_update_period', 'hourly' );
    43 	?></sy:updatePeriod>
    41 	?>
    44 	<sy:updateFrequency><?php
    42 	</sy:updatePeriod>
       
    43 	<sy:updateFrequency>
       
    44 	<?php
    45 		/** This filter is documented in wp-includes/feed-rss2.php */
    45 		/** This filter is documented in wp-includes/feed-rss2.php */
    46 		echo apply_filters( 'rss_update_frequency', '1' );
    46 		echo apply_filters( 'rss_update_frequency', '1' );
    47 	?></sy:updateFrequency>
    47 	?>
       
    48 	</sy:updateFrequency>
    48 	<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    49 	<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    49 	<?php
    50 	<?php
    50 	/**
    51 	/**
    51 	 * Fires at the end of the RDF feed header.
    52 	 * Fires at the end of the RDF feed header.
    52 	 *
    53 	 *
    54 	 */
    55 	 */
    55 	do_action( 'rdf_header' );
    56 	do_action( 'rdf_header' );
    56 	?>
    57 	?>
    57 	<items>
    58 	<items>
    58 		<rdf:Seq>
    59 		<rdf:Seq>
    59 		<?php while (have_posts()): the_post(); ?>
    60 		<?php
    60 			<rdf:li rdf:resource="<?php the_permalink_rss() ?>"/>
    61 		while ( have_posts() ) :
       
    62 			the_post();
       
    63 			?>
       
    64 			<rdf:li rdf:resource="<?php the_permalink_rss(); ?>"/>
    61 		<?php endwhile; ?>
    65 		<?php endwhile; ?>
    62 		</rdf:Seq>
    66 		</rdf:Seq>
    63 	</items>
    67 	</items>
    64 </channel>
    68 </channel>
    65 <?php rewind_posts(); while (have_posts()): the_post(); ?>
    69 <?php
    66 <item rdf:about="<?php the_permalink_rss() ?>">
    70 rewind_posts();
    67 	<title><?php the_title_rss() ?></title>
    71 while ( have_posts() ) :
    68 	<link><?php the_permalink_rss() ?></link>
    72 	the_post();
    69 	<dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_date_gmt, false); ?></dc:date>
    73 	?>
    70 	<dc:creator><![CDATA[<?php the_author() ?>]]></dc:creator>
    74 <item rdf:about="<?php the_permalink_rss(); ?>">
    71 	<?php the_category_rss('rdf') ?>
    75 	<title><?php the_title_rss(); ?></title>
    72 <?php if (get_option('rss_use_excerpt')) : ?>
    76 	<link><?php the_permalink_rss(); ?></link>
    73 	<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
    77 	<dc:date><?php echo mysql2date( 'Y-m-d\TH:i:s\Z', $post->post_date_gmt, false ); ?></dc:date>
       
    78 	<dc:creator><![CDATA[<?php the_author(); ?>]]></dc:creator>
       
    79 	<?php the_category_rss( 'rdf' ); ?>
       
    80 	<?php if ( get_option( 'rss_use_excerpt' ) ) : ?>
       
    81 	<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
    74 <?php else : ?>
    82 <?php else : ?>
    75 	<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
    83 	<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
    76 	<content:encoded><![CDATA[<?php the_content_feed('rdf') ?>]]></content:encoded>
    84 	<content:encoded><![CDATA[<?php the_content_feed( 'rdf' ); ?>]]></content:encoded>
    77 <?php endif; ?>
    85 <?php endif; ?>
    78 	<?php
    86 	<?php
    79 	/**
    87 	/**
    80 	 * Fires at the end of each RDF feed item.
    88 	 * Fires at the end of each RDF feed item.
    81 	 *
    89 	 *
    82 	 * @since 2.0.0
    90 	 * @since 2.0.0
    83 	 */
    91 	 */
    84 	do_action( 'rdf_item' );
    92 	do_action( 'rdf_item' );
    85 	?>
    93 	?>
    86 </item>
    94 </item>
    87 <?php endwhile;  ?>
    95 <?php endwhile; ?>
    88 </rdf:RDF>
    96 </rdf:RDF>