Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.7/wp-includes/link-template.php

    r10150 r10425  
    9393    );
    9494
    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);
    9699
    97100    if ( empty($post->ID) ) return false;
     
    723726    }
    724727
    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>';
    726729    echo $before . apply_filters( 'edit_post_link', $link, $post->ID ) . $after;
    727730}
     
    773776    }
    774777
    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>';
    776779    echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after;
    777780}
     
    12431246
    12441247/**
    1245  * Display link to next comments pages.
    1246  *
    1247  * @since 2.7.0
     1248 * Return the link to next comments pages.
     1249 *
     1250 * @since 2.7.1
    12481251 *
    12491252 * @param string $label Optional. Label for link text.
    12501253 * @param int $max_page Optional. Max page.
    1251  */
    1252 function next_comments_link($label='', $max_page = 0) {
     1254 * @return string|null
     1255 */
     1256function get_next_comments_link( $label = '', $max_page = 0 ) {
    12531257    global $wp_query;
    12541258
     
    12581262    $page = get_query_var('cpage');
    12591263
    1260     if ( !$page )
    1261         $page = 1;
    1262 
    12631264    $nextpage = intval($page) + 1;
    12641265
     
    12751276        $label = __('Newer Comments &raquo;');
    12761277
    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};)/', '&#038;$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};)/', '&#038;$1', $label) .'</a>';
     1279}
     1280
     1281/**
     1282 * Display the link to next comments pages.
    12841283 *
    12851284 * @since 2.7.0
    12861285 *
     1286 * @param string $label Optional. Label for link text.
     1287 * @param int $max_page Optional. Max page.
     1288 */
     1289function 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 *
    12871298 * @param string $label Optional. Label for comments link text.
    1288  */
    1289 function previous_comments_link($label='') {
    1290 
     1299 * @return string|null
     1300 */
     1301function get_previous_comments_link( $label = '' ) {
    12911302    if ( !is_singular() )
    12921303        return;
     
    12941305    $page = get_query_var('cpage');
    12951306
    1296     if ( !$page )
    1297         $page = 1;
    1298 
    1299     if ( $page <= 1 )
     1307    if ( intval($page) <= 1 )
    13001308        return;
    13011309
     
    13051313        $label = __('&laquo; Older Comments');
    13061314
    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};)/', '&#038;$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};)/', '&#038;$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 */
     1325function previous_comments_link( $label = '' ) {
     1326    echo get_previous_comments_link( $label );
    13101327}
    13111328
     
    13381355    );
    13391356    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');
    13411358
    13421359    $args = wp_parse_args( $args, $defaults );
Note: See TracChangeset for help on using the changeset viewer.