upgrader_clear_destination
Filter HookDescription
Filters whether the upgrader cleared the destination.Hook Information
File Location |
wp-admin/includes/class-wp-upgrader.php
View on GitHub
|
Hook Type | Filter |
Line Number | 663 |
Hook Parameters
Type | Name | Description |
---|---|---|
true|WP_Error
|
$removed
|
Whether the destination was cleared. True upon success, WP_Error on failure. |
string
|
$local_destination
|
The local package destination. |
string
|
$remote_destination
|
The remote package destination. |
array
|
$hook_extra
|
Extra arguments passed to hooked filters. |
Usage Examples
Basic Usage
<?php
// Hook into upgrader_clear_destination
add_filter('upgrader_clear_destination', 'my_custom_filter', 10, 4);
function my_custom_filter($removed, $local_destination, $remote_destination, $hook_extra) {
// Your custom filtering logic here
return $removed;
}
Source Code Context
wp-admin/includes/class-wp-upgrader.php:663
- How this hook is used in WordPress core
<?php
658 * True upon success, WP_Error on failure.
659 * @param string $local_destination The local package destination.
660 * @param string $remote_destination The remote package destination.
661 * @param array $hook_extra Extra arguments passed to hooked filters.
662 */
663 $removed = apply_filters( 'upgrader_clear_destination', $removed, $local_destination, $remote_destination, $args['hook_extra'] );
664
665 if ( is_wp_error( $removed ) ) {
666 return $removed;
667 }
668 } elseif ( $args['abort_if_destination_exists'] && $wp_filesystem->exists( $remote_destination ) ) {
PHP Documentation
<?php
/**
* Filters whether the upgrader cleared the destination.
*
* @since 2.8.0
*
* @param true|WP_Error $removed Whether the destination was cleared.
* True upon success, WP_Error on failure.
* @param string $local_destination The local package destination.
* @param string $remote_destination The remote package destination.
* @param array $hook_extra Extra arguments passed to hooked filters.
*/
Quick Info
- Hook Type: Filter
- Parameters: 4
- File: wp-admin/includes/class-wp-upgrader.php
Related Hooks
Related hooks will be displayed here in future updates.