@@ -292,30 +292,32 @@ public function fs_connect( $directories = array(), $allow_relaxed_file_ownershi
292292 }
293293
294294 /**
295- * Downloads a package.
295+ * Downloads a package for a WordPress core, plugin, theme, or translation upgrade .
296296 *
297297 * @since 2.8.0
298298 * @since 5.2.0 Added the `$check_signatures` parameter.
299299 * @since 5.5.0 Added the `$hook_extra` parameter.
300300 *
301- * @param string $package The URI of the package. If this is the full path to an
302- * existing local file, it will be returned untouched.
301+ * @param string $package The URI of the package. May be a remote URL or local file path. If this is the full
302+ * path to an existing local file, it will be returned untouched.
303303 * @param bool $check_signatures Whether to validate file signatures. Default false.
304304 * @param array $hook_extra Extra arguments to pass to the filter hooks. Default empty array.
305305 * @return string|WP_Error The full path to the downloaded package file, or a WP_Error object.
306306 */
307307 public function download_package ( $ package , $ check_signatures = false , $ hook_extra = array () ) {
308308 /**
309- * Filters whether to return the package.
309+ * Filters whether to download a package for a WordPress core, plugin, theme, or translation upgrade.
310+ *
311+ * Return a non-false value to short-circuit the download and return that value instead.
310312 *
311313 * @since 3.7.0
312314 * @since 5.5.0 Added the `$hook_extra` parameter.
313315 *
314- * @param bool $reply Whether to bail without returning the package.
315- * Default false.
316- * @param string $package The package file name .
317- * @param WP_Upgrader $upgrader The WP_Upgrader instance.
318- * @param array $hook_extra Extra arguments passed to hooked filters.
316+ * @param false|string|WP_Error $reply Whether to short-circuit the download, the path to the downloaded package,
317+ * or a WP_Error object. Default false.
318+ * @param string $package The package URI. May be a remote URL or local file path .
319+ * @param WP_Upgrader $upgrader The WP_Upgrader instance.
320+ * @param array $hook_extra Extra arguments passed to hooked filters.
319321 */
320322 $ reply = apply_filters ( 'upgrader_pre_download ' , false , $ package , $ this , $ hook_extra );
321323 if ( false !== $ reply ) {
@@ -519,7 +521,6 @@ public function install_package( $args = array() ) {
519521
520522 $ args = wp_parse_args ( $ args , $ defaults );
521523
522- // These were previously extract()'d.
523524 $ source = $ args ['source ' ];
524525 $ destination = $ args ['destination ' ];
525526 $ clear_destination = $ args ['clear_destination ' ];
@@ -592,10 +593,10 @@ public function install_package( $args = array() ) {
592593 * @since 2.8.0
593594 * @since 4.4.0 The `$hook_extra` parameter became available.
594595 *
595- * @param string $source File source location.
596- * @param string $remote_source Remote file source location.
597- * @param WP_Upgrader $upgrader WP_Upgrader instance.
598- * @param array $hook_extra Extra arguments passed to hooked filters.
596+ * @param string|WP_Error $source File source location or a WP_Error object .
597+ * @param string $remote_source Remote file source location.
598+ * @param WP_Upgrader $upgrader WP_Upgrader instance.
599+ * @param array $hook_extra Extra arguments passed to hooked filters.
599600 */
600601 $ source = apply_filters ( 'upgrader_source_selection ' , $ source , $ remote_source , $ this , $ args ['hook_extra ' ] );
601602
0 commit comments