钩子文档

update-core-custom_{$action}

💡 云策文档标注

概述

此文档介绍 WordPress 更新屏幕上的自定义更新动作钩子 update-core-custom_{$action}。该钩子用于替代所有默认更新动作,允许开发者执行自定义操作。

关键要点

  • 钩子名称 update-core-custom_{$action} 中的 $action 是动态部分,指代传递的更新动作。
  • 此钩子在 WordPress 更新屏幕上触发,用于处理自定义更新动作,而非默认动作。
  • 钩子自 WordPress 3.2.0 版本引入。

代码示例

do_action( "update-core-custom_{$action}" );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores

📄 原文内容

Fires for each custom update action on the WordPress Updates screen.

Description

The dynamic portion of the hook name, $action, refers to the passed update action. The hook fires in lieu of all available default update actions.

Source

do_action( "update-core-custom_{$action}" );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores

Changelog

Version Description
3.2.0 Introduced.