钩子文档

upgrader_clear_destination

💡 云策文档标注

概述

upgrader_clear_destination 是一个 WordPress 过滤器钩子,用于在升级器清理目标目录时进行干预。它允许开发者检查或修改清理操作的结果,并传递相关参数。

关键要点

  • 这是一个过滤器钩子,用于控制升级器是否成功清理目标目录。
  • 参数包括清理结果(布尔值或 WP_Error)、本地和远程目标路径,以及额外的钩子参数数组。
  • 在 WP_Upgrader::install_package() 方法中使用,自 WordPress 2.8.0 版本引入。

📄 原文内容

Filters whether the upgrader cleared the destination.

Parameters

$removedtrue|WP_Error
Whether the destination was cleared.
True upon success, WP_Error on failure.
$local_destinationstring
The local package destination.
$remote_destinationstring
The remote package destination.
$hook_extraarray
Extra arguments passed to hooked filters.

Source

$removed = apply_filters( 'upgrader_clear_destination', $removed, $local_destination, $remote_destination, $args['hook_extra'] );

Changelog

Version Description
2.8.0 Introduced.