Make WordPress Core

Ticket #9899: 9899.diff

File 9899.diff, 879 bytes (added by coffee2code, 16 years ago)

Patch as mentioned in original submission.

  • wp-includes/link-template.php

     
    724724        if ( !$post = &get_post( $id ) )
    725725                return;
    726726
    727         if ( $post->post_type == 'page' ) {
    728                 if ( !current_user_can( 'edit_page', $post->ID ) )
    729                         return;
    730         } else {
    731                 if ( !current_user_can( 'edit_post', $post->ID ) )
    732                         return;
    733         }
     727        if ( !$url = get_edit_post_link( $post->ID ) )
     728                return;
    734729
    735         $link = '<a class="post-edit-link" href="' . get_edit_post_link( $post->ID ) . '" title="' . esc_attr( __( 'Edit post' ) ) . '">' . $link . '</a>';
     730        $link = '<a class="post-edit-link" href="' . $url . '" title="' . esc_attr( __( 'Edit post' ) ) . '">' . $link . '</a>';
    736731        echo $before . apply_filters( 'edit_post_link', $link, $post->ID ) . $after;
    737732}
    738733