Used By
Used By | Description |
---|---|
wp-includes/Requests/Transport/cURL.php: Requests_Transport_cURL::setup_handle() | Setup the cURL handle for the given data |
Format a URL given GET data
(string) (Required)
(array|object) (Required) Data to build query using, see https://secure.php.net/http_build_query
(string) URL with data
File: wp-includes/Requests/Transport/cURL.php
protected static function format_get($url, $data) { if (!empty($data)) { $url_parts = parse_url($url); if (empty($url_parts['query'])) { $query = $url_parts['query'] = ''; } else { $query = $url_parts['query']; } $query .= '&' . http_build_query($data, null, '&'); $query = trim($query, '&'); if (empty($url_parts['query'])) { $url .= '?' . $query; } else { $url = str_replace($url_parts['query'], $query, $url); } } return $url; }
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/requests_transport_curl/format_get