Changeset 5019
- Timestamp:
- 03/10/2007 06:18:43 AM (18 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/category-template.php
r4953 r5019 36 36 37 37 $catlink = str_replace('%category%', $category_nicename, $catlink); 38 $catlink = get_option('home') . user_trailingslashit($catlink );38 $catlink = get_option('home') . user_trailingslashit($catlink, 'category'); 39 39 } 40 40 return apply_filters('category_link', $catlink, $category_id); -
trunk/wp-includes/comment-template.php
r4990 r5019 227 227 228 228 if ( '' != get_option('permalink_structure') ) 229 $tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback' );229 $tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback'); 230 230 231 231 return $tb_url; -
trunk/wp-includes/feed.php
r4990 r5019 114 114 } else { 115 115 $link = get_author_posts_url($author_id, $author_nicename); 116 $link = $link . user_trailingslashit('feed' );116 $link = $link . user_trailingslashit('feed', 'feed'); 117 117 } 118 118 … … 132 132 } else { 133 133 $link = get_category_link($cat_ID); 134 $link = $link . user_trailingslashit('feed /');134 $link = $link . user_trailingslashit('feed', 'feed'); 135 135 } 136 136 -
trunk/wp-includes/link-template.php
r4990 r5019 17 17 * @global object Uses $wp_rewrite 18 18 * @param $string string a URL with or without a trailing slash 19 * @param $type_of_url string the type of URL being considered (e.g. single, category, etc) for use in the filter 19 20 * @return string 20 21 */ 21 function user_trailingslashit($string ) {22 function user_trailingslashit($string, $type_of_url = '') { 22 23 global $wp_rewrite; 23 24 if ( $wp_rewrite->use_trailing_slashes ) 24 25 $string = trailingslashit($string); 25 26 else 26 $string = preg_replace('|/$|', '', $string); // untrailing slash 27 $string = preg_replace('|/+$|', '', $string); // untrailing slash 28 29 // Note that $type_of_url can be one of following: 30 // single, single_trackback, single_feed, single_paged, feed, category, page, year, month, day, paged 31 $string = apply_filters('user_trailingslashit', $string, $type_of_url); 27 32 return $string; 28 33 } … … 95 100 $post->post_name, 96 101 ); 97 return apply_filters('post_link', get_option('home') . str_replace($rewritecode, $rewritereplace, $permalink), $post); 102 $permalink = get_option('home') . str_replace($rewritecode, $rewritereplace, $permalink); 103 $permalink = user_trailingslashit($permalink, 'single'); 104 return apply_filters('post_link', $permalink, $post); 98 105 } else { // if they're not using the fancy permalink option 99 106 $permalink = get_option('home') . '/?p=' . $post->ID; … … 135 142 $link = str_replace('%pagename%', $link, $pagestruct); 136 143 $link = get_option('home') . "/$link"; 137 $link = user_trailingslashit($link );144 $link = user_trailingslashit($link, 'page'); 138 145 } else { 139 146 $link = get_option('home') . "/?page_id=$id"; … … 177 184 if ( !empty($yearlink) ) { 178 185 $yearlink = str_replace('%year%', $year, $yearlink); 179 return apply_filters('year_link', get_option('home') . user_trailingslashit($yearlink ), $year);186 return apply_filters('year_link', get_option('home') . user_trailingslashit($yearlink, 'year'), $year); 180 187 } else { 181 188 return apply_filters('year_link', get_option('home') . '/?m=' . $year, $year); … … 193 200 $monthlink = str_replace('%year%', $year, $monthlink); 194 201 $monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink); 195 return apply_filters('month_link', get_option('home') . user_trailingslashit($monthlink ), $year, $month);202 return apply_filters('month_link', get_option('home') . user_trailingslashit($monthlink, 'month'), $year, $month); 196 203 } else { 197 204 return apply_filters('month_link', get_option('home') . '/?m=' . $year . zeroise($month, 2), $year, $month); … … 213 220 $daylink = str_replace('%monthnum%', zeroise(intval($month), 2), $daylink); 214 221 $daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink); 215 return apply_filters('day_link', get_option('home') . user_trailingslashit($daylink ), $year, $month, $day);222 return apply_filters('day_link', get_option('home') . user_trailingslashit($daylink, 'day'), $year, $month, $day); 216 223 } else { 217 224 return apply_filters('day_link', get_option('home') . '/?m=' . $year . zeroise($month, 2) . zeroise($day, 2), $year, $month, $day); … … 237 244 $permalink = str_replace('%feed%', $feed, $permalink); 238 245 $permalink = preg_replace('#/+#', '/', "/$permalink"); 239 $output = get_option('home') . user_trailingslashit($permalink );246 $output = get_option('home') . user_trailingslashit($permalink, 'feed'); 240 247 } else { 241 248 if ( false !== strpos($feed, 'comments_') ) … … 258 265 if ( 'rss2' != $feed ) 259 266 $url .= "/$feed"; 260 $url = user_trailingslashit($url );267 $url = user_trailingslashit($url, 'single_feed'); 261 268 } else { 262 269 $url = get_option('home') . "/?feed=$feed&p=$id"; … … 472 479 $qstr = preg_replace('|^/+|', '', $qstr); 473 480 if ( $permalink ) 474 $qstr = user_trailingslashit($qstr );481 $qstr = user_trailingslashit($qstr, 'paged'); 475 482 $qstr = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', trailingslashit( get_option('home') ) . $qstr ); 476 483 477 484 // showing /page/1/ or ?paged=1 is redundant 478 485 if ( 1 === $pagenum ) { 479 $qstr = str_replace(user_trailingslashit('index.php/page/1' ), '', $qstr); // for PATHINFO style480 $qstr = str_replace(user_trailingslashit('page/1' ), '', $qstr); // for mod_rewrite style486 $qstr = str_replace(user_trailingslashit('index.php/page/1', 'paged'), '', $qstr); // for PATHINFO style 487 $qstr = str_replace(user_trailingslashit('page/1', 'paged'), '', $qstr); // for mod_rewrite style 481 488 $qstr = remove_query_arg('paged', $qstr); // for query style 482 489 } -
trunk/wp-includes/post-template.php
r5018 r5019 162 162 $output .= '<a href="' . get_permalink() . '&page=' . $i . '">'; 163 163 else 164 $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i ) . '">';164 $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">'; 165 165 } 166 166 } … … 181 181 $output .= '<a href="' . get_permalink() . '&page=' . $i . '">' . $previouspagelink . '</a>'; 182 182 else 183 $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i ) . '">' . $previouspagelink . '</a>';183 $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">' . $previouspagelink . '</a>'; 184 184 } 185 185 } … … 192 192 $output .= '<a href="' . get_permalink() . '&page=' . $i . '">' . $nextpagelink . '</a>'; 193 193 else 194 $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i ) . '">' . $nextpagelink . '</a>';194 $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">' . $nextpagelink . '</a>'; 195 195 } 196 196 }
Note: See TracChangeset
for help on using the changeset viewer.