upgrader_clear_destination
Filters whether the upgrader cleared the destination.
Usage
add_filter( 'upgrader_clear_destination', 'wp_kama_upgrader_clear_destination_filter', 10, 4 ); /** * Function for `upgrader_clear_destination` filter-hook. * * @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. * * @return true|WP_Error */ function wp_kama_upgrader_clear_destination_filter( $removed, $local_destination, $remote_destination, $hook_extra ){ // filter... return $removed; }
- $removed(true|WP_Error)
- Whether the destination was cleared. True upon success, WP_Error on failure.
- $local_destination(string)
- The local package destination.
- $remote_destination(string)
- The remote package destination.
- $hook_extra(array)
- Extra arguments passed to hooked filters.
Changelog
Since 2.8.0 | Introduced. |
Where the hook is called
wp-admin/includes/class-wp-upgrader.php 659
$removed = apply_filters( 'upgrader_clear_destination', $removed, $local_destination, $remote_destination, $args['hook_extra'] );
Where the hook is used in WordPress
wp-admin/includes/class-plugin-upgrader.php 213
add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ), 10, 4 );
wp-admin/includes/class-plugin-upgrader.php 247
remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ) );
wp-admin/includes/class-plugin-upgrader.php 299
add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ), 10, 4 );
wp-admin/includes/class-plugin-upgrader.php 428
remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ) );
wp-admin/includes/class-theme-upgrader.php 318
add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ), 10, 4 );
wp-admin/includes/class-theme-upgrader.php 346
remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ) );
wp-admin/includes/class-theme-upgrader.php 398
add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ), 10, 4 );
wp-admin/includes/class-theme-upgrader.php 528
remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ) );