钩子文档

install_themes_pre_{$tab}

💡 云策文档标注

概述

install_themes_pre_{$tab} 是一个 WordPress 动作钩子,在安装主题页面的每个选项卡渲染前触发。钩子名称中的动态部分 $tab 表示当前的主题安装选项卡。

关键要点

  • 钩子名称包含动态部分 $tab,对应不同的主题安装选项卡。
  • 可能的钩子名称包括 install_themes_pre_block-themes、install_themes_pre_dashboard、install_themes_pre_featured、install_themes_pre_new、install_themes_pre_search、install_themes_pre_updated 和 install_themes_pre_upload。
  • 源代码为 do_action( "install_themes_pre_{$tab}" )。
  • 自 WordPress 6.1.0 版本起添加了 install_themes_pre_block-themes 钩子名称,最初在 2.8.0 版本引入。

📄 原文内容

Fires before each of the tabs are rendered on the Install Themes page.

Description

The dynamic portion of the hook name, $tab, refers to the current theme installation tab.

Possible hook names include:

  • install_themes_pre_block-themes
  • install_themes_pre_dashboard
  • install_themes_pre_featured
  • install_themes_pre_new
  • install_themes_pre_search
  • install_themes_pre_updated
  • install_themes_pre_upload

Source

do_action( "install_themes_pre_{$tab}" );

Changelog

Version Description
6.1.0 Added the install_themes_pre_block-themes hook name.
2.8.0 Introduced.