Changeset 46795 for trunk/src/wp-includes/link-template.php
- Timestamp:
- 11/28/2019 01:40:19 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/link-template.php
r46383 r46795 167 167 168 168 if ( '' != $permalink && ! in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ) ) ) { 169 $unixtime = strtotime( $post->post_date );170 169 171 170 $category = ''; … … 213 212 } 214 213 215 $date = explode( ' ', gmdate( 'Y m d H i s', $unixtime ) ); 216 $rewritereplace = 217 array( 214 // This is not an API call because the permalink is based on the stored post_date value, 215 // which should be parsed as local time regardless of the default PHP timezone. 216 $date = explode( ' ', str_replace( array( '-', ':' ), ' ', $post->post_date ) ); 217 218 $rewritereplace = array( 218 219 $date[0], 219 220 $date[1], … … 228 229 $post->post_name, 229 230 ); 230 $permalink = home_url( str_replace( $rewritecode, $rewritereplace, $permalink ) ); 231 $permalink = user_trailingslashit( $permalink, 'single' ); 231 232 $permalink = home_url( str_replace( $rewritecode, $rewritereplace, $permalink ) ); 233 $permalink = user_trailingslashit( $permalink, 'single' ); 234 232 235 } else { // if they're not using the fancy permalink option 233 236 $permalink = home_url( '?p=' . $post->ID );
Note: See TracChangeset
for help on using the changeset viewer.