Requests::flatten() WordPress Method

The Requests::flatten() method takes an array of request objects and returns a flattened array of request objects. This is useful for making sure that all of the requests in an array are processed in the same order.

Requests::flatten( array $array ) #

Convert a key => value array to a ‘key: value’ array for headers


Parameters

$array

(array)(Required)Dictionary of header values


Top ↑

Return

(array) List of headers


Top ↑

Source

File: wp-includes/class-requests.php

	public static function flatten($array) {
		$return = array();
		foreach ($array as $key => $value) {
			$return[] = sprintf('%s: %s', $key, $value);
		}
		return $return;
	}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.