comment_text

过滤器挂钩:过滤要显示的注释文本。

apply_filters( ‘comment_text’, string $comment_text , WP_Comment|null $comment , array $args )

说明(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.0wp-includes/comment-template.php:102230

笔记(Notes)

#24913(核心两处使用不同的注释文本过滤器)-WordPress Trac
从评论内容文本中删除rel=“nofollow”

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索