WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru WPmentor - Ищем топовых специалистов по WordPress, чтобы помочь вам заработать
функция не описана

WP_Upgrader::download_package() WP 2.8.0

Download a package.

Это метод класса: WP_Upgrader

Хуки из метода
Возвращает

Строку/WP_Error. The full path to the downloaded package file, or a WP_Error object.

Использование

$WP_Upgrader = new WP_Upgrader();
$var = $WP_Upgrader->download_package( $package, $check_signatures );
$package(строка) (обязательный)
The URI of the package. If this is the full path to an existing local file, it will be returned untouched.
$check_signatures(true/false)
Whether to validate file signatures.
По умолчанию: false

Список изменений

С версии 2.8.0 Введена.

Код WP Upgrader::download package: wp-admin/includes/class-wp-upgrader.php WP 5.4

<?php
public function download_package( $package, $check_signatures = false ) {

	/**
	 * 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 ) ) {
		return new WP_Error( 'no_package', $this->strings['no_package'] );
	}

	$this->skin->feedback( 'downloading_package', $package );

	$download_file = download_url( $package, 300, $check_signatures );

	if ( is_wp_error( $download_file ) && ! $download_file->get_error_data( 'softfail-filename' ) ) {
		return new WP_Error( 'download_failed', $this->strings['download_failed'], $download_file->get_error_message() );
	}

	return $download_file;
}