Requests::add_transport() WordPress Method

The Requests::add_transport() method is used to add a new transport to the list of available transports. This is useful for adding support for new transport types, or overriding an existing transport.

Requests::add_transport( string $transport ) #

Register a transport


Parameters

$transport

(string)(Required)Transport class to add, must support the Requests_Transport interface


Top ↑

Source

File: wp-includes/class-requests.php

	public static function add_transport($transport) {
		if (empty(self::$transports)) {
			self::$transports = array(
				'Requests_Transport_cURL',
				'Requests_Transport_fsockopen',
			);
		}

		self::$transports = array_merge(self::$transports, array($transport));
	}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.