download_url


download_url ( $url, $timeout = 300 )

Parameters:
  • (string) $url The URL of the file to download.
  • (int) $timeout The timeout for the request to download the file. Default 300 seconds.
Returns:
  • (string|WP_Error) Filename on success, WP_Error on failure.
Defined at:

Description

Downloads a URL to a local temporary file using the WordPress HTTP API.

Please note that the calling function must unlink() the file.

Related Functions

wp_login_url, wp_nonce_url, wp_lostpassword_url, includes_url, admin_url

Top Google Results

User discussions

wpseek mobile