Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_update_comment_data

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
2186       *
2187       * Note: data being passed to the filter is already unslashed.
2188       *
2189       * @since 4.7.0
2190       *
2191       * @param array $data       The new, processed comment data.
2192       * @param array $comment    The old, unslashed comment data.
2193       * @param array $commentarr The new, raw comment data.
2194       */
2195      $data = apply_filters( 'wp_update_comment_data', $data, $comment, $commentarr );
2196
2197      $keys = array( 'comment_post_ID', 'comment_content', 'comment_author', 'comment_author_email', 'comment_approved', 'comment_karma', 'comment_author_url', 'comment_date', 'comment_date_gmt', 'comment_type', 'comment_parent', 'user_id', 'comment_agent', 'comment_author_IP' );
2198      $data = wp_array_slice_assoc( $data, $keys );
2199
2200      $rval = $wpdb->update( $wpdb->comments, $data, compact( 'comment_ID' ) );
2201
2202      clean_comment_cache( $comment_ID );
2203      wp_update_comment_count( $comment_post_ID );
2204      /**