get_comment_text()
apply_filters( ‘get_comment_text’, string $comment_cont…
apply_filters( ‘get_comment_text’, string $comment_content, WP_Comment $comment, array $args )
过滤器::过滤注释的文本。
Filter Hook: Filters the text of a comment.
过滤器::过滤注释的文本。
Filter Hook: Filters the text of a comment.
目录锚点:#说明#参数#源码
说明(Description)
另见函数 Walker_Comment::comment()()
参数(Parameters)
| 参数 | 类型 | 说明 |
|---|---|---|
| $comment_content | (string) | 评论的文本。 |
| $comment | (WP_Comment) | 注释对象。 |
| $args | (array) | 一组参数。 |
源码(Source)
/**
* Retrieve the text of the current comment.
*
* @since 1.5.0
*
* @see Walker_Comment::comment()
*
* @param int $comment_ID ID of the comment for which to get the text. Default current comment.
* @param array $args Optional. An array of arguments. Default empty.
* @return string The comment content.
*/
function get_comment_text( $comment_ID = 0, $args = array() ) {
$comment = get_comment( $comment_ID );
/**
* Filter the text of a comment.
*
* @since 1.5.0
*
* @see Walker_Comment::comment()
*
* @param string $comment_content Text of the comment.
* @param object $comment The comment object.
* @param array $args An array of arguments.
*/
return apply_filters( 'get_comment_text', $comment->comment_content, $comment, $args );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 1.5.0 | wp-includes/comment-template.php:992 | 1 | 0 |
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

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