Ticket #39321: 39321.patch
File 39321.patch, 1.1 KB (added by , 7 years ago) |
---|
-
src/wp-includes/link-template.php
162 162 */ 163 163 $permalink = apply_filters( 'pre_post_link', $permalink, $post, $leavename ); 164 164 165 if ( '' != $permalink && !in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ) ) ) {165 if ( '' != $permalink && !in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future', 'inherit' ) ) ) { 166 166 $unixtime = strtotime($post->post_date); 167 167 168 168 $category = ''; … … 200 200 } 201 201 202 202 $author = ''; 203 if ( strpos($permalink, '%author%') !== false ) { 204 $authordata = get_userdata($post->post_author); 205 $author = $authordata->user_nicename; 203 if ( false !== strpos( $permalink, '%author%' ) ) { 204 $authordata = get_userdata( $post->post_author ); 205 if ( is_a( $authordata, 'WP_User' ) ) { 206 $author = $authordata->user_nicename; 207 } 206 208 } 207 209 208 210 $date = explode(" ",date('Y m d H i s', $unixtime));