Uses
Uses | Description |
---|---|
wp-includes/Requests/Cookie.php: Requests_Cookie::__construct() | Create a new cookie object |
wp-includes/Requests/Cookie/Jar.php: Requests_Cookie_Jar::__construct() | Create a new jar |
Normalizes cookies for using in Requests.
(array) (Required) Array of cookies to send with the request.
(Requests_Cookie_Jar) Cookie holder object.
File: wp-includes/class-http.php
public static function normalize_cookies( $cookies ) { $cookie_jar = new Requests_Cookie_Jar(); foreach ( $cookies as $name => $value ) { if ( $value instanceof WP_Http_Cookie ) { $cookie_jar[ $value->name ] = new Requests_Cookie( $value->name, $value->value, $value->get_attributes(), array( 'host-only' => $value->host_only ) ); } elseif ( is_scalar( $value ) ) { $cookie_jar[ $name ] = new Requests_Cookie( $name, $value ); } } return $cookie_jar; }
Version | Description |
---|---|
4.6.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_http/normalize_cookies