钩子文档

install_themes_table_api_args_{$tab}

💡 云策文档标注

概述

此文档介绍 install_themes_table_api_args_{$tab} 过滤器,用于在 WordPress 主题安装屏幕的不同标签页中过滤 API 请求参数。动态钩子名称中的 $tab 部分对应特定标签页,如 dashboard、featured 等。

关键要点

  • 这是一个动态过滤器钩子,名称格式为 install_themes_table_api_args_{$tab},其中 $tab 是主题安装标签页的标识符。
  • 钩子用于修改或过滤主题安装 API 的参数,参数 $args 可以是数组或 false。
  • 在 WP_Theme_Install_List_Table::prepare_items() 方法中调用,位于 wp-admin/includes/class-wp-theme-install-list-table.php 文件。
  • 自 WordPress 3.7.0 版本引入。

📄 原文内容

Filters API request arguments for each Install Themes screen tab.

Description

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

Possible hook names include:

  • install_themes_table_api_args_dashboard
  • install_themes_table_api_args_featured
  • install_themes_table_api_args_new
  • install_themes_table_api_args_search
  • install_themes_table_api_args_updated
  • install_themes_table_api_args_upload

Parameters

$argsarray|false
Theme install API arguments.

Source

$args = apply_filters( "install_themes_table_api_args_{$tab}", $args );

Changelog

Version Description
3.7.0 Introduced.