Add filter to customize the REST add_product response
-
Hello,
We are using version 2.3.6 and hit a little road block.
We are integrating Google Tag Manager and GA4 which suggests the
add_to_wishlist
event to be implemented. However your plugin does not provide theitem_title
in theadd_product
endpoint.This could be easily solved by adding a WordPress filter. I suggest modifying your function
wishlist_add_product
inincludes/api/wishlist.class.php
as follows:Replace line 322:
return rest_ensure_response($response);
With this:
return rest_ensure_response(apply_filters('tinvwl_api_wishlist_add_product_response', $response));
This way the response can be modified by WordPress filter and customized for specific use cases.
Best Regards,
Darko
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Add filter to customize the REST add_product response’ is closed to new replies.