钩子文档

manage_comments_custom_column

💡 云策文档标注

概述

manage_comments_custom_column 是一个 WordPress Hook,在评论管理列表的默认列输出显示时触发,允许开发者自定义列内容。

关键要点

  • 触发时机:当评论管理列表的默认列输出显示时
  • 参数:$column_name(自定义列名称)和 $comment_id(评论 ID 作为数字字符串)
  • 用法:通过 do_action 调用,例如 do_action( 'manage_comments_custom_column', $column_name, $comment->comment_ID )
  • 相关函数:WP_Comments_List_Table::column_default() 使用此 Hook
  • 版本历史:自 WordPress 2.8.0 引入

📄 原文内容

Fires when the default column output is displayed for a single row.

Parameters

$column_namestring
The custom column’s name.
$comment_idstring
The comment ID as a numeric string.

Source

do_action( 'manage_comments_custom_column', $column_name, $comment->comment_ID );

Changelog

Version Description
2.8.0 Introduced.