Ticket #3944: link-template-php.diff
File link-template-php.diff, 1.3 KB (added by , 18 years ago) |
---|
-
E:/EclipseWork/WordPressDev/wp-includes/link-template.php
67 67 $permalink = get_option('permalink_structure'); 68 68 69 69 if ( '' != $permalink && 'draft' != $post->post_status ) { 70 $unixtime = strtotime($post->post_date); 71 70 72 71 $category = ''; 73 72 if (strpos($permalink, '%category%') !== false) { 74 73 $cats = get_the_category($post->ID); … … 79 78 80 79 $authordata = get_userdata($post->post_author); 81 80 $author = $authordata->user_nicename; 82 $date = explode(" ",date('Y m d H i s', $unixtime)); 81 // try to use the date info actually stored in the database, so it 82 // will match the query when the user clicks on the permalink 83 $date = array(); 84 if( preg_match( "/^(\d\d\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)/", $post->post_date, $matches )) { 85 $date = array( $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6] ); 86 } else { 87 $unixtime = strtotime($post->post_date); 88 $date = explode(" ",date('Y m d H i s', $unixtime)); 89 } 83 90 $rewritereplace = 84 91 array( 85 92 $date[0],