钩子文档

term_name

💡 云策文档标注

概述

此文档介绍 WordPress 中的 'term_name' 过滤器,用于在术语列表表格中过滤术语名称的显示。默认输出可能因术语在层级中的位置而包含填充。

关键要点

  • 过滤器名称:'term_name',用于修改术语名称在列表中的显示。
  • 参数:$pad_tag_name(字符串,可能包含填充的术语名称)和 $tag(WP_Term 对象)。
  • 相关函数:WP_Terms_List_Table::column_name(),在 wp-admin/includes/class-wp-terms-list-table.php 中定义。
  • 引入版本:WordPress 2.5.0。

注意事项

  • 使用此过滤器时需注意,存在另一个 'term_{$field}' 过滤器,其参数和数量不同,请参考 Trac 票证获取更多细节。

📄 原文内容

Filters display of the term name in the terms list table.

Description

The default output may include padding due to the term’s current level in the term hierarchy.

See also

Parameters

$pad_tag_namestring
The term name, padded if not top-level.
$tagWP_Term
Term object.

Source

$name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag );

Changelog

Version Description
2.5.0 Introduced.

User Contributed Notes