Support » Plugin: TI WooCommerce Wishlist » Add filter to customize the REST add_product response

  • Resolved Darko G.



    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 the item_title in the add_product endpoint.

    This could be easily solved by adding a WordPress filter. I suggest modifying your function wishlist_add_product in includes/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,

Viewing 1 replies (of 1 total)
  • Plugin Author templateinvaders



    Thank you for the suggestion. In plugin version 2.4.0, we have added two filters that allow you to extend REST API responses.

    Please check the filters tinvwl_api_wishlist_data_response and tinvwl_api_product_data_response.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.