首页 WordPress函数大全 download_url()

download_url()

2020-05-01 / 3512阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

download_url( string $url, int $timeout = 300, bool $signature_verification = false )

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

描述

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

参数

$url

(string)
(Required)
The URL of the file to download.

$timeout

(int)
(Optional)
The timeout for the request to download the file. Default 300 seconds.

Default value: 300

$signature_verification

(bool)
(Optional)
Whether to perform Signature Verification.

Default value: false

返回

(string|WP_Error) Filename>WP_Error on failure.

大家谈论
    我的见解