Source View: wp_anonymize_comment

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.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: 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.

Source View

Line Code
3331            * Filters whether to anonymize the comment.
3332            *
3333            * @since 4.9.6
3334            *
3335            * @param bool|string                    Whether to apply the comment anonymization (bool).
3336            *                                       Custom prevention message (string). Default true.
3337            * @param WP_Comment $comment            WP_Comment object.
3338            * @param array      $anonymized_comment Anonymized comment data.
3339            */
3340           $anon_message = apply_filters( 'wp_anonymize_comment', true, $comment, $anonymized_comment );
3341
3342           if ( true !== $anon_message ) {
3343                if ( $anon_message && is_string( $anon_message ) ) {
3344                     $messages[] = esc_html( $anon_message );
3345                } else {
3346                     /* translators: %d: Comment ID */
3347                     $messages[] = sprintf( __( 'Comment %d contains personal data but could not be anonymized.' ), $comment_id );
3348                }
3349