Open decodekult opened 2 months ago
The changes in the dokan-wpml.php
file introduce new action hooks to enhance product deletion functionality within the Dokan plugin, particularly for WPML support. The before_product_delete
method is added to manage the deletion of product translations when a product is removed from the dashboard, ensuring that associated multilingual content is handled correctly.
File | Change Summary |
---|---|
dokan-wpml.php | Added public function before_product_delete() to handle deletion of post translations. Added action hooks dokan_product_delete and dokan_product_bulk_delete to trigger this method. |
Objective | Addressed | Explanation |
---|---|---|
Deleting products from the dashboard does not delete translations (#82) | ✅ |
Dokan_WPML
class, enhancing multilingual support in a related context.In the fields where products play,
A rabbit hops, "Hooray, hooray!
With translations gone, we cheer,
Deleting's smooth, no need to fear!
WPML and Dokan dance in tune,
A multilingual afternoon!" 🐇✨
[!TIP]
OpenAI O1 model for chat
- We have deployed OpenAI's latest O1 model for chat. - OpenAI claims that this model has superior reasoning capabilities than their GPT-4o model. - Please share any feedback with us in the [discussions post](https://discord.com/channels/1134356397673414807/1283929536186155099).
dokan-wpml.php (1)
`1305-1310`: **LGTM!** The `before_product_delete` function correctly integrates with WPML to handle the deletion of product translations when a product is deleted from the frontend dashboard. It checks for the required WPML class and adds the necessary action using the global `$wpml_post_translations` object.
Using the actions introduced in https://github.com/getdokan/dokan/pull/2368, enable the WPML post delete actions when deleting posts from the Dokan dashboard.
Closes https://github.com/getdokan/dokan-wpml/issues/82
Summary by CodeRabbit
These changes improve the coherence of multilingual content management within the Dokan plugin.