Warning: Trying to access array offset on false in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 216
comment_reply_link() - 显示回复评论链接的HTML内容 - WordPress函数 - WordPress动力
当前浏览:首页 / WordPress函数 / comment_reply_link()

comment_reply_link( array $args = array(), int|WP_Comment $comment = null, int|WP_Post $post = null )

显示回复评论链接的HTML内容


Warning: Undefined array key -1 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 185

Warning: Undefined array key 3 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 186

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "8a120dc4a793b62501729a9a51316687" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "3743f043ec003c5dec15b1f60f641527" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "ee03a7a6327035fdc5d83a8f5dcc88b9" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

comment 评论more...

linkmore...

reply


描述

另见


参数

$args

(array)(可选) 替代默认选项。

默认值: array()

$comment

(int|WP_Comment)(可选) 正在回复的评论。默认当前评论。

默认值: null

$post

(int|WP_Post)(可选) 评论将在其上显示的文章 ID或WP_Post对象。默认当前文章。

默认值: null



源码

查看源码 官方文档


更新日志

版本描述
2.7.0开始引入

使用示例

  • 示例1
    <?php comment_reply_link( array_merge($args, array(
        'reply_text' => __('Responder <span>&darr;</span>', 'textdomain'),
        'depth'      => $depth,
        'max_depth'  => $args['max_depth']
        )
    )); ?>
  • 示例2

    使用以下代码替换回复链接上的类。

    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' );
    
  • 示例3

    用法

    <?php comment_reply_link( $args, $comment, $post ); ?>