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