comment_text

comment_text

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('comment_text') is found 4 times:

  • /wp-includes/blocks/comment-content.php line 37
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
        return '';
    }
     
    /** This filter is documented in wp-includes/comment-template.php */
    $comment_text = apply_filters( 'comment_text', $comment_text, $comment, $args );
     
    $moderation_note = '';
    if ( '0' === $comment->comment_approved ) {
        $commenter = wp_get_current_commenter();
     
        if ( $commenter['comment_author_email'] ) {
  • /wp-includes/comment-template.php line 1094
    1090
    1091
    1092
    1093
    1094
    1095
    1096
    1097
    1098
    1099
    1100
         * @param string          $comment_text Text of the comment.
         * @param WP_Comment|null $comment      The comment object. Null if not found.
         * @param array           $args         An array of arguments.
         */
        echo apply_filters( 'comment_text', $comment_text, $comment, $args );
    }
     
    /**
     * Retrieves the comment time of the current comment.
     *
     * @since 1.5.0
  • /wp-includes/comment.php line 48
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
        return false;
    }
     
    /** This filter is documented in wp-includes/comment-template.php */
    $comment = apply_filters( 'comment_text', $comment, null, array() );
     
    // Check for the number of external links if a max allowed number is set.
    $max_links = get_option( 'comment_max_links' );
    if ( $max_links ) {
        $num_links = preg_match_all( '/<a &#91;^>]*href/i', $comment, $out );
  • /wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php line 1094
    1091
    1092
    1093
    1094
    1095
    1096
    1097
    1098
    1099
    1100
    if ( in_array( 'content', $fields, true ) ) {
        $data['content'] = array(
            /** This filter is documented in wp-includes/comment-template.php */
            'rendered' => apply_filters( 'comment_text', $comment->comment_content, $comment, array() ),
            'raw'      => $comment->comment_content,
        );
    }
     
    if ( in_array( 'link', $fields, true ) ) {
        $data['link'] = get_comment_link( $comment );

See this hook used in plugins: