钩子文档

{$taxonomy}_pre_add_form

💡 云策文档标注

概述

这是一个 WordPress 钩子,在所有分类法的添加术语表单之前触发。钩子名称是动态的,基于分类法 slug。

关键要点

  • 钩子名称格式为 {$taxonomy}_pre_add_form,其中 $taxonomy 是分类法 slug。
  • 示例钩子名称包括 category_pre_add_form 和 post_tag_pre_add_form。
  • 参数为 $taxonomy,类型为字符串,表示分类法 slug。
  • 源代码为 do_action( "{$taxonomy}_pre_add_form", $taxonomy );。
  • 自 WordPress 3.0.0 版本引入。

📄 原文内容

Fires before the Add Term form for all taxonomies.

Description

The dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug.

Possible hook names include:

  • category_pre_add_form
  • post_tag_pre_add_form

Parameters

$taxonomystring
The taxonomy slug.

Source

do_action( "{$taxonomy}_pre_add_form", $taxonomy );

Changelog

Version Description
3.0.0 Introduced.