comment_text
apply_filters( ‘comment_text’, string $comment_text, WP…
apply_filters( ‘comment_text’, string $comment_text, WP_Comment|null $comment, array $args )
过滤器挂钩:过滤要显示的注释文本。
Filter Hook: Filters the text of a comment to be displayed.
过滤器挂钩:过滤要显示的注释文本。
Filter Hook: Filters the text of a comment to be displayed.
目录锚点:#说明#参数#源码#笔记
说明(Description)
另见
参数(Parameters)
| 参数 | 类型 | 说明 |
|---|---|---|
| $comment_text | (string) | 当前评论的文本。 |
| $comment | (WP_Comment | null) | 注释对象。 |
| $args | (array) | 一组参数。 |
源码(Source)
/**
* Display the text of the current comment.
*
* @since 0.71
*
* @see Walker_Comment::comment()
*
* @param int $comment_ID ID of the comment for which to print the text. Default 0.
* @param array $args Optional. An array of arguments. Default empty array. Default empty.
*/
function comment_text( $comment_ID = 0, $args = array() ) {
$comment = get_comment( $comment_ID );
$comment_text = get_comment_text( $comment_ID , $args );
/**
* Filter the text of a comment to be displayed.
*
* @since 1.2.0
*
* @see Walker_Comment::comment()
*
* @param string $comment_text Text of the current comment.
* @param object $comment The comment object.
* @param array $args An array of arguments.
*/
echo apply_filters( 'comment_text', $comment_text, $comment, $args );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 1.2.0 | wp-includes/comment-template.php:1022 | 3 | 0 |
笔记(Notes)
#24913(核心两处使用不同的注释文本过滤器)-WordPress Trac
从评论内容文本中删除rel=“nofollow”
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

还没有任何评论,赶紧来占个楼吧!