On this page
build_query( array $data ): string
Builds 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
$dataarray Required-
URL-encode key/value pairs.
Return
string URL-encoded string.
Source
File: wp-includes/functions.php. View all references
function build_query( $data ) {
return _http_build_query( $data, null, '&', '', false );
}
Related
Uses
| Uses | Description |
|---|---|
| _http_build_query() wp-includes/functions.php | From php.net (modified by Mark Jaquith to behave like the native PHP5 function). |
Used By
| Used By | Description |
|---|---|
| WP_REST_Pattern_Directory_Controller::get_items() wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php | Search and retrieve block patterns metadata |
| add_query_arg() wp-includes/functions.php | Retrieves a modified URL query string. |
Changelog
| Version | Description |
|---|---|
| 2.3.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/build_query