钩子文档

wp_comment_reply

💡 云策文档标注

概述

wp_comment_reply 是一个 WordPress 过滤器,用于控制评论列表表格中的内联回复表单输出。开发者可以通过此过滤器自定义或替换表单内容。

关键要点

  • 过滤器名称:wp_comment_reply,用于过滤评论列表中的内联回复表单输出。
  • 功能:返回非空值将短路默认表单显示,直接输出返回值。
  • 参数:$content(字符串,表单内容)和 $args(数组,默认参数)。
  • 相关函数:wp_comment_reply() 用于输出表单。
  • 版本历史:自 WordPress 2.7.0 引入。

代码示例

$content = apply_filters(
    'wp_comment_reply',
    '',
    array(
        'position' => $position,
        'checkbox' => $checkbox,
        'mode'     => $mode,
    )
);

📄 原文内容

Filters the in-line comment reply-to form output in the Comments list table.

Description

Returning a non-empty value here will short-circuit display of the in-line comment-reply form in the Comments list table, echoing the returned value instead.

See also

Parameters

$contentstring
The reply-to form content.
$argsarray
An array of default args.

Source

$content = apply_filters(
	'wp_comment_reply',
	'',
	array(
		'position' => $position,
		'checkbox' => $checkbox,
		'mode'     => $mode,
	)
);

Changelog

Version Description
2.7.0 Introduced.