钩子文档

site_health_tab_content

💡 云策文档标注

概述

site_health_tab_content 是一个 WordPress 动作钩子,用于在输出自定义站点健康选项卡内容时触发。它允许开发者在用户查看自定义选项卡时执行自定义代码。

关键要点

  • 此钩子在站点健康页面的标题之后触发,用于输出自定义选项卡的内容。
  • 用户必须通过站点健康页面的权限检查才能查看自定义选项卡及其内容。
  • 钩子接收一个参数 $tab,表示请求的选项卡的 slug。
  • 源代码为 do_action( 'site_health_tab_content', $_GET['tab'] ),从 WordPress 5.8.0 版本引入。

📄 原文内容

Fires when outputting the content of a custom Site Health tab.

Description

This action fires right after the Site Health header, and users are still subject to the capability checks for the Site Health page to view any custom tabs and their contents.

Parameters

$tabstring
The slug of the tab that was requested.

Source

do_action( 'site_health_tab_content', $_GET['tab'] );

Changelog

Version Description
5.8.0 Introduced.