Ticket #4575: 4575_6.diff
File 4575_6.diff, 4.8 KB (added by , 9 years ago) |
---|
-
src/wp-includes/feed-atom-comments.php
37 37 ?></title> 38 38 <subtitle type="text"><?php bloginfo_rss('description'); ?></subtitle> 39 39 40 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_last commentmodified('GMT'), false); ?></updated>40 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_last_build_date(), false); ?></updated> 41 41 42 42 <?php if ( is_singular() ) { ?> 43 43 <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php comments_link_feed(); ?>" /> -
src/wp-includes/feed-atom.php
30 30 <title type="text"><?php bloginfo_rss('name'); wp_title_rss(); ?></title> 31 31 <subtitle type="text"><?php bloginfo_rss("description") ?></subtitle> 32 32 33 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_last postmodified('GMT'), false); ?></updated>33 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_last_build_date(), false); ?></updated> 34 34 35 35 <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php bloginfo_rss('url') ?>" /> 36 36 <id><?php bloginfo('atom_url'); ?></id> -
src/wp-includes/feed-rss2-comments.php
43 43 <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" /> 44 44 <link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link> 45 45 <description><?php bloginfo_rss("description") ?></description> 46 <lastBuildDate><?php echo mysql2date('r', get_last_build_date _feed(), false ); ?></lastBuildDate>46 <lastBuildDate><?php echo mysql2date('r', get_last_build_date(), false ); ?></lastBuildDate> 47 47 <sy:updatePeriod><?php 48 48 /** This filter is documented in wp-includes/feed-rss2.php */ 49 49 echo apply_filters( 'rss_update_period', 'hourly' ); -
src/wp-includes/feed-rss2.php
42 42 <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" /> 43 43 <link><?php bloginfo_rss('url') ?></link> 44 44 <description><?php bloginfo_rss("description") ?></description> 45 <lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_last_build_date _feed(), false); ?></lastBuildDate>45 <lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_last_build_date(), false); ?></lastBuildDate> 46 46 <language><?php bloginfo_rss( 'language' ); ?></language> 47 47 <sy:updatePeriod><?php 48 48 $duration = 'hourly'; -
src/wp-includes/feed.php
97 97 * 98 98 * @return string Date ('Y-m-d H:i:s' for use with mysql2date() ) 99 99 */ 100 function get_last_build_date _feed() {101 global $wp_query , $wpdb;100 function get_last_build_date() { 101 global $wp_query; 102 102 103 103 if ( $wp_query->have_posts() ) { 104 $post_ids = array(); 105 $post_times = array(); 106 foreach( $wp_query->posts as $post ) { 107 $post_ids[] = $post->ID; 108 $post_times[] = $post->post_modified_gmt; 109 } 110 $postids = implode( "','", $post_ids ); 104 // Determine max post time 105 $post_ids = wp_list_pluck( $wp_query->posts, 'ID' ); 106 $post_times = wp_list_pluck( $wp_query->posts, 'post_modified_gmt' ); 111 107 $max_post_time = max( $post_times ); 112 108 113 if ( $wp_query->is_comment_feed() ) { 114 $max_comment_time = $wpdb->get_var( $wpdb->prepare( "SELECT MAX(comment_date_gmt) FROM $wpdb->comments WHERE comment_post_ID IN ('%s') AND comment_approved = '1'", $postids ) ); 109 // If this is a comment feed, we want to check those objects too 110 if( $wp_query->is_comment_feed() && $wp_query->have_comments() ) { 111 $comments_query = new WP_Comment_Query; 112 $comments = $comments_query->query( array( 113 'post__in' => $post_ids 114 ) ); 115 115 116 // Determine max comment time 117 $comment_times = wp_list_pluck( $comments, 'comment_date_gmt' ); 118 $max_comment_time = max( $comment_times ); 119 120 // Return the most recent timestamp between posts and comments 116 121 return max( $max_post_time, $max_comment_time ); 117 122 } 123 // Return the most recent post timestamp if there are no comments to consider 118 124 return $max_post_time; 119 125 } 120 126 121 // Fallback to last time any post was modified or published .127 // Fallback to last time any post was modified or published 122 128 return get_lastpostmodified( 'GMT' ); 123 129 } 124 130