Ticket #32322: link-template.diff
File link-template.diff, 1.1 KB (added by , 10 years ago) |
---|
-
wp-includes/link-template.php
156 156 */ 157 157 $permalink = apply_filters( 'pre_post_link', $permalink, $post, $leavename ); 158 158 159 if ( '' != $permalink && !in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ) ) ) { 159 $statuses_which_should_shortlink = apply_filters( 'shortlink_post_statuses', array( 160 'draft', 161 'pending', 162 'auto-draft', 163 'future' 164 ) ); 165 $use_shortlink = '' === $permalink || in_array( $post->post_status, $statuses_which_should_shortlink ); 166 167 if ( $use_shortlink ) { 168 $permalink = home_url('?p=' . $post->ID); 169 } else { 160 170 $unixtime = strtotime($post->post_date); 161 171 162 172 $category = ''; … … 212 222 ); 213 223 $permalink = home_url( str_replace($rewritecode, $rewritereplace, $permalink) ); 214 224 $permalink = user_trailingslashit($permalink, 'single'); 215 } else { // if they're not using the fancy permalink option216 $permalink = home_url('?p=' . $post->ID);217 225 } 218 226 219 227 /**