upgrader_pre_download
Filters whether to return the package.
Description
Parameters (3)
- 0. $false (bool) =>
false
- Whether to bail without returning the package. Default false.
- 1. $package (string)
- The package file name.
- 2. $instance (WP_Upgrader)
- The
WP_Upgrader
instance.
Usage
- To run the hook, copy the example below.
- $false = apply_filters( 'upgrader_pre_download', $false, $package, $instance );
- if ( !empty( $false ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the upgrader_pre_download callback
- function filter_upgrader_pre_download( $false, $package, $instance ) {
- // make filter magic happen here...
- return $false;
- };
- // add the filter
- add_filter( 'upgrader_pre_download', 'filter_upgrader_pre_download', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'upgrader_pre_download', 'filter_upgrader_pre_download', 10, 3 );
Defined (1)
The filter is defined in the following location(s).
- /wp-admin/includes/class-wp-upgrader.php
- $reply = apply_filters( 'upgrader_pre_download', false, $package, $this );