comment_text()
comment_text( int|WP_Comment $comment_ID, array $args =…
comment_text( int|WP_Comment $comment_ID, array $args = array() )
显示当前注释的文本。
Displays the text of the current comment.
目录锚点:#说明#参数#返回#源码#笔记
说明(Description)
另见
沃克注释::注释()
参数(Parameters)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| $comment_ID | (int | WP_Comment) | 必需 | WP_注释或要打印文本的注释的ID。默认当前注释。 |
| $args | (array) | 可选 | 一组参数。 |
返回(Return)
无返回值
源码(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 );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 4.4.0 | wp-includes/comment-template.php:1007 | 3 | 4 |
笔记(Notes)
基本示例
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。





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