Changes from branches/2.7/wp-includes/link-template.php at r10425 to trunk/wp-includes/link-template.php at r10150
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/link-template.php
r10425 r10150 93 93 ); 94 94 95 if ( is_object($id) && isset($id->filter) && 'sample' == $id->filter ) 96 $post = $id; 97 else 98 $post = &get_post($id); 95 $post = &get_post($id); 99 96 100 97 if ( empty($post->ID) ) return false; … … 726 723 } 727 724 728 $link = '<a class="post-edit-link"href="' . get_edit_post_link( $post->ID ) . '" title="' . attribute_escape( __( 'Edit post' ) ) . '">' . $link . '</a>';725 $link = '<a href="' . get_edit_post_link( $post->ID ) . '" title="' . attribute_escape( __( 'Edit post' ) ) . '">' . $link . '</a>'; 729 726 echo $before . apply_filters( 'edit_post_link', $link, $post->ID ) . $after; 730 727 } … … 776 773 } 777 774 778 $link = '<a class="comment-edit-link"href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>';775 $link = '<a href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>'; 779 776 echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after; 780 777 } … … 1246 1243 1247 1244 /** 1248 * Return thelink to next comments pages.1249 * 1250 * @since 2.7. 11245 * Display link to next comments pages. 1246 * 1247 * @since 2.7.0 1251 1248 * 1252 1249 * @param string $label Optional. Label for link text. 1253 1250 * @param int $max_page Optional. Max page. 1254 * @return string|null 1255 */ 1256 function get_next_comments_link( $label = '', $max_page = 0 ) { 1251 */ 1252 function next_comments_link($label='', $max_page = 0) { 1257 1253 global $wp_query; 1258 1254 … … 1262 1258 $page = get_query_var('cpage'); 1263 1259 1260 if ( !$page ) 1261 $page = 1; 1262 1264 1263 $nextpage = intval($page) + 1; 1265 1264 … … 1276 1275 $label = __('Newer Comments »'); 1277 1276 1278 return '<a href="' . clean_url( get_comments_pagenum_link( $nextpage, $max_page ) ) . '" ' . apply_filters( 'next_comments_link_attributes', '' ) . '>'. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>'; 1279 } 1280 1281 /** 1282 * Display the link to next comments pages. 1277 echo '<a href="' . clean_url( get_comments_pagenum_link( $nextpage, $max_page ) ); 1278 $attr = apply_filters( 'next_comments_link_attributes', '' ); 1279 echo "\" $attr>". preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>'; 1280 } 1281 1282 /** 1283 * Display the previous comments page link. 1283 1284 * 1284 1285 * @since 2.7.0 1285 1286 * 1286 * @param string $label Optional. Label for link text.1287 * @param int $max_page Optional. Max page.1288 */1289 function next_comments_link( $label = '', $max_page = 0 ) {1290 echo get_next_comments_link( $label, $max_page );1291 }1292 1293 /**1294 * Return the previous comments page link.1295 *1296 * @since 2.7.11297 *1298 1287 * @param string $label Optional. Label for comments link text. 1299 * @return string|null1300 */ 1301 function get_previous_comments_link( $label = '' ) { 1288 */ 1289 function previous_comments_link($label='') { 1290 1302 1291 if ( !is_singular() ) 1303 1292 return; … … 1305 1294 $page = get_query_var('cpage'); 1306 1295 1307 if ( intval($page) <= 1 ) 1296 if ( !$page ) 1297 $page = 1; 1298 1299 if ( $page <= 1 ) 1308 1300 return; 1309 1301 … … 1313 1305 $label = __('« Older Comments'); 1314 1306 1315 return '<a href="' . clean_url( get_comments_pagenum_link( $prevpage ) ) . '" ' . apply_filters( 'previous_comments_link_attributes', '' ) . '>' . preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>'; 1316 } 1317 1318 /** 1319 * Display the previous comments page link. 1320 * 1321 * @since 2.7.0 1322 * 1323 * @param string $label Optional. Label for comments link text. 1324 */ 1325 function previous_comments_link( $label = '' ) { 1326 echo get_previous_comments_link( $label ); 1307 echo '<a href="' . clean_url(get_comments_pagenum_link($prevpage)); 1308 $attr = apply_filters( 'previous_comments_link_attributes', '' ); 1309 echo "\" $attr>". preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>'; 1327 1310 } 1328 1311 … … 1355 1338 ); 1356 1339 if ( $wp_rewrite->using_permalinks() ) 1357 $defaults['base'] = user_trailingslashit( trailingslashit(get_permalink()) . 'comment-page-%#%', 'commentpaged');1340 $defaults['base'] = user_trailingslashit(get_permalink() . 'comment-page-%#%', 'commentpaged'); 1358 1341 1359 1342 $args = wp_parse_args( $args, $defaults );
Note: See TracChangeset
for help on using the changeset viewer.