Make WordPress Core

Ticket #15309: att-mod-time-patch.diff

File att-mod-time-patch.diff, 684 bytes (added by shawnparker, 16 years ago)

mod for allowing updated attachments to update the post_modified time

Line 
1Index: wp-includes/post.php
2===================================================================
3--- wp-includes/post.php (revision 15723)
4+++ wp-includes/post.php (working copy)
5
6@@ -3343,10 +3343,13 @@
7 if ( empty($post_date_gmt) )
8 $post_date_gmt = current_time('mysql', 1);
9
10- if ( empty($post_modified) )
11- $post_modified = $post_date;
12- if ( empty($post_modified_gmt) )
13+ if ( $update || '0000-00-00 00:00:00' == $post_date ) {
14+ $post_modified = current_time( 'mysql' );
15+ $post_modified_gmt = current_time( 'mysql', 1 );
16+ } else {
17+ $post_modified = $post_date;
18 $post_modified_gmt = $post_date_gmt;
19+ }
20
21 if ( empty($comment_status) ) {
22 if ( $update )