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.1

apply_filters('comment_text') is found 4 times:

  • /wp-includes/blocks/comment-content.php line 37
    		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
    	 * @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
    		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
     
    		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: