描述
另见
参数
- $args
-
(array)(可选) 替代默认选项。
默认值: array()
- $comment
-
(int|WP_Comment)(可选) 正在回复的评论。默认当前评论。
默认值: null
- $post
-
(int|WP_Post)(可选) 评论将在其上显示的文章 ID或WP_Post对象。默认当前文章。
默认值: null
源码
更新日志
版本 | 描述 |
---|---|
2.7.0 | 开始引入 |
使用示例
<?php comment_reply_link( array_merge($args, array( 'reply_text' => __('Responder <span>↓</span>', 'textdomain'), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) )); ?>
使用以下代码替换回复链接上的类。
function wpdocs_comment_reply_link_class( $class ) { $class = str_replace( "class='comment-reply-link", "class='comment-reply-link your-class-name", $class ); return $class; } add_filter( 'comment_reply_link', 'wpdocs_comment_reply_link_class' );
用法
<?php comment_reply_link( $args, $comment, $post ); ?>