Curl::get_subrequest_handle()publicWP 1.0

Get the cURL handle for use in a multi-request

Метод класса: Curl{}

Хуков нет.


resource|\CurlHandle. Subrequest's cURL handle


$Curl = new Curl();
$Curl->&get_subrequest_handle( $url, $headers, $data, $options );
$url(строка) (обязательный)
URL to request
$headers(массив) (обязательный)
Associative array of request headers
$data(строка|массив) (обязательный)
Data to send either as the POST body, or as parameters in the URL for a GET/HEAD
$options(массив) (обязательный)
Request options, see {@see \WpOrg\Requests\Requests::response()} for documentation

Код Curl::get_subrequest_handle() WP 6.3.1

public function &get_subrequest_handle($url, $headers, $data, $options) {
	$this->setup_handle($url, $headers, $data, $options);

	if ($options['filename'] !== false) {
		$this->stream_handle = fopen($options['filename'], 'wb');

	$this->response_data       = '';
	$this->response_bytes      = 0;
	$this->response_byte_limit = false;
	if ($options['max_bytes'] !== false) {
		$this->response_byte_limit = $options['max_bytes'];

	$this->hooks = $options['hooks'];

	return $this->handle;