钩子文档

term_{$field}_rss

💡 云策文档标注

概述

此文档介绍了一个用于 RSS 的 WordPress 过滤器钩子 term_{$field}_rss,它允许开发者修改在 RSS 中使用的术语字段值。钩子名称中的 $field 是动态部分,代表术语字段。

关键要点

  • 过滤器钩子:term_{$field}_rss,用于过滤 RSS 中的术语字段值。
  • 参数:$value(术语字段的值,类型为 mixed)和 $taxonomy(分类法 slug,类型为 string)。
  • 应用场景:在 sanitize_term_field() 函数中调用,用于基于上下文清理术语字段值。
  • 版本历史:自 WordPress 2.3.0 版本引入。

代码示例

$value = apply_filters( "term_{$field}_rss", $value, $taxonomy );

📄 原文内容

Filters the term field for use in RSS.

Description

The dynamic portion of the hook name, $field, refers to the term field.

Parameters

$valuemixed
Value of the term field.
$taxonomystring
Taxonomy slug.

Source

$value = apply_filters( "term_{$field}_rss", $value, $taxonomy );

Changelog

Version Description
2.3.0 Introduced.