Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

WC_REST_Authentication::join_with_equals_sign( array $params, array $query_params = array(), string $key = '' )

Creates an array of urlencoded strings out of each array key/value pairs.


Description Description


Parameters Parameters

$params

(Required) Array of parameters to convert.

$query_params

(Optional) Array to extend.

Default value: array()

$key

(Optional) Array key to append.

Default value: ''


Top ↑

Return Return

(string) Array of urlencoded strings.


Top ↑

Source Source

File: includes/class-wc-rest-authentication.php

	private function join_with_equals_sign( $params, $query_params = array(), $key = '' ) {
		foreach ( $params as $param_key => $param_value ) {
			if ( $key ) {
				$param_key = $key . '%5B' . $param_key . '%5D'; // Handle multi-dimensional array.
			}

			if ( is_array( $param_value ) ) {
				$query_params = $this->join_with_equals_sign( $param_value, $query_params, $param_key );
			} else {
				$string         = $param_key . '=' . $param_value; // Join with equals sign.
				$query_params[] = wc_rest_urlencode_rfc3986( $string );
			}
		}

		return $query_params;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.