WordPress at Your Fingertips

build_query() WP 1.0

Build URL query based on an associative and, or indexed array.

This is a convenient function for easily building url queries. It sets the separator to '&' and uses _http_build_query() function.

1 time — 0.000001 sec (speed of light) | 50000 times — 0.05 sec (speed of light) | PHP 7.2.5, WP 5.0

No Hooks.


String. URL-encoded string.


build_query( $data );
$data(array) (required)
URL-encode key/value pairs.



Since 2.3.0 Introduced.

Code of build_query() WP 5.8.1

function build_query( $data ) {
	return _http_build_query( $data, null, '&', '', false );

Link (URL)

Helper Functions

No comments
    Log In