WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/comment excerpt

Contents

Description

Displays an excerpt (maximum of 20 words) of a comment's text.

Use get_comment_excerpt() to retrieve the value.

Usage

 <?php comment_excerpt$comment_ID ); ?> 

Example

<p>Latest comment: <?php comment_excerpt(); ?></p>

Parameters

comment_ID
(integer) (optional) The ID of the comment for which to print the excerpt.
Default: 0 (the current comment)

Filters

apply_filters() Calls 'comment_excerpt' hook before displaying excerpt

Changelog

  •  ? : Added the 'comment_ID' parameter.
  • Since: 1.2.0

Source File

comment_excerpt() is located in wp-includes/comment-template.php

Related

Comments Functions

See also index of Function Reference and index of Template Tags.