When updating this object, to prevent infinite loops, use $wpdb to update data, since wp_update_post spawns more calls to the save_post action. This ensures hooks are fired by either WP itself (admin screen save), or an update purely from CRUD.
$product->get_id(
Sortie :
// Ajouter une fonction au hook action 'woocommerce_update_product_variation'
add_action('woocommerce_update_product_variation', 'ma_fonction_personnalisee', 10, 1);
function ma_fonction_personnalisee($product->get_id() {
// Votre code ici
error_log('Hook woocommerce_update_product_variation déclenché');
}
Chargement des actualités...