Changeset 45247
- Timestamp:
- 04/18/2019 05:07:07 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/feed-atom-comments.php
r45215 r45247 44 44 <subtitle type="text"><?php bloginfo_rss( 'description' ); ?></subtitle> 45 45 46 <?php $date = get_last_build_date(); ?> 47 <updated><?php echo $date ? mysql2date( 'Y-m-d\TH:i:s\Z', $date, false ) : date( 'Y-m-d\TH:i:s\Z' ); ?></updated> 46 <updated><?php echo get_feed_build_date( 'Y-m-d\TH:i:s\Z' ); ?></updated> 48 47 49 48 <?php if ( is_singular() ) { ?> -
trunk/src/wp-includes/feed-atom.php
r45215 r45247 31 31 <subtitle type="text"><?php bloginfo_rss( 'description' ); ?></subtitle> 32 32 33 <?php $date = get_last_build_date(); ?> 34 <updated><?php echo $date ? mysql2date( 'Y-m-d\TH:i:s\Z', $date, false ) : date( 'Y-m-d\TH:i:s\Z' ); ?></updated> 33 <updated><?php echo get_feed_build_date( 'Y-m-d\TH:i:s\Z' ); ?></updated> 35 34 36 35 <link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php bloginfo_rss( 'url' ); ?>" /> -
trunk/src/wp-includes/feed-rdf.php
r44948 r45247 34 34 <link><?php bloginfo_rss( 'url' ); ?></link> 35 35 <description><?php bloginfo_rss( 'description' ); ?></description> 36 <dc:date> 37 <?php 38 $date = get_last_build_date(); 39 echo $date ? mysql2date( 'Y-m-d\TH:i:s\Z', $date ) : date( 'Y-m-d\TH:i:s\Z' ); 40 ?> 41 </dc:date> 36 <dc:date><?php echo get_feed_build_date( 'Y-m-d\TH:i:s\Z' ); ?> </dc:date> 42 37 <sy:updatePeriod> 43 38 <?php -
trunk/src/wp-includes/feed-rss.php
r44948 r45247 15 15 <link><?php bloginfo_rss( 'url' ); ?></link> 16 16 <description><?php bloginfo_rss( 'description' ); ?></description> 17 <lastBuildDate> 18 <?php 19 $date = get_last_build_date(); 20 echo $date ? mysql2date( 'D, d M Y H:i:s +0000', $date ) : date( 'D, d M Y H:i:s +0000' ); 21 ?> 22 </lastBuildDate> 17 <lastBuildDate><?php echo get_feed_build_date( 'D, d M Y H:i:s +0000' ); ?></lastBuildDate> 23 18 <docs>http://backend.userland.com/rss092</docs> 24 19 <language><?php bloginfo_rss( 'language' ); ?></language> -
trunk/src/wp-includes/feed-rss2-comments.php
r44948 r45247 50 50 <link><?php ( is_single() ) ? the_permalink_rss() : bloginfo_rss( 'url' ); ?></link> 51 51 <description><?php bloginfo_rss( 'description' ); ?></description> 52 <lastBuildDate> 53 <?php 54 $date = get_last_build_date(); 55 echo $date ? mysql2date( 'r', $date, false ) : date( 'r' ); 56 ?> 57 </lastBuildDate> 52 <lastBuildDate><?php echo get_feed_build_date( 'r' ); ?></lastBuildDate> 58 53 <sy:updatePeriod> 59 54 <?php -
trunk/src/wp-includes/feed-rss2.php
r44948 r45247 43 43 <link><?php bloginfo_rss( 'url' ); ?></link> 44 44 <description><?php bloginfo_rss( 'description' ); ?></description> 45 <lastBuildDate> 46 <?php 47 $date = get_last_build_date(); 48 echo $date ? mysql2date( 'r', $date, false ) : date( 'r' ); 49 ?> 50 </lastBuildDate> 45 <lastBuildDate><?php echo get_feed_build_date( 'r' ); ?></lastBuildDate> 51 46 <language><?php bloginfo_rss( 'language' ); ?></language> 52 47 <sy:updatePeriod> -
trunk/src/wp-includes/feed.php
r44948 r45247 639 639 640 640 /* 641 * Get the timestamp of the most recently modified post from WP_Query. 642 * 643 * If viewing a comment feed, the date of the most recently modified 644 * comment will be returned. 645 * 646 * @global WP_Query $wp_query The global WP_Query object. 647 * 648 * @since 5.2.0 649 * 650 * @return string The timestamp. 651 */ 652 function get_last_build_date() { 641 * Get the timestamp of the most recently modified post from WP_Query. 642 * 643 * If viewing a comment feed, the timestamp of the most recently modified 644 * comment will be returned. 645 * 646 * @global WP_Query $wp_query The global WP_Query object. 647 * 648 * @since 5.2.0 649 * 650 * @param string $format Format of the timestamp to return, passed to mysql2date. 651 * 652 * @return string The timestamp. 653 */ 654 function get_feed_build_date( $format ) { 653 655 global $wp_query; 654 656 … … 671 673 672 674 // Determine the maximum modified time. 673 $max_modified_time = max( $modified_times ); 675 $max_modified_time = max( 676 array_map( 677 function ( $time ) use ( $format ) { 678 return mysql2date( $format, $time, false ); 679 }, 680 $modified_times 681 ) 682 ); 674 683 675 684 /** … … 678 687 * @since 5.2.0 679 688 * 680 * @param string $max_modified_times Date the last post or comment was modified in the query. 681 */ 682 return apply_filters( 'get_last_build_date', $max_modified_time ); 689 * @param string $max_modified_time Date the last post or comment was modified in the query. 690 * @param string $format The date format requested in get_feed_build_date. 691 */ 692 return apply_filters( 'get_feed_build_date', $max_modified_time, $format ); 683 693 } 684 694 -
trunk/tests/phpunit/tests/feed/rss2.php
r44951 r45247 473 473 * @ticket 4575 474 474 * 475 * @dataProvider data_test_get_ last_build_date476 */ 477 public function test_get_ last_build_date( $url, $element ) {475 * @dataProvider data_test_get_feed_build_date 476 */ 477 public function test_get_feed_build_date( $url, $element ) { 478 478 $this->go_to( $url ); 479 479 $feed = $this->do_rss2(); … … 483 483 $rss = xml_find( $xml, $element ); 484 484 $last_build_date = $rss[0]['child'][0]['child'][4]['content']; 485 $this->assertEquals( strtotime( get_ last_build_date() ), strtotime( $last_build_date ) );486 } 487 488 489 public function data_test_get_ last_build_date() {485 $this->assertEquals( strtotime( get_feed_build_date( 'r' ) ), strtotime( $last_build_date ) ); 486 } 487 488 489 public function data_test_get_feed_build_date() { 490 490 return array( 491 491 array( '/?feed=rss2', 'rss' ),
Note: See TracChangeset
for help on using the changeset viewer.