WordPress at a glance

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.000001s = speed of light | 50000 times = 0.05s = 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.


  • See: _http_build_query() Used to build the query


Since 2.3.0 Introduced.

Code of build_query() WP 5.6

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

From tag: Link (URL)

More from category: Helper Functions

No comments
    Log In