钩子文档

the_terms

💡 云策文档标注

概述

the_terms 是一个 WordPress 过滤器,用于过滤要显示的术语列表。它允许开发者在输出术语时自定义列表内容、格式和前后缀。

关键要点

  • 过滤器名称:the_terms
  • 参数:$term_list(术语列表字符串)、$taxonomy(分类法名称)、$before(前缀字符串)、$sep(分隔符字符串)、$after(后缀字符串)
  • 应用方式:通过 apply_filters 调用,常用于 the_terms() 函数中
  • 相关函数:the_terms() 用于在列表中显示文章的术语
  • 引入版本:WordPress 2.9.0

📄 原文内容

Filters the list of terms to display.

Parameters

$term_liststring
List of terms to display.
$taxonomystring
The taxonomy name.
$beforestring
String to use before the terms.
$sepstring
String to use between the terms.
$afterstring
String to use after the terms.

Source

echo apply_filters( 'the_terms', $term_list, $taxonomy, $before, $sep, $after );

Changelog

Version Description
2.9.0 Introduced.