WordPress.org

Make WordPress Core

Changeset 5340


Ignore:
Timestamp:
04/28/2007 04:45:47 PM (15 years ago)
Author:
ryan
Message:

Fix edit comment links

File:
1 edited

Legend:

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

    r5328 r5340  
    278278    $post = &get_post( $id );
    279279   
    280     if ( $post->post_type == 'attachment' )
     280    if ( $post->post_type == 'attachment' ) {
    281281        return;
    282     elseif ( $post->post_type == 'page' ) {
     282    } elseif ( $post->post_type == 'page' ) {
    283283        if ( !current_user_can( 'edit_page', $post->ID ) )
    284284            return;
     
    298298    global $post;
    299299
    300     if ( $post->post_type == 'attachment' )
     300    if ( $post->post_type == 'attachment' ) {
    301301        return;
    302     elseif ( $post->post_type == 'page' ) {
     302    } elseif ( $post->post_type == 'page' ) {
    303303        if ( !current_user_can( 'edit_page', $post->ID ) )
    304304            return;
     
    320320    $post = &get_post( $comment->comment_post_ID );
    321321   
    322     if ( $post->post_type == 'attachment' )
     322    if ( $post->post_type == 'attachment' ) {
    323323        return;
    324     elseif ( $post->post_type == 'page' )
     324    } elseif ( $post->post_type == 'page' ) {
    325325        if ( !current_user_can( 'edit_page', $post->ID ) )
    326326            return;
    327     else
     327    } else {
    328328        if ( !current_user_can( 'edit_post', $post->ID ) )
    329329            return;
    330    
     330    }
     331
    331332    $location = get_bloginfo( 'wpurl' ) . '/wp-admin/comment.php?action=editcomment&c=' . $comment->comment_ID;
    332333    return apply_filters( 'get_edit_comment_link', $location );
     
    336337    global $comment, $post;
    337338
    338     if ( $post->post_type == 'attachment' )
     339    if ( $post->post_type == 'attachment' ) {
    339340        return;
    340     elseif ( $post->post_type == 'page' )
     341    } elseif ( $post->post_type == 'page' ) {
    341342        if ( !current_user_can( 'edit_page', $post->ID ) )
    342343            return;
    343     else
     344    } else {
    344345        if ( !current_user_can( 'edit_post', $post->ID ) )
    345346            return;
     347    }
    346348
    347349    $link = '<a href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>';
Note: See TracChangeset for help on using the changeset viewer.