WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
2318 | * |
2319 | * Note: data being passed to the filter is already unslashed. |
2320 | * |
2321 | * @since 4.7.0 |
2322 | * |
2323 | * @param array $data The new, processed comment data. |
2324 | * @param array $comment The old, unslashed comment data. |
2325 | * @param array $commentarr The new, raw comment data. |
2326 | */ |
2327 | $data = apply_filters( 'wp_update_comment_data', $data, $comment, $commentarr ); |
2328 |
|
2329 | $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' ); |
2330 | $data = wp_array_slice_assoc( $data, $keys ); |
2331 |
|
2332 | $rval = $wpdb->update( $wpdb->comments, $data, compact( 'comment_ID' ) ); |
2333 |
|
2334 | // If metadata is provided, store it. |
2335 | if ( isset( $commentarr['comment_meta'] ) && is_array( $commentarr['comment_meta'] ) ) { |
2336 | foreach ( $commentarr['comment_meta'] as $meta_key => $meta_value ) { |