Changeset 1908 for trunk/wp-includes/template-functions-links.php
- Timestamp:
- 12/03/2004 02:38:11 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/template-functions-links.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/template-functions-links.php
r1868 r1908 85 85 86 86 function get_page_link($id = false) { 87 global $post ;87 global $post, $wp_rewrite; 88 88 89 89 if (! $id) { … … 95 95 if ('' != $permalink) { 96 96 $link = get_page_uri($id); 97 if ( using_index_permalinks()) {97 if ($wp_rewrite->using_index_permalinks()) { 98 98 $link = 'index.php/' . $link; 99 99 } … … 107 107 108 108 function get_year_link($year) { 109 global $querystring_start, $querystring_equal;109 global $querystring_start, $querystring_equal, $wp_rewrite; 110 110 if (!$year) $year = gmdate('Y', time()+(get_settings('gmt_offset') * 3600)); 111 $yearlink = get_year_permastruct();111 $yearlink = $wp_rewrite->get_year_permastruct(); 112 112 if (!empty($yearlink)) { 113 113 $yearlink = str_replace('%year%', $year, $yearlink); 114 return get_settings('home') . $yearlink;114 return get_settings('home') . trailingslashit($yearlink); 115 115 } else { 116 116 return get_settings('home') .'/'. get_settings('blogfilename') .$querystring_start.'m'.$querystring_equal.$year; … … 119 119 120 120 function get_month_link($year, $month) { 121 global $querystring_start, $querystring_equal ;121 global $querystring_start, $querystring_equal, $wp_rewrite; 122 122 if (!$year) $year = gmdate('Y', time()+(get_settings('gmt_offset') * 3600)); 123 123 if (!$month) $month = gmdate('m', time()+(get_settings('gmt_offset') * 3600)); 124 $monthlink = get_month_permastruct();124 $monthlink = $wp_rewrite->get_month_permastruct(); 125 125 if (!empty($monthlink)) { 126 126 $monthlink = str_replace('%year%', $year, $monthlink); 127 127 $monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink); 128 return get_settings('home') . $monthlink;128 return get_settings('home') . trailingslashit($monthlink); 129 129 } else { 130 130 return get_settings('home') .'/'. get_settings('blogfilename') .$querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2); … … 133 133 134 134 function get_day_link($year, $month, $day) { 135 global $querystring_start, $querystring_equal ;135 global $querystring_start, $querystring_equal, $wp_rewrite; 136 136 if (!$year) $year = gmdate('Y', time()+(get_settings('gmt_offset') * 3600)); 137 137 if (!$month) $month = gmdate('m', time()+(get_settings('gmt_offset') * 3600)); 138 138 if (!$day) $day = gmdate('j', time()+(get_settings('gmt_offset') * 3600)); 139 139 140 $daylink = get_day_permastruct();140 $daylink = $wp_rewrite->get_day_permastruct(); 141 141 if (!empty($daylink)) { 142 142 $daylink = str_replace('%year%', $year, $daylink); 143 143 $daylink = str_replace('%monthnum%', zeroise(intval($month), 2), $daylink); 144 144 $daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink); 145 return get_settings('home') . $daylink;145 return get_settings('home') . trailingslashit($daylink); 146 146 } else { 147 147 return get_settings('home') .'/'. get_settings('blogfilename') .$querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2).zeroise($day, 2); … … 150 150 151 151 function get_feed_link($feed='rss2') { 152 global $wp_rewrite; 152 153 $do_perma = 0; 153 154 $feed_url = get_settings('siteurl'); … … 160 161 $index = 'index.php'; 161 162 $prefix = ''; 162 if ( using_index_permalinks()) {163 if ($wp_rewrite->using_index_permalinks()) { 163 164 $feed_url .= '/' . $index; 164 165 } … … 417 418 418 419 function get_pagenum_link($pagenum = 1){ 420 global $wp_rewrite; 421 419 422 $qstr = $_SERVER['REQUEST_URI']; 420 423 … … 454 457 455 458 // If it's not a path info permalink structure, trim the index. 456 if (! using_index_permalinks()) {459 if (! $wp_rewrite->using_index_permalinks()) { 457 460 $qstr = preg_replace("#/*" . $index . "/*#", '/', $qstr); 458 461 } else {
Note: See TracChangeset
for help on using the changeset viewer.