Hooks::filter_rest_cart_url( string $url, string $path, int $blog_id, string $scheme )
Modify the Rest URL for the cart to include the TC Cookie.
Contents
Parameters
- $url
-
(string) (Required)
- $path
-
(string) (Required)
- $blog_id
-
(int) (Required)
- $scheme
-
(string) (Required)
Return
(string)
Source
File: src/Tickets/Commerce/Hooks.php
public function filter_rest_cart_url( $url, $path, $blog_id, $scheme ) {
if ( '/cart/' !== $path ) {
return $url;
}
$cookie = tribe_get_request_var( Cart::$cookie_query_arg );
if ( empty( $cookie ) ) {
return $url;
}
return add_query_arg( [ Cart::$cookie_query_arg => $cookie ], $url );
}
Changelog
| Version | Description |
|---|---|
| 5.2.0 | Introduced. |