钩子文档

in_theme_update_message-{$theme_key}

💡 云策文档标注

概述

此文档描述了 in_theme_update_message-{$theme_key} 钩子,它在主题列表表格的每一行更新消息容器末尾触发,用于自定义主题更新信息的显示。

关键要点

  • 钩子名称:in_theme_update_message-{$theme_key},其中 $theme_key 是动态部分,指 WordPress.org 主题仓库中的主题 slug。
  • 触发时机:在主题列表表格的每一行更新消息容器末尾触发。
  • 参数:$theme(WP_Theme 对象)和 $response(包含可用主题更新元数据的数组,如 new_version、url、package)。
  • 相关函数:wp_theme_update_row() 使用此钩子来显示主题更新信息。
  • 引入版本:WordPress 3.1.0。

代码示例

do_action( "in_theme_update_message-{$theme_key}", $theme, $response );

📄 原文内容

Fires at the end of the update message container in each row of the themes list table.

Description

The dynamic portion of the hook name, $theme_key, refers to the theme slug as found in the WordPress.org themes repository.

Parameters

$themeWP_Theme
The WP_Theme object.
$responsearray
An array of metadata about the available theme update.

  • new_version string
    New theme version.
  • url string
    Theme URL.
  • package string
    Theme update package URL.

Source

do_action( "in_theme_update_message-{$theme_key}", $theme, $response ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores

Changelog

Version Description
3.1.0 Introduced.