Changeset 4475
- Timestamp:
- 11/17/2006 08:00:11 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/link-template.php
r4457 r4475 90 90 } 91 91 92 // Respects page_on_front. Use this one. 92 93 function get_page_link($id = false) { 94 global $post; 95 96 if ( !$id ) 97 $id = $post->ID; 98 99 if ( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) 100 $link = get_option('home'); 101 else 102 $link = _get_page_link( $id ); 103 104 return apply_filters('page_link', $link, $id); 105 } 106 107 // Ignores page_on_front. Internal use only. 108 function _get_page_link( $id = false ) { 93 109 global $post, $wp_rewrite; 94 110 … … 106 122 } 107 123 108 if ( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) 109 $link = get_option('home'); 110 111 return apply_filters('page_link', $link, $id); 124 return apply_filters( '_get_page_link', $link, $id ); 112 125 } 113 126 … … 124 137 if ( $wp_rewrite->using_permalinks() && ($object->post_parent > 0) ) { 125 138 $parent = get_post($object->post_parent); 126 $parentlink = get_permalink($object->post_parent); 139 if ( 'page' == $parent->post_type ) 140 $parentlink = _get_page_link( $object->post_parent ); // Ignores page_on_front 141 else 142 $parentlink = get_permalink( $object->post_parent ); 127 143 if (! strstr($parentlink, '?') ) 128 144 $link = trim($parentlink, '/') . '/' . $object->post_name . '/';
Note: See TracChangeset
for help on using the changeset viewer.