Changeset 6955 for trunk/wp-includes/link-template.php
- Timestamp:
- 02/21/2008 08:19:34 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/link-template.php
r6777 r6955 64 64 65 65 if ( $post->post_type == 'page' ) 66 return get_page_link($post->ID );66 return get_page_link($post->ID, $leavename); 67 67 elseif ($post->post_type == 'attachment') 68 68 return get_attachment_link($post->ID); … … 119 119 120 120 // Respects page_on_front. Use this one. 121 function get_page_link($id = false ) {121 function get_page_link($id = false, $leavename = false) { 122 122 global $post; 123 123 … … 129 129 $link = get_option('home'); 130 130 else 131 $link = _get_page_link( $id );131 $link = _get_page_link( $id , $leavename ); 132 132 133 133 return apply_filters('page_link', $link, $id); … … 135 135 136 136 // Ignores page_on_front. Internal use only. 137 function _get_page_link( $id = false ) {137 function _get_page_link( $id = false, $leavename = false ) { 138 138 global $post, $wp_rewrite; 139 139 … … 147 147 if ( '' != $pagestruct && isset($post->post_status) && 'draft' != $post->post_status ) { 148 148 $link = get_page_uri($id); 149 $link = str_replace('%pagename%', $link, $pagestruct);149 $link = ( $leavename ) ? $pagestruct : str_replace('%pagename%', $link, $pagestruct); 150 150 $link = get_option('home') . "/$link"; 151 151 $link = user_trailingslashit($link, 'page');
Note: See TracChangeset
for help on using the changeset viewer.