manage_{$this->screen->id}_custom_column
云策文档标注
概述
此 Hook 用于在应用密码列表表格中为每个自定义列触发操作,允许开发者自定义列内容。它通过传递列名和应用密码项作为参数,与 'manage_application-passwords-user_columns' 过滤器配合使用。
关键要点
- Hook 名称:manage_{$this->screen->id}_custom_column,其中 $this->screen->id 动态生成,如 'application-passwords-user'。
- 参数:$column_name(字符串,自定义列名)和 $item(数组,应用密码项)。
- 用途:在 WP_Application_Passwords_List_Table 和 WP_Privacy_Requests_Table 等类中,用于生成表格行的默认列内容。
- 引入版本:WordPress 5.6.0。
代码示例
do_action( "manage_{$this->screen->id}_custom_column", $column_name, $item );注意事项
- 自定义列需先通过 'manage_application-passwords-user_columns' 过滤器注册。
- 此 Hook 主要用于后台管理界面,开发者应确保代码安全性和性能。
原文内容
Fires for each custom column in the Application Passwords list table.
Description
Custom columns are registered using the ‘manage_application-passwords-user_columns’ filter.
Parameters
$column_namestring-
Name of the custom column.
$itemarray-
The application password item.
Source
do_action( "manage_{$this->screen->id}_custom_column", $column_name, $item );
Changelog
| Version | Description |
|---|---|
| 5.6.0 | Introduced. |