WP_Http_Cookie::getHeaderValue() public WP 2.8.0
Convert cookie name and value back to header string.
{} It's a method of the class: WP_Http_Cookie{}
Hooks from the method
Return
String. Header encoded cookie name and value.
Usage
$WP_Http_Cookie = new WP_Http_Cookie(); $WP_Http_Cookie->getHeaderValue() // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid;
Changelog
Since 2.8.0 | Introduced. |
Code of WP_Http_Cookie::getHeaderValue() WP Http Cookie::getHeaderValue WP 5.6
public function getHeaderValue() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
if ( ! isset( $this->name ) || ! isset( $this->value ) ) {
return '';
}
/**
* Filters the header-encoded cookie value.
*
* @since 3.4.0
*
* @param string $value The cookie value.
* @param string $name The cookie name.
*/
return $this->name . '=' . apply_filters( 'wp_http_cookie_value', $this->value, $this->name );
}