build_query() WordPress Function
The build_query() function is used to generate a URL-encoded query string from an array of data. This function can be useful when you need to create a link to another page with a query string that contains multiple parameters.
build_query( array $data ) #
Build URL query based on an associative and, or indexed array.
Description
This is a convenient function for easily building url queries. It sets the separator to ‘&’ and uses _http_build_query() function.
See also
- _http_build_query(): Used to build the query
Parameters
- $data
(array)(Required)URL-encode key/value pairs.
Return
(string) URL-encoded string.
Source
File: wp-includes/functions.php
function build_query( $data ) { return _http_build_query( $data, null, '&', '', false ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |