wphooks.info - upgrader_pre_download

upgrader_pre_download

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-admin/includes/class-wp-upgrader.php:
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
		/**
		 * Filters whether to return the package.
		 *
		 * @since 3.7.0
		 *
		 * @param bool        $reply   Whether to bail without returning the package.
		 *                             Default false.
		 * @param string      $package The package file name.
		 * @param WP_Upgrader $this    The WP_Upgrader instance.
		 */
		$reply = apply_filters( 'upgrader_pre_download', false, $package, $this );
		if ( false !== $reply ) {
			return $reply;
		}

		if ( ! preg_match( '!^(http|https|ftp)://!i', $package ) && file_exists( $package ) ) { //Local file or remote?
			return $package; //must be a local file..
		}

		if ( empty( $package ) ) {