Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r10425 r10150  
    9393        );
    9494
    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);
    9996
    10097        if ( empty($post->ID) ) return false;
    … …  
    726723        }
    727724
    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>';
    729726        echo $before . apply_filters( 'edit_post_link', $link, $post->ID ) . $after;
    730727}
    … …  
    776773        }
    777774
    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>';
    779776        echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after;
    780777}
    … …  
    12461243
    12471244/**
    1248  * Return the link to next comments pages.
    1249  *
    1250  * @since 2.7.1
     1245 * Display link to next comments pages.
     1246 *
     1247 * @since 2.7.0
    12511248 *
    12521249 * @param string $label Optional. Label for link text.
    12531250 * @param int $max_page Optional. Max page.
    1254  * @return string|null
    1255  */
    1256 function get_next_comments_link( $label = '', $max_page = 0 ) {
     1251 */
     1252function next_comments_link($label='', $max_page = 0) {
    12571253        global $wp_query;
    12581254
    … …  
    12621258        $page = get_query_var('cpage');
    12631259
     1260        if ( !$page )
     1261                $page = 1;
     1262
    12641263        $nextpage = intval($page) + 1;
    12651264
    … …  
    12761275                $label = __('Newer Comments &raquo;');
    12771276
    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.
     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.
    12831284 *
    12841285 * @since 2.7.0
    12851286 *
    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  *
    12981287 * @param string $label Optional. Label for comments link text.
    1299  * @return string|null
    1300  */
    1301 function get_previous_comments_link( $label = '' ) {
     1288 */
     1289function previous_comments_link($label='') {
     1290
    13021291        if ( !is_singular() )
    13031292                return;
    … …  
    13051294        $page = get_query_var('cpage');
    13061295
    1307         if ( intval($page) <= 1 )
     1296        if ( !$page )
     1297                $page = 1;
     1298
     1299        if ( $page <= 1 )
    13081300                return;
    13091301
    … …  
    13131305                $label = __('&laquo; Older Comments');
    13141306
    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  */
    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};)/', '&#038;$1', $label) .'</a>';
    13271310}
    13281311
    … …  
    13551338        );
    13561339        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');
    13581341
    13591342        $args = wp_parse_args( $args, $defaults );
Note: See TracChangeset for help on using the changeset viewer.