Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/comment.php

    r13420 r17232  
    1010 * {@internal Missing Short Description}}
    1111 *
    12  * @since unknown
     12 * @since 2.0.0
    1313 * @uses $wpdb
    1414 *
    15  * @param string $comment_author
    16  * @param string $comment_date
     15 * @param string $comment_author Author of the comment
     16 * @param string $comment_date Date of the comment
    1717 * @return mixed Comment ID on success.
    1818 */
     
    2828
    2929/**
    30  * {@internal Missing Short Description}}
     30 * Update a comment with values provided in $_POST.
    3131 *
    32  * @since unknown
     32 * @since 2.0.0
    3333 */
    3434function edit_comment() {
    3535
    36     $comment_post_ID = (int) $_POST['comment_post_ID'];
    37 
    38     if (!current_user_can( 'edit_post', $comment_post_ID ))
    39         wp_die( __('You are not allowed to edit comments on this post, so you cannot edit this comment.' ));
     36    if ( ! current_user_can( 'edit_comment', (int) $_POST['comment_ID'] ) )
     37        wp_die ( __( 'You are not allowed to edit comments on this post.' ) );
    4038
    4139    $_POST['comment_author'] = $_POST['newcomment_author'];
     
    5351    }
    5452
    55     if (!empty ( $_POST['edit_date'] ) ) {
     53    if ( !empty ( $_POST['edit_date'] ) ) {
    5654        $aa = $_POST['aa'];
    5755        $mm = $_POST['mm'];
     
    6765    }
    6866
    69     wp_update_comment( $_POST);
     67    wp_update_comment( $_POST );
    7068}
    7169
     
    7371 * {@internal Missing Short Description}}
    7472 *
    75  * @since unknown
     73 * @since 2.0.0
    7674 *
    77  * @param unknown_type $id
    78  * @return unknown
     75 * @param int $id ID of comment to retrieve
     76 * @return bool|object Comment if found. False on failure.
    7977 */
    8078function get_comment_to_edit( $id ) {
     
    9997 * Get the number of pending comments on a post or posts
    10098 *
    101  * @since unknown
     99 * @since 2.3.0
    102100 * @uses $wpdb
    103101 *
     
    159157        wp_enqueue_script( 'jquery-table-hotkeys' );
    160158}
    161 
    162 if ( is_admin() && isset($pagenow) && ('edit-comments.php' == $pagenow || 'edit.php' == $pagenow) ) {
    163     if ( get_option('show_avatars') )
    164         add_filter( 'comment_author', 'floated_admin_avatar' );
    165 }
    166 
    167159?>
Note: See TracChangeset for help on using the changeset viewer.