Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r17232 r13420  
    1010 * {@internal Missing Short Description}}
    1111 *
    12  * @since 2.0.0
     12 * @since unknown
    1313 * @uses $wpdb
    1414 *
    15  * @param string $comment_author Author of the comment
    16  * @param string $comment_date Date of the comment
     15 * @param string $comment_author
     16 * @param string $comment_date
    1717 * @return mixed Comment ID on success.
    1818 */
     
    2828
    2929/**
    30  * Update a comment with values provided in $_POST.
     30 * {@internal Missing Short Description}}
    3131 *
    32  * @since 2.0.0
     32 * @since unknown
    3333 */
    3434function edit_comment() {
    3535
    36     if ( ! current_user_can( 'edit_comment', (int) $_POST['comment_ID'] ) )
    37         wp_die ( __( 'You are not allowed to edit comments on this post.' ) );
     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.' ));
    3840
    3941    $_POST['comment_author'] = $_POST['newcomment_author'];
     
    5153    }
    5254
    53     if ( !empty ( $_POST['edit_date'] ) ) {
     55    if (!empty ( $_POST['edit_date'] ) ) {
    5456        $aa = $_POST['aa'];
    5557        $mm = $_POST['mm'];
     
    6567    }
    6668
    67     wp_update_comment( $_POST );
     69    wp_update_comment( $_POST);
    6870}
    6971
     
    7173 * {@internal Missing Short Description}}
    7274 *
    73  * @since 2.0.0
     75 * @since unknown
    7476 *
    75  * @param int $id ID of comment to retrieve
    76  * @return bool|object Comment if found. False on failure.
     77 * @param unknown_type $id
     78 * @return unknown
    7779 */
    7880function get_comment_to_edit( $id ) {
     
    9799 * Get the number of pending comments on a post or posts
    98100 *
    99  * @since 2.3.0
     101 * @since unknown
    100102 * @uses $wpdb
    101103 *
     
    157159        wp_enqueue_script( 'jquery-table-hotkeys' );
    158160}
     161
     162if ( 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
    159167?>
Note: See TracChangeset for help on using the changeset viewer.