WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/07/2010 11:35:28 PM (10 years ago)
Author:
scribu
Message:

Introduce 'edit_comment' meta cap. Fixes #14520

File:
1 edited

Legend:

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

    r15590 r15596  
    876876function get_edit_comment_link( $comment_id = 0 ) {
    877877    $comment = &get_comment( $comment_id );
    878     $post = &get_post( $comment->comment_post_ID );
    879 
    880     if ( $post->post_type == 'page' ) {
    881         if ( !current_user_can( 'edit_page', $post->ID ) )
    882             return;
    883     } else {
    884         if ( !current_user_can( 'edit_post', $post->ID ) )
    885             return;
    886     }
     878
     879    if ( !current_user_can( 'edit_comment', $comment->comment_ID ) )
     880        return;
    887881
    888882    $location = admin_url('comment.php?action=editcomment&c=') . $comment->comment_ID;
     
    901895 */
    902896function edit_comment_link( $link = null, $before = '', $after = '' ) {
    903     global $comment, $post;
    904 
    905     if ( $post->post_type == 'page' ) {
    906         if ( !current_user_can( 'edit_page', $post->ID ) )
    907             return;
    908     } else {
    909         if ( !current_user_can( 'edit_post', $post->ID ) )
    910             return;
    911     }
     897    global $comment;
     898
     899    if ( !current_user_can( 'edit_comment', $comment->comment_ID ) )
     900        return;
    912901
    913902    if ( null === $link )
Note: See TracChangeset for help on using the changeset viewer.